From 92ab9cae27620337d21e4f634b918a919aa5d830 Mon Sep 17 00:00:00 2001 From: Alireza Tofighi Date: Fri, 21 May 2021 20:24:57 +0430 Subject: [PATCH] Invert if condition in ContentSettingsFragment.setImportExportDataPath for better readability --- .../schabi/newpipe/settings/ContentSettingsFragment.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/settings/ContentSettingsFragment.java b/app/src/main/java/org/schabi/newpipe/settings/ContentSettingsFragment.java index 3464f1081..ab6ff7414 100644 --- a/app/src/main/java/org/schabi/newpipe/settings/ContentSettingsFragment.java +++ b/app/src/main/java/org/schabi/newpipe/settings/ContentSettingsFragment.java @@ -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(); }