From f1daf5fbcf6a0064a0ad57deb9fadf21d5176cba Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 2 Dec 2018 14:03:47 +0100 Subject: [PATCH] do not exclude whole data folder by default --- .../gallery/pro/activities/MainActivity.kt | 2 +- .../simplemobiletools/gallery/pro/helpers/Config.kt | 10 +--------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt index b508f9220..20e8a8131 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt @@ -916,7 +916,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { } mDirs = dirs.clone() as ArrayList - if (config.appRunCount < 5 && mDirs.size > 100) { + if (mDirs.size > 100) { excludeSpamFolders() } } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/Config.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/Config.kt index 1c854e81a..f7d61c0de 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/Config.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/Config.kt @@ -117,17 +117,9 @@ class Config(context: Context) : BaseConfig(context) { } var excludedFolders: MutableSet - get() = prefs.getStringSet(EXCLUDED_FOLDERS, getDataFolder()) + get() = prefs.getStringSet(EXCLUDED_FOLDERS, HashSet()) set(excludedFolders) = prefs.edit().remove(EXCLUDED_FOLDERS).putStringSet(EXCLUDED_FOLDERS, excludedFolders).apply() - private fun getDataFolder(): Set { - val folders = HashSet() - val dataFolder = context.externalCacheDir?.parentFile?.parent?.trimEnd('/') ?: "" - if (dataFolder.endsWith("data")) - folders.add(dataFolder) - return folders - } - fun addIncludedFolder(path: String) { val currIncludedFolders = HashSet(includedFolders) currIncludedFolders.add(path)