Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copied files owned by root - revisit #1214

Open
SomeTroglodyte opened this issue Apr 25, 2024 · 0 comments
Open

Copied files owned by root - revisit #1214

SomeTroglodyte opened this issue Apr 25, 2024 · 0 comments

Comments

@SomeTroglodyte
Copy link

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)
     }
... behaves much more useful to me.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant