Skip to content

Commit 119db82

Browse files
committed
use renaming instead of Move only if both paths are on same storage
1 parent 1de7985 commit 119db82

File tree

1 file changed

+9
-7
lines changed
  • app/src/main/kotlin/com/simplemobiletools/filemanager/dialogs

1 file changed

+9
-7
lines changed

app/src/main/kotlin/com/simplemobiletools/filemanager/dialogs/CopyDialog.kt

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,16 @@ class CopyDialog(val activity: Activity, val files: List<File>, val path: String
6666
CopyTask(copyListener, mContext).execute(pair)
6767
dismiss()
6868
} else {
69-
for (f in files) {
70-
val destination = File(destinationDir, f.name)
71-
f.renameTo(destination)
72-
context.rescanItem(destination)
73-
}
69+
if (Utils.isPathOnSD(context, view.source.value) && Utils.isPathOnSD(context, destinationPath)) {
70+
for (f in files) {
71+
val destination = File(destinationDir, f.name)
72+
f.renameTo(destination)
73+
context.rescanItem(destination)
74+
}
7475

75-
dismiss()
76-
listener.onSuccess()
76+
dismiss()
77+
listener.onSuccess()
78+
}
7779
}
7880
})
7981
}

0 commit comments

Comments
 (0)