mirror of
https://github.com/nextcloud/android.git
synced 2024-11-26 23:28:42 +03:00
Remove old storage location dialogue
Signed-off-by: ZetaTom <70907959+ZetaTom@users.noreply.github.com>
This commit is contained in:
parent
1f88ba0333
commit
7be7026fa9
2 changed files with 0 additions and 49 deletions
|
@ -57,8 +57,6 @@ import com.owncloud.android.authentication.AuthenticatorActivity;
|
|||
import com.owncloud.android.datamodel.ArbitraryDataProvider;
|
||||
import com.owncloud.android.datamodel.ArbitraryDataProviderImpl;
|
||||
import com.owncloud.android.datamodel.ExternalLinksProvider;
|
||||
import com.owncloud.android.datastorage.DataStorageProvider;
|
||||
import com.owncloud.android.datastorage.StoragePoint;
|
||||
import com.owncloud.android.lib.common.ExternalLink;
|
||||
import com.owncloud.android.lib.common.ExternalLinkType;
|
||||
import com.owncloud.android.lib.common.utils.Log_OC;
|
||||
|
@ -129,7 +127,6 @@ public class SettingsActivity extends PreferenceActivity
|
|||
private ThemeableSwitchPreference showEcosystemApps;
|
||||
private AppCompatDelegate delegate;
|
||||
|
||||
private ListPreference prefStoragePath;
|
||||
private Preference prefDataLoc;
|
||||
private String storagePath;
|
||||
private String pendingLock;
|
||||
|
@ -804,34 +801,6 @@ public class SettingsActivity extends PreferenceActivity
|
|||
final PreferenceCategory preferenceCategoryGeneral = (PreferenceCategory) findPreference("general");
|
||||
viewThemeUtils.files.themePreferenceCategory(preferenceCategoryGeneral);
|
||||
|
||||
prefStoragePath = (ListPreference) findPreference(AppPreferencesImpl.STORAGE_PATH);
|
||||
if (prefStoragePath != null) {
|
||||
StoragePoint[] storageOptions = DataStorageProvider.getInstance().getAvailableStoragePoints();
|
||||
String[] entries = new String[storageOptions.length];
|
||||
String[] values = new String[storageOptions.length];
|
||||
for (int i = 0; i < storageOptions.length; ++i) {
|
||||
entries[i] = storageOptions[i].getDescription();
|
||||
values[i] = storageOptions[i].getPath();
|
||||
}
|
||||
prefStoragePath.setEntries(entries);
|
||||
prefStoragePath.setEntryValues(values);
|
||||
|
||||
prefStoragePath.setOnPreferenceChangeListener((preference, newValue) -> {
|
||||
String newPath = (String) newValue;
|
||||
|
||||
if (storagePath.equals(newPath)) {
|
||||
return true;
|
||||
}
|
||||
StorageMigration storageMigration = new StorageMigration(this, user, storagePath, newPath, viewThemeUtils);
|
||||
storageMigration.setStorageMigrationProgressListener(this);
|
||||
storageMigration.migrate();
|
||||
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
loadStoragePath();
|
||||
|
||||
prefDataLoc = findPreference(AppPreferencesImpl.DATA_STORAGE_LOCATION);
|
||||
if (prefDataLoc != null) {
|
||||
prefDataLoc.setOnPreferenceClickListener(p -> {
|
||||
|
@ -1159,21 +1128,6 @@ public class SettingsActivity extends PreferenceActivity
|
|||
SharedPreferences.Editor editor = appPrefs.edit();
|
||||
editor.putString(AppPreferencesImpl.STORAGE_PATH, storagePath);
|
||||
editor.apply();
|
||||
String storageDescription = DataStorageProvider.getInstance().getStorageDescriptionByPath(storagePath);
|
||||
prefStoragePath.setSummary(storageDescription);
|
||||
prefStoragePath.setValue(newStoragePath);
|
||||
}
|
||||
|
||||
/**
|
||||
* Load storage path set on preferences
|
||||
*/
|
||||
private void loadStoragePath() {
|
||||
SharedPreferences appPrefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
|
||||
// Load storage path from shared preferences. Use private internal storage by default.
|
||||
storagePath = appPrefs.getString(AppPreferencesImpl.STORAGE_PATH,
|
||||
getApplicationContext().getFilesDir().getAbsolutePath());
|
||||
String storageDescription = DataStorageProvider.getInstance().getStorageDescriptionByPath(storagePath);
|
||||
prefStoragePath.setSummary(storageDescription);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -13,9 +13,6 @@
|
|||
<PreferenceCategory
|
||||
android:title="@string/prefs_category_general"
|
||||
android:key="general">
|
||||
<ListPreference
|
||||
android:title="@string/prefs_data_storage_location"
|
||||
android:key="storage_path"/>
|
||||
<Preference
|
||||
android:title="@string/prefs_data_storage_location"
|
||||
android:key="data_storage_location" />
|
||||
|
|
Loading…
Reference in a new issue