From 0691153b51170f0dfd03dbda3f3eba13a4b395ce Mon Sep 17 00:00:00 2001 From: Kevin Ruland 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. --- .../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 596e2e0ce..aafbb0631 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; }