exclude the data folder by default again

This commit is contained in:
tibbi 2018-11-18 22:18:15 +01:00
parent 089995c405
commit d78b9a87d2

View file

@ -117,9 +117,17 @@ class Config(context: Context) : BaseConfig(context) {
}
var excludedFolders: MutableSet<String>
get() = prefs.getStringSet(EXCLUDED_FOLDERS, HashSet<String>())
get() = prefs.getStringSet(EXCLUDED_FOLDERS, getDataFolder())
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)