If the filename doesn't end in .ork, append .ork to indicate the saved file is ork...
authorkruland2607 <kruland2607@180e2498-e6e9-4542-8430-84ac67f01cd8>
Tue, 3 Jul 2012 02:55:46 +0000 (02:55 +0000)
committerkruland2607 <kruland2607@180e2498-e6e9-4542-8430-84ac67f01cd8>
Tue, 3 Jul 2012 02:55:46 +0000 (02:55 +0000)
git-svn-id: https://openrocket.svn.sourceforge.net/svnroot/openrocket/trunk@859 180e2498-e6e9-4542-8430-84ac67f01cd8

android/src/net/sf/openrocket/android/CurrentRocket.java

index 596e2e0ce0bb4ec6695b0edba0f610cfc0dfbd94..aafbb06313da1d6e14826f36285f18977e836f90 100644 (file)
@@ -91,11 +91,20 @@ public class CurrentRocket {
        }\r
        \r
        public void saveOpenRocketDocument() throws IOException {\r
+               \r
+               // Translate the fileUri if it happens to be a .rkt file.\r
+\r
+               String filename = fileUri.getPath();\r
+               \r
+               if ( ! filename.endsWith(".ork") ) {\r
+                       filename = filename.concat(".ork");\r
+               }\r
+               \r
                OpenRocketSaver saver = new OpenRocketSaver();\r
                StorageOptions options = new StorageOptions();\r
                options.setCompressionEnabled(true);\r
                options.setSimulationTimeSkip(StorageOptions.SIMULATION_DATA_ALL);\r
-               saver.save(new File(fileUri.getPath()),rocketDocument,options);\r
+               saver.save(new File(filename),rocketDocument,options);\r
                isModified = false;\r
        }\r
 \r