diff options
| author | Fabian Henneke <FabianHenneke@users.noreply.github.com> | 2020-08-11 18:11:39 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-08-11 18:11:39 +0200 |
| commit | 15aa92980239d6d61c3b0febc0407b7f63e152b3 (patch) | |
| tree | 92b25ea3bca41e37fe4727bab82665b04ee8206e /app/src/main/java/com/zeapo/pwdstore/PasswordFragment.kt | |
| parent | 8f957ca99454efe1711e2424620d2632bed6cb63 (diff) | |
| download | HardenedPass-15aa92980239d6d61c3b0febc0407b7f63e152b3.tar.gz HardenedPass-15aa92980239d6d61c3b0febc0407b7f63e152b3.zip | |
Switch to URL-based Git config and refactor Git settings (#1008)
* Make Git config URL-based and refactor
* Use Kotlin style null handling for string prefs
* Also show an error if generated URL can't be parsed
* Add some testcases for migration strategy
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
Diffstat (limited to 'app/src/main/java/com/zeapo/pwdstore/PasswordFragment.kt')
| -rw-r--r-- | app/src/main/java/com/zeapo/pwdstore/PasswordFragment.kt | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/app/src/main/java/com/zeapo/pwdstore/PasswordFragment.kt b/app/src/main/java/com/zeapo/pwdstore/PasswordFragment.kt index c9d00353..6657afaf 100644 --- a/app/src/main/java/com/zeapo/pwdstore/PasswordFragment.kt +++ b/app/src/main/java/com/zeapo/pwdstore/PasswordFragment.kt @@ -26,12 +26,12 @@ import com.zeapo.pwdstore.git.BaseGitActivity import com.zeapo.pwdstore.git.GitOperationActivity import com.zeapo.pwdstore.git.GitServerConfigActivity import com.zeapo.pwdstore.git.config.ConnectionMode +import com.zeapo.pwdstore.git.config.GitSettings import com.zeapo.pwdstore.ui.OnOffItemAnimator import com.zeapo.pwdstore.ui.adapters.PasswordItemRecyclerAdapter import com.zeapo.pwdstore.ui.dialogs.ItemCreationBottomSheet import com.zeapo.pwdstore.utils.PasswordItem import com.zeapo.pwdstore.utils.PasswordRepository -import com.zeapo.pwdstore.utils.PreferenceKeys import com.zeapo.pwdstore.utils.sharedPrefs import com.zeapo.pwdstore.utils.viewBinding import java.io.File @@ -91,8 +91,7 @@ class PasswordFragment : Fragment(R.layout.password_recycler_view) { } else { // When authentication is set to ConnectionMode.None then the only git operation we // can run is a pull, so automatically fallback to that. - val operationId = when (ConnectionMode.fromString(settings.getString - (PreferenceKeys.GIT_REMOTE_AUTH, null))) { + val operationId = when (GitSettings.connectionMode) { ConnectionMode.None -> BaseGitActivity.REQUEST_PULL else -> BaseGitActivity.REQUEST_SYNC } |
