From 06e1796902d2cbe57484a7f2c46770e1eb62f60d Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 8 Dec 2016 19:02:35 +0100 Subject: [PATCH] check SD card permissions also if moving files from SD card --- .../com/simplemobiletools/gallery/dialogs/CopyDialog.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/CopyDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/CopyDialog.kt index c52ba95c8..d67a99e33 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/CopyDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/CopyDialog.kt @@ -59,8 +59,7 @@ class CopyDialog(val activity: SimpleActivity, val files: ArrayList, val c } if (files.size == 1) { - val newFile = File(files[0].path) - if (File(destinationPath, newFile.name).exists()) { + if (File(destinationPath, files[0].name).exists()) { context.toast(R.string.already_exists) return@setOnClickListener } @@ -78,6 +77,10 @@ class CopyDialog(val activity: SimpleActivity, val files: ArrayList, val c dismiss() } else { if (context.isPathOnSD(sourcePath) || context.isPathOnSD(destinationPath)) { + if (activity.isShowingPermDialog(files[0])) { + return@setOnClickListener + } + context.toast(R.string.moving) val pair = Pair, File>(files, destinationDir) CopyMoveTask(context, true, config.treeUri, true, copyMoveListener).execute(pair)