do not exclude whole data folder by default
This commit is contained in:
parent
8d92fcd07b
commit
f1daf5fbcf
|
@ -916,7 +916,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
|
|||
}
|
||||
mDirs = dirs.clone() as ArrayList<Directory>
|
||||
|
||||
if (config.appRunCount < 5 && mDirs.size > 100) {
|
||||
if (mDirs.size > 100) {
|
||||
excludeSpamFolders()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -117,17 +117,9 @@ class Config(context: Context) : BaseConfig(context) {
|
|||
}
|
||||
|
||||
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()
|
||||
|
||||
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) {
|
||||
val currIncludedFolders = HashSet<String>(includedFolders)
|
||||
currIncludedFolders.add(path)
|
||||
|
|
Loading…
Reference in New Issue