From 22c369a111b2441c6684bc6b621296ee63ada7e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abel=20Garci=CC=81a=20de=20Prada?= Date: Mon, 26 Oct 2020 17:49:13 +0100 Subject: [PATCH] Align shared by link behaviour with other platforms --- .../android/datamodel/FileDataStorageManager.kt | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/owncloudApp/src/main/java/com/owncloud/android/datamodel/FileDataStorageManager.kt b/owncloudApp/src/main/java/com/owncloud/android/datamodel/FileDataStorageManager.kt index f6b5de470a6..89260b3c028 100644 --- a/owncloudApp/src/main/java/com/owncloud/android/datamodel/FileDataStorageManager.kt +++ b/owncloudApp/src/main/java/com/owncloud/android/datamodel/FileDataStorageManager.kt @@ -235,7 +235,6 @@ class FileDataStorageManager { val sharedByLinkFilesFromCurrentAccount: Vector get() { val allSharedFiles = Vector() - val result = Vector() var cursorOnShared: Cursor? = null try { cursorOnShared = contentResolver?.query( @@ -258,21 +257,7 @@ class FileDataStorageManager { cursorOnShared?.close() } - if (allSharedFiles.isNotEmpty()) { - val allSharedDirs = Vector() - for (file in allSharedFiles) { - if (file.isFolder) { - allSharedDirs.add(file.fileId) - } - } - for (file in allSharedFiles) { - if (file.isFolder || (!file.isFolder && !allSharedDirs.contains(file.parentId))) { - result.add(file) - } - } - } - result.sort() - return result + return allSharedFiles.apply { sort() } } fun getFileByPath(path: String): OCFile? {