renaming a renaming a variable to make it clearer
This commit is contained in:
parent
f17ffb8642
commit
d029381271
1 changed files with 8 additions and 8 deletions
|
@ -45,7 +45,7 @@ class NewEditActivity : SimpleActivity() {
|
||||||
private val RESULT_IMAGE_PATH = "RESULT_IMAGE_PATH"
|
private val RESULT_IMAGE_PATH = "RESULT_IMAGE_PATH"
|
||||||
private var sourceFileLastModified = 0L
|
private var sourceFileLastModified = 0L
|
||||||
private var destinationFilePath = ""
|
private var destinationFilePath = ""
|
||||||
private var imagePathFromEditor = "" // delete the file stored at the internal app storage (the editor saves it there) in case moving to the selected location fails
|
private var cacheImagePathFromEditor = "" // delete the file stored at the internal app cache storage (the editor saves it there) in case moving to the selected location fails
|
||||||
private var sourceImageUri: Uri? = null
|
private var sourceImageUri: Uri? = null
|
||||||
private var oldExif: ExifInterface? = null
|
private var oldExif: ExifInterface? = null
|
||||||
|
|
||||||
|
@ -108,7 +108,7 @@ class NewEditActivity : SimpleActivity() {
|
||||||
override fun onActivityResult(requestCode: Int, resultCode: Int, resultData: Intent?) {
|
override fun onActivityResult(requestCode: Int, resultCode: Int, resultData: Intent?) {
|
||||||
if (requestCode == PESDK_EDIT_IMAGE) {
|
if (requestCode == PESDK_EDIT_IMAGE) {
|
||||||
val extras = resultData?.extras
|
val extras = resultData?.extras
|
||||||
imagePathFromEditor = extras?.getString(RESULT_IMAGE_PATH, "") ?: ""
|
cacheImagePathFromEditor = extras?.getString(RESULT_IMAGE_PATH, "") ?: ""
|
||||||
|
|
||||||
val settings = extras?.getParcelable<SettingsList>(SETTINGS_LIST)
|
val settings = extras?.getParcelable<SettingsList>(SETTINGS_LIST)
|
||||||
if (settings != null) {
|
if (settings != null) {
|
||||||
|
@ -118,7 +118,7 @@ class NewEditActivity : SimpleActivity() {
|
||||||
config.editorBrushSize = brush.brushSize
|
config.editorBrushSize = brush.brushSize
|
||||||
}
|
}
|
||||||
|
|
||||||
if (resultCode != Activity.RESULT_OK || sourceImageUri == null || sourceImageUri.toString().isEmpty() || imagePathFromEditor.isEmpty() || sourceImageUri.toString() == imagePathFromEditor) {
|
if (resultCode != Activity.RESULT_OK || sourceImageUri == null || sourceImageUri.toString().isEmpty() || cacheImagePathFromEditor.isEmpty() || sourceImageUri.toString() == cacheImagePathFromEditor) {
|
||||||
toast(R.string.image_editing_failed)
|
toast(R.string.image_editing_failed)
|
||||||
finish()
|
finish()
|
||||||
} else {
|
} else {
|
||||||
|
@ -131,7 +131,7 @@ class NewEditActivity : SimpleActivity() {
|
||||||
sourceString.substringAfter("file://")
|
sourceString.substringAfter("file://")
|
||||||
}
|
}
|
||||||
|
|
||||||
if (source == imagePathFromEditor) {
|
if (source == cacheImagePathFromEditor) {
|
||||||
finish()
|
finish()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -145,8 +145,8 @@ class NewEditActivity : SimpleActivity() {
|
||||||
if (it) {
|
if (it) {
|
||||||
storeOldExif(source)
|
storeOldExif(source)
|
||||||
sourceFileLastModified = File(source).lastModified()
|
sourceFileLastModified = File(source).lastModified()
|
||||||
val newFile = File("${imagePathFromEditor.getParentPath()}/${destinationFilePath.getFilenameFromPath()}")
|
val newFile = File("${cacheImagePathFromEditor.getParentPath()}/${destinationFilePath.getFilenameFromPath()}")
|
||||||
File(imagePathFromEditor).renameTo(newFile)
|
File(cacheImagePathFromEditor).renameTo(newFile)
|
||||||
val sourceFile = FileDirItem(newFile.absolutePath, newFile.name)
|
val sourceFile = FileDirItem(newFile.absolutePath, newFile.name)
|
||||||
|
|
||||||
val conflictResolutions = LinkedHashMap<String, Int>()
|
val conflictResolutions = LinkedHashMap<String, Int>()
|
||||||
|
@ -156,7 +156,7 @@ class NewEditActivity : SimpleActivity() {
|
||||||
CopyMoveTask(this, false, true, conflictResolutions, editCopyMoveListener, true).execute(pair)
|
CopyMoveTask(this, false, true, conflictResolutions, editCopyMoveListener, true).execute(pair)
|
||||||
} else {
|
} else {
|
||||||
toast(R.string.image_editing_failed)
|
toast(R.string.image_editing_failed)
|
||||||
File(imagePathFromEditor).delete()
|
File(cacheImagePathFromEditor).delete()
|
||||||
finish()
|
finish()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -207,7 +207,7 @@ class NewEditActivity : SimpleActivity() {
|
||||||
|
|
||||||
override fun copyFailed() {
|
override fun copyFailed() {
|
||||||
toast(R.string.unknown_error_occurred)
|
toast(R.string.unknown_error_occurred)
|
||||||
File(imagePathFromEditor).delete()
|
File(cacheImagePathFromEditor).delete()
|
||||||
finish()
|
finish()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue