Skip to content

Commit

Permalink
properly sort search results
Browse files Browse the repository at this point in the history
  • Loading branch information
tibbi committed Mar 29, 2019
1 parent dfbb228 commit 5097bf3
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -325,6 +327,7 @@ class ItemsFragment : Fragment(), ItemOperationsListener, Breadcrumbs.Breadcrumb
}
}
}
files.sort()
return files
}

Expand Down

0 comments on commit 5097bf3

Please sign in to comment.