add another extra check to avoid showing duplicate folders

This commit is contained in:
tibbi 2018-04-26 09:48:05 +02:00
parent 9aade59c07
commit db278b4aa2

View file

@ -679,7 +679,9 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
}
private fun showSortedDirs(dirs: ArrayList<Directory>) {
val sortedDirs = getSortedDirectories(dirs).clone() as ArrayList<Directory>
var sortedDirs = getSortedDirectories(dirs).clone() as ArrayList<Directory>
sortedDirs = sortedDirs.distinctBy { it.path.toLowerCase() } as ArrayList<Directory>
runOnUiThread {
(directories_grid.adapter as DirectoryAdapter).updateDirs(sortedDirs)
}