properly sort search results

This commit is contained in:
tibbi 2019-03-29 11:22:41 +01:00
parent dfbb2288d4
commit 5097bf382c
1 changed files with 4 additions and 1 deletions

View File

@ -312,7 +312,9 @@ class ItemsFragment : Fragment(), ItemOperationsListener, Breadcrumbs.Breadcrumb
private fun searchFiles(text: String, path: String): ArrayList<ListItem> {
val files = ArrayList<ListItem>()
val isSortingBySize = context!!.config.getFolderSorting(path) and SORT_BY_SIZE != 0
val sorting = context!!.config.getFolderSorting(path)
FileDirItem.sorting = context!!.config.getFolderSorting(currentPath)
val isSortingBySize = sorting and SORT_BY_SIZE != 0
File(path).listFiles()?.forEach {
if (it.isDirectory) {
files.addAll(searchFiles(text, it.absolutePath))
@ -325,6 +327,7 @@ class ItemsFragment : Fragment(), ItemOperationsListener, Breadcrumbs.Breadcrumb
}
}
}
files.sort()
return files
}