From 9584309c37eaa2c2afca06ae6363ed0c8a7def32 Mon Sep 17 00:00:00 2001 From: Vladimir Krivosheev Date: Thu, 27 Oct 2016 17:21:27 +0200 Subject: [PATCH] =?UTF-8?q?KEEPASS=20=E2=80=94=20default=20provider=20on?= =?UTF-8?q?=20windows?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/PasswordSafeSettings.java | 15 +++++++++++---- platform/credential-store/src/dbV1Convertor.kt | 2 +- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/platform/credential-store/src/PasswordSafeSettings.java b/platform/credential-store/src/PasswordSafeSettings.java index e318ed03849d..dd38d92f6d67 100644 --- a/platform/credential-store/src/PasswordSafeSettings.java +++ b/platform/credential-store/src/PasswordSafeSettings.java @@ -20,6 +20,7 @@ import com.intellij.openapi.components.PersistentStateComponent; import com.intellij.openapi.components.RoamingType; import com.intellij.openapi.components.State; import com.intellij.openapi.components.Storage; +import com.intellij.openapi.util.SystemInfo; import com.intellij.openapi.util.text.StringUtil; import com.intellij.util.ObjectUtils; import com.intellij.util.messages.Topic; @@ -29,13 +30,17 @@ import org.jetbrains.annotations.NotNull; public class PasswordSafeSettings implements PersistentStateComponent { public static final Topic TOPIC = Topic.create("PasswordSafeSettingsListener", PasswordSafeSettingsListener.class); - private ProviderType myProviderType = ProviderType.KEYCHAIN; + private ProviderType myProviderType = getDefaultProviderType(); String keepassDb; + private static ProviderType getDefaultProviderType() { + return SystemInfo.isWindows ? ProviderType.KEEPASS : ProviderType.KEYCHAIN; + } + @NotNull public ProviderType getProviderType() { - return myProviderType; + return SystemInfo.isWindows && myProviderType == ProviderType.KEYCHAIN ? ProviderType.KEEPASS : myProviderType; } public void setProviderType(@NotNull ProviderType value) { @@ -51,6 +56,7 @@ public class PasswordSafeSettings implements PersistentStateComponent