Skip to content

Commit

Permalink
Merge pull request #3007 from owncloud/align/shared_by_link
Browse files Browse the repository at this point in the history
Align shared by link behaviour with other platforms
  • Loading branch information
abelgardep authored Nov 9, 2020
2 parents 38129ba + 22c369a commit e30fb84
Showing 1 changed file with 1 addition and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,6 @@ class FileDataStorageManager {
val sharedByLinkFilesFromCurrentAccount: Vector<OCFile>
get() {
val allSharedFiles = Vector<OCFile>()
val result = Vector<OCFile>()
var cursorOnShared: Cursor? = null
try {
cursorOnShared = contentResolver?.query(
Expand All @@ -258,21 +257,7 @@ class FileDataStorageManager {
cursorOnShared?.close()
}

if (allSharedFiles.isNotEmpty()) {
val allSharedDirs = Vector<Long>()
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? {
Expand Down

0 comments on commit e30fb84

Please sign in to comment.