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
1 changed files with 2 additions and 2 deletions

View File

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