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? {