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