zhanghai / zhanghai/MaterialFiles
Copied files owned by root - revisit
Open
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 9k
- Forks
- 736
- PR merge metrics
- No merged PRs in 30d
Description
There's no way Material Files can know you want the files to be owned by someone else
Actually, why don't you inherit from the parent folder?
I am not really qualified to judge stuff like this, but this patch...
Index: app/src/main/java/me/zhanghai/android/files/provider/common/PathExtensions.kt
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/app/src/main/java/me/zhanghai/android/files/provider/common/PathExtensions.kt b/app/src/main/java/me/zhanghai/android/files/provider/common/PathExtensions.kt
--- a/app/src/main/java/me/zhanghai/android/files/provider/common/PathExtensions.kt (revision 0901066958e90e7cb142a53770d46b895d4daa62)
+++ b/app/src/main/java/me/zhanghai/android/files/provider/common/PathExtensions.kt (date 1714083652010)
@@ -49,6 +49,9 @@
val provider = provider
if (provider == target.provider) {
provider.copy(this, target, *options)
+ if (target.getOwner().name == "root") {
+ target.setOwner(target.parent.getOwner())
+ }
} else {
ForeignCopyMove.copy(this, target, *options)
}
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in app/src/main/java/me/zhanghai/android/files/provider/common/PathExtensions.kt and review the same-provider copy path shown in the issue, alongside the linked ownership discussion. Done should mean copied files inherit the intended ownership from the parent folder instead of remaining owned by root.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- mobile
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100