44 * @author Bartosz Przybylski
55 * @author Abel García de Prada
66 * @author Juan Carlos Garrote Gascón
7+ * @author Jorge Aguado Recio
78 *
89 * Copyright (C) 2015 Bartosz Przybylski
9- * Copyright (C) 2023 ownCloud GmbH.
10+ * Copyright (C) 2025 ownCloud GmbH.
1011 *
1112 * This program is free software: you can redistribute it and/or modify
1213 * it under the terms of the GNU General Public License version 2,
@@ -28,6 +29,7 @@ import android.os.Bundle
2829import android.provider.DocumentsContract
2930import android.provider.DocumentsContract.Document
3031import com.owncloud.android.domain.files.model.OCFile
32+ import com.owncloud.android.domain.spaces.model.OCSpace.Companion.SPACE_ID_SHARES
3133import com.owncloud.android.utils.MimetypeIconUtil
3234
3335class FileCursor (projection : Array <String >? ) : MatrixCursor(projection ? : DEFAULT_DOCUMENT_PROJECTION ) {
@@ -45,15 +47,17 @@ class FileCursor(projection: Array<String>?) : MatrixCursor(projection ?: DEFAUL
4547 val imagePath = if (file.isImage && file.isAvailableLocally) file.storagePath else null
4648 var flags = if (imagePath != null ) Document .FLAG_SUPPORTS_THUMBNAIL else 0
4749
48- flags = flags or Document .FLAG_SUPPORTS_DELETE
49- flags = flags or Document .FLAG_SUPPORTS_RENAME
50- flags = flags or Document .FLAG_SUPPORTS_COPY
51- flags = flags or Document .FLAG_SUPPORTS_MOVE
50+ if (file.spaceId != SPACE_ID_SHARES ) {
51+ flags = flags or Document .FLAG_SUPPORTS_DELETE
52+ flags = flags or Document .FLAG_SUPPORTS_RENAME
53+ flags = flags or Document .FLAG_SUPPORTS_COPY
54+ flags = flags or Document .FLAG_SUPPORTS_MOVE
5255
53- if (mimeType != Document .MIME_TYPE_DIR ) { // If it is a file
54- flags = flags or Document .FLAG_SUPPORTS_WRITE
55- } else if (file.hasAddFilePermission && file.hasAddSubdirectoriesPermission) { // If it is a folder with writing permissions
56- flags = flags or Document .FLAG_DIR_SUPPORTS_CREATE
56+ if (mimeType != Document .MIME_TYPE_DIR ) { // If it is a file
57+ flags = flags or Document .FLAG_SUPPORTS_WRITE
58+ } else if (file.hasAddFilePermission && file.hasAddSubdirectoriesPermission) { // If it is a folder with writing permissions
59+ flags = flags or Document .FLAG_DIR_SUPPORTS_CREATE
60+ }
5761 }
5862
5963 newRow()
0 commit comments