From f2eef26fae9f3a3f52acbd064281fcaae120d572 Mon Sep 17 00:00:00 2001 From: kruland2607 Date: Tue, 3 Jul 2012 02:55:46 +0000 Subject: [PATCH] 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 --- .../src/net/sf/openrocket/android/CurrentRocket.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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; } -- 2.47.2