X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/8aa10abb181ee596ffaa751b6dfcb0da10a51d9e..cdabcf7b34dfe47835fdf1bee5a538928d966dce:/src/com/owncloud/android/ui/activity/Preferences.java diff --git a/src/com/owncloud/android/ui/activity/Preferences.java b/src/com/owncloud/android/ui/activity/Preferences.java index 915e4844..60687ce7 100644 --- a/src/com/owncloud/android/ui/activity/Preferences.java +++ b/src/com/owncloud/android/ui/activity/Preferences.java @@ -619,13 +619,12 @@ public class Preferences extends PreferenceActivity migrationIntent.putExtra(StorageMigrationActivity.KEY_MIGRATION_SOURCE_DIR, currentStorageDir.getAbsolutePath()); migrationIntent.putExtra(StorageMigrationActivity.KEY_MIGRATION_TARGET_DIR, - currentStorageDir.getAbsolutePath()); + upcomingStorageDir.getAbsolutePath()); startActivityForResult(migrationIntent, ACTION_PERFORM_MIGRATION); } } else if (requestCode == ACTION_PERFORM_MIGRATION && resultCode == RESULT_OK) { String resultStorageDir = data.getStringExtra(StorageMigrationActivity.KEY_MIGRATION_TARGET_DIR); - mStoragePath = resultStorageDir; - mPrefStoragePath.setSummary(mStoragePath); + saveStoragePath(resultStorageDir); } } @@ -835,6 +834,19 @@ public class Preferences extends PreferenceActivity } /** + * Save storage path + */ + private void saveStoragePath(String newStoragePath) { + SharedPreferences appPrefs = + PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); + mStoragePath = newStoragePath; + MainApp.setStoragePath(mStoragePath); + SharedPreferences.Editor editor = appPrefs.edit(); + editor.putString("storage_path", mStoragePath); + mPrefStoragePath.setSummary(mStoragePath); + } + + /** * Load storage path set on preferences */ private void loadStoragePath() { @@ -842,7 +854,7 @@ public class Preferences extends PreferenceActivity PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); mStoragePath = appPrefs.getString("storage_path", Environment.getExternalStorageDirectory() .getAbsolutePath()); - mPrefStoragePath.setSummary(mStoragePath + File.separator + MainApp.getDataFolder()); + mPrefStoragePath.setSummary(mStoragePath); } /**