tweak the way folders at grouping direct subfolders are checked
This commit is contained in:
parent
7dcfa167a7
commit
e3fcd3c84b
1 changed files with 9 additions and 4 deletions
|
@ -926,11 +926,16 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
|
||||||
private fun getDirectParentSubfolders(folders: HashSet<String>): HashSet<String> {
|
private fun getDirectParentSubfolders(folders: HashSet<String>): HashSet<String> {
|
||||||
val internalPath = internalStoragePath
|
val internalPath = internalStoragePath
|
||||||
val sdPath = sdCardPath
|
val sdPath = sdCardPath
|
||||||
val currentPaths = HashSet<String>()
|
val currentPaths = LinkedHashSet<String>()
|
||||||
folders.forEach {
|
folders.forEach {
|
||||||
|
val path = it
|
||||||
if (it != internalPath && it != sdPath) {
|
if (it != internalPath && it != sdPath) {
|
||||||
|
if (folders.any { it != path && (File(path).parent == it || File(it).parent == File(path).parent) }) {
|
||||||
val parent = File(it).parent
|
val parent = File(it).parent
|
||||||
currentPaths.add(parent)
|
currentPaths.add(parent)
|
||||||
|
} else {
|
||||||
|
currentPaths.add(it)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -938,7 +943,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
|
||||||
currentPaths.forEach {
|
currentPaths.forEach {
|
||||||
val path = it
|
val path = it
|
||||||
currentPaths.forEach {
|
currentPaths.forEach {
|
||||||
if (it != path && it.startsWith(path)) {
|
if (it != path && File(it).parent == path) {
|
||||||
areDirectSubfoldersAvailable = true
|
areDirectSubfoldersAvailable = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue