Invert if condition in ContentSettingsFragment.setImportExportDataPath for better readability

This commit is contained in:
Alireza Tofighi 2021-05-21 20:24:57 +04:30
parent fa2b11b768
commit 92ab9cae27
1 changed files with 3 additions and 3 deletions

View File

@ -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();
}