From 119db82a16d7efdf6ca14a2169662923dd2e2ce9 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 5 Nov 2016 20:40:29 +0100 Subject: [PATCH] use renaming instead of Move only if both paths are on same storage --- .../filemanager/dialogs/CopyDialog.kt | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/filemanager/dialogs/CopyDialog.kt b/app/src/main/kotlin/com/simplemobiletools/filemanager/dialogs/CopyDialog.kt index 7b7de686..58af1e2e 100644 --- a/app/src/main/kotlin/com/simplemobiletools/filemanager/dialogs/CopyDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/filemanager/dialogs/CopyDialog.kt @@ -66,14 +66,16 @@ class CopyDialog(val activity: Activity, val files: List, val path: String CopyTask(copyListener, mContext).execute(pair) dismiss() } else { - for (f in files) { - val destination = File(destinationDir, f.name) - f.renameTo(destination) - context.rescanItem(destination) - } + if (Utils.isPathOnSD(context, view.source.value) && Utils.isPathOnSD(context, destinationPath)) { + for (f in files) { + val destination = File(destinationDir, f.name) + f.renameTo(destination) + context.rescanItem(destination) + } - dismiss() - listener.onSuccess() + dismiss() + listener.onSuccess() + } } }) }