From 7e2eb2425e7b9b6ccb37b7b89f19de3fa7a20c44 Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Sat, 15 May 2021 12:56:49 +0530 Subject: all: reformat with Spotless again Signed-off-by: Harsh Shandilya --- .../dev/msfjarvis/aps/util/settings/GitSettings.kt | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'app/src/main/java/dev/msfjarvis/aps/util/settings/GitSettings.kt') diff --git a/app/src/main/java/dev/msfjarvis/aps/util/settings/GitSettings.kt b/app/src/main/java/dev/msfjarvis/aps/util/settings/GitSettings.kt index 3a508e45..d3c85fa7 100644 --- a/app/src/main/java/dev/msfjarvis/aps/util/settings/GitSettings.kt +++ b/app/src/main/java/dev/msfjarvis/aps/util/settings/GitSettings.kt @@ -25,7 +25,8 @@ enum class Protocol(val pref: String) { private val map = values().associateBy(Protocol::pref) fun fromString(type: String?): Protocol { - return map[type ?: return Ssh] ?: throw IllegalArgumentException("$type is not a valid Protocol") + return map[type ?: return Ssh] + ?: throw IllegalArgumentException("$type is not a valid Protocol") } } } @@ -41,7 +42,8 @@ enum class AuthMode(val pref: String) { private val map = values().associateBy(AuthMode::pref) fun fromString(type: String?): AuthMode { - return map[type ?: return SshKey] ?: throw IllegalArgumentException("$type is not a valid AuthMode") + return map[type ?: return SshKey] + ?: throw IllegalArgumentException("$type is not a valid AuthMode") } } } @@ -50,12 +52,18 @@ object GitSettings { private const val DEFAULT_BRANCH = "master" - private val settings by lazy(LazyThreadSafetyMode.PUBLICATION) { Application.instance.sharedPrefs } + private val settings by lazy(LazyThreadSafetyMode.PUBLICATION) { + Application.instance.sharedPrefs + } private val encryptedSettings by lazy(LazyThreadSafetyMode.PUBLICATION) { Application.instance.getEncryptedGitPrefs() } - private val proxySettings by lazy(LazyThreadSafetyMode.PUBLICATION) { Application.instance.getEncryptedProxyPrefs() } - private val hostKeyPath by lazy(LazyThreadSafetyMode.NONE) { "${Application.instance.filesDir}/.host_key" } + private val proxySettings by lazy(LazyThreadSafetyMode.PUBLICATION) { + Application.instance.getEncryptedProxyPrefs() + } + private val hostKeyPath by lazy(LazyThreadSafetyMode.NONE) { + "${Application.instance.filesDir}/.host_key" + } var authMode get() = AuthMode.fromString(settings.getString(PreferenceKeys.GIT_REMOTE_AUTH)) -- cgit v1.2.3