Skip to content

Commit

Permalink
Align shared by link behaviour with other platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
abelgardep committed Oct 29, 2020
1 parent 45d496a commit 404c563
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 404c563

Please sign in to comment.