File tree 2 files changed +15
-1
lines changed
app/src/main/kotlin/at/bitfire/davdroid
2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ import java.time.Instant
32
32
Index (" parentId" )
33
33
]
34
34
)
35
+ // If any column name is modified, also change it in [DavDocumentsProvider$queryChildDocuments]
35
36
data class WebDavDocument (
36
37
37
38
@PrimaryKey(autoGenerate = true )
Original file line number Diff line number Diff line change @@ -287,7 +287,20 @@ 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
- val children = if (sortOrder == null ) documentDao.getChildren(parentId) else documentDao.getChildrenOrdered(parentId, sortOrder)
290
+ val children = if (sortOrder == null ) {
291
+ documentDao.getChildren(parentId)
292
+ } else {
293
+ documentDao.getChildrenOrdered(
294
+ parentId,
295
+ // Convert the cursor's column name into Room's
296
+ sortOrder
297
+ .replace(Document .COLUMN_DOCUMENT_ID , " id" )
298
+ .replace(Document .COLUMN_DISPLAY_NAME , " displayName" )
299
+ .replace(Document .COLUMN_MIME_TYPE , " mimeType" )
300
+ .replace(Document .COLUMN_SIZE , " size" )
301
+ .replace(Document .COLUMN_LAST_MODIFIED , " lastModified" )
302
+ )
303
+ }
291
304
for (child in children) {
292
305
val bundle = child.toBundle(parent)
293
306
result.addRow(bundle)
You can’t perform that action at this time.
0 commit comments