From: kruland2607 Date: Tue, 3 Jul 2012 02:55:46 +0000 (+0000) Subject: If the filename doesn't end in .ork, append .ork to indicate the saved file is ork... X-Git-Tag: upstream/12.09^2~130 X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=f2eef26fae9f3a3f52acbd064281fcaae120d572;p=debian%2Fopenrocket If the filename doesn't end in .ork, append .ork to indicate the saved file is ork format. This application doesn't attempt to save Rocsim files. git-svn-id: https://openrocket.svn.sourceforge.net/svnroot/openrocket/trunk@859 180e2498-e6e9-4542-8430-84ac67f01cd8 --- diff --git a/android/src/net/sf/openrocket/android/CurrentRocket.java b/android/src/net/sf/openrocket/android/CurrentRocket.java index 596e2e0c..aafbb063 100644 --- a/android/src/net/sf/openrocket/android/CurrentRocket.java +++ b/android/src/net/sf/openrocket/android/CurrentRocket.java @@ -91,11 +91,20 @@ public class CurrentRocket { } public void saveOpenRocketDocument() throws IOException { + + // Translate the fileUri if it happens to be a .rkt file. + + String filename = fileUri.getPath(); + + if ( ! filename.endsWith(".ork") ) { + filename = filename.concat(".ork"); + } + OpenRocketSaver saver = new OpenRocketSaver(); StorageOptions options = new StorageOptions(); options.setCompressionEnabled(true); options.setSimulationTimeSkip(StorageOptions.SIMULATION_DATA_ALL); - saver.save(new File(fileUri.getPath()),rocketDocument,options); + saver.save(new File(filename),rocketDocument,options); isModified = false; }