File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed
app/src/main/kotlin/at/bitfire/davdroid Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,9 @@ interface WebDavDocumentDao {
24
24
@Query(" SELECT * FROM webdav_document WHERE parentId=:parentId" )
25
25
fun getChildren (parentId : Long ): List <WebDavDocument >
26
26
27
+ @Query(" SELECT * FROM webdav_document WHERE parentId=:parentId ORDER BY :orderBy" )
28
+ fun getChildrenOrdered (parentId : Long , orderBy : String ): List <WebDavDocument >
29
+
27
30
@Insert(onConflict = OnConflictStrategy .REPLACE )
28
31
fun insertOrReplace (document : WebDavDocument ): Long
29
32
Original file line number Diff line number Diff line change @@ -287,7 +287,8 @@ class DavDocumentsProvider(
287
287
runningQueryChildren.remove(parentId)
288
288
289
289
// Regardless of whether the worker is done, return the children we already have
290
- for (child in documentDao.getChildren(parentId)) {
290
+ val children = if (sortOrder == null ) documentDao.getChildren(parentId) else documentDao.getChildrenOrdered(parentId, sortOrder)
291
+ for (child in children) {
291
292
val bundle = child.toBundle(parent)
292
293
result.addRow(bundle)
293
294
}
You can’t perform that action at this time.
0 commit comments