Invert if condition in ContentSettingsFragment.setImportExportDataPath for better readability
This commit is contained in:
parent
fa2b11b768
commit
92ab9cae27
|
@ -257,15 +257,15 @@ public class ContentSettingsFragment extends BasePreferenceFragment {
|
|||
|
||||
private void setImportExportDataPath(final File file) {
|
||||
final String directoryPath;
|
||||
if (!file.isDirectory()) {
|
||||
if (file.isDirectory()) {
|
||||
directoryPath = file.getAbsolutePath();
|
||||
} else {
|
||||
final File parentFile = file.getParentFile();
|
||||
if (parentFile != null) {
|
||||
directoryPath = parentFile.getAbsolutePath();
|
||||
} else {
|
||||
directoryPath = "";
|
||||
}
|
||||
} else {
|
||||
directoryPath = file.getAbsolutePath();
|
||||
}
|
||||
defaultPreferences.edit().putString(importExportDataPathKey, directoryPath).apply();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue