do not exclude whole data folder by default

This commit is contained in:
tibbi 2018-12-02 14:03:47 +01:00
parent 8d92fcd07b
commit f1daf5fbcf
2 changed files with 2 additions and 10 deletions

View file

@ -916,7 +916,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
} }
mDirs = dirs.clone() as ArrayList<Directory> mDirs = dirs.clone() as ArrayList<Directory>
if (config.appRunCount < 5 && mDirs.size > 100) { if (mDirs.size > 100) {
excludeSpamFolders() excludeSpamFolders()
} }
} }

View file

@ -117,17 +117,9 @@ class Config(context: Context) : BaseConfig(context) {
} }
var excludedFolders: MutableSet<String> var excludedFolders: MutableSet<String>
get() = prefs.getStringSet(EXCLUDED_FOLDERS, getDataFolder()) get() = prefs.getStringSet(EXCLUDED_FOLDERS, HashSet())
set(excludedFolders) = prefs.edit().remove(EXCLUDED_FOLDERS).putStringSet(EXCLUDED_FOLDERS, excludedFolders).apply() set(excludedFolders) = prefs.edit().remove(EXCLUDED_FOLDERS).putStringSet(EXCLUDED_FOLDERS, excludedFolders).apply()
private fun getDataFolder(): Set<String> {
val folders = HashSet<String>()
val dataFolder = context.externalCacheDir?.parentFile?.parent?.trimEnd('/') ?: ""
if (dataFolder.endsWith("data"))
folders.add(dataFolder)
return folders
}
fun addIncludedFolder(path: String) { fun addIncludedFolder(path: String) {
val currIncludedFolders = HashSet<String>(includedFolders) val currIncludedFolders = HashSet<String>(includedFolders)
currIncludedFolders.add(path) currIncludedFolders.add(path)