make sure the directories and distinct before sorting

This commit is contained in:
tibbi 2018-10-17 11:57:04 +02:00
parent f196158204
commit 66cd5dad3e

View file

@ -833,8 +833,8 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
} }
private fun showSortedDirs(dirs: ArrayList<Directory>) { private fun showSortedDirs(dirs: ArrayList<Directory>) {
var sortedDirs = getSortedDirectories(dirs) var sortedDirs = dirs.distinctBy { it.path.getDistinctPath() } as ArrayList<Directory>
sortedDirs = sortedDirs.distinctBy { it.path.getDistinctPath() } as ArrayList<Directory> sortedDirs = getSortedDirectories(sortedDirs)
runOnUiThread { runOnUiThread {
(directories_grid.adapter as? DirectoryAdapter)?.updateDirs(sortedDirs) (directories_grid.adapter as? DirectoryAdapter)?.updateDirs(sortedDirs)