zhanghai / MaterialFiles

Material Design file manager for Android
https://play.google.com/store/apps/details?id=me.zhanghai.android.files
GNU General Public License v3.0
6.07k stars 410 forks source link

Copied files owned by root - revisit #1214

Open SomeTroglodyte opened 6 months ago

SomeTroglodyte commented 6 months ago

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... ```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.