exclude ...Android/data folder by default, it usually contains garbage

This commit is contained in:
tibbi 2017-04-01 18:55:39 +02:00
parent ed59c51b99
commit 2759a476aa
1 changed files with 9 additions and 1 deletions

View File

@ -87,9 +87,17 @@ class Config(context: Context) : BaseConfig(context) {
} }
var excludedFolders: MutableSet<String> 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() 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)