From 041cf00510a75042223d1857660fc7f1dff958ef Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Sun, 10 May 2020 19:21:39 +0530 Subject: Treewide codestyle cleanup (#765) - Updated gitignore and checked in the IDE's codestyle config - Removed spotless as the underlying ktlint backend has failed to resolve the super frustrating import order bug[1] in nearly a year - Reformat the entire codebase based on the previously committed code style configuration. 1: https://github.com/pinterest/ktlint/issues/527 --- .../zeapo/pwdstore/git/GitServerConfigActivity.kt | 36 +++++++++++----------- 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'app/src/main/java/com/zeapo/pwdstore/git/GitServerConfigActivity.kt') diff --git a/app/src/main/java/com/zeapo/pwdstore/git/GitServerConfigActivity.kt b/app/src/main/java/com/zeapo/pwdstore/git/GitServerConfigActivity.kt index 14f9bb62..3e5d18e0 100644 --- a/app/src/main/java/com/zeapo/pwdstore/git/GitServerConfigActivity.kt +++ b/app/src/main/java/com/zeapo/pwdstore/git/GitServerConfigActivity.kt @@ -144,27 +144,27 @@ class GitServerConfigActivity : BaseGitActivity() { val localDirFiles = localDir.listFiles() ?: emptyArray() // Warn if non-empty folder unless it's a just-initialized store that has just a .git folder if (localDir.exists() && localDirFiles.isNotEmpty() && - !(localDirFiles.size == 1 && localDirFiles[0].name == ".git")) { + !(localDirFiles.size == 1 && localDirFiles[0].name == ".git")) { MaterialAlertDialogBuilder(this) - .setTitle(R.string.dialog_delete_title) - .setMessage(resources.getString(R.string.dialog_delete_msg) + " " + localDir.toString()) - .setCancelable(false) - .setPositiveButton(R.string.dialog_delete) { dialog, _ -> - try { - localDir.deleteRecursively() - launchGitOperation(REQUEST_CLONE) - } catch (e: IOException) { - // TODO Handle the exception correctly if we are unable to delete the directory... - e.printStackTrace() - MaterialAlertDialogBuilder(this).setMessage(e.message).show() - } finally { - dialog.cancel() - } - } - .setNegativeButton(R.string.dialog_do_not_delete) { dialog, _ -> + .setTitle(R.string.dialog_delete_title) + .setMessage(resources.getString(R.string.dialog_delete_msg) + " " + localDir.toString()) + .setCancelable(false) + .setPositiveButton(R.string.dialog_delete) { dialog, _ -> + try { + localDir.deleteRecursively() + launchGitOperation(REQUEST_CLONE) + } catch (e: IOException) { + // TODO Handle the exception correctly if we are unable to delete the directory... + e.printStackTrace() + MaterialAlertDialogBuilder(this).setMessage(e.message).show() + } finally { dialog.cancel() } - .show() + } + .setNegativeButton(R.string.dialog_do_not_delete) { dialog, _ -> + dialog.cancel() + } + .show() } else { try { // Silently delete & replace the lone .git folder if it exists -- cgit v1.2.3