hard code default quickaccess service

This commit is contained in:
Armin Schrenk
2024-08-06 12:26:26 +02:00
parent cc1e542146
commit 71e4f98665
3 changed files with 8 additions and 8 deletions

View File

@@ -43,7 +43,12 @@ public class Settings {
static final boolean DEFAULT_DEBUG_MODE = false;
static final UiTheme DEFAULT_THEME = UiTheme.LIGHT;
@Deprecated // to be changed to "whatever is available" eventually
static final String DEFAULT_KEYCHAIN_PROVIDER = SystemUtils.IS_OS_WINDOWS ? "org.cryptomator.windows.keychain.WindowsProtectedKeychainAccess" : SystemUtils.IS_OS_MAC ? "org.cryptomator.macos.keychain.MacSystemKeychainAccess" : "org.cryptomator.linux.keychain.SecretServiceKeychainAccess";
static final String DEFAULT_KEYCHAIN_PROVIDER = SystemUtils.IS_OS_WINDOWS ? "org.cryptomator.windows.keychain.WindowsProtectedKeychainAccess" : //
SystemUtils.IS_OS_MAC ? "org.cryptomator.macos.keychain.MacSystemKeychainAccess" : //
"org.cryptomator.linux.keychain.SecretServiceKeychainAccess";
static final String DEFAULT_QUICKACCESS_SERVICE = SystemUtils.IS_OS_WINDOWS ? "org.cryptomator.windows.quickaccess.ExplorerQuickAccessService" : //
SystemUtils.IS_OS_LINUX ? "org.cryptomator.linux.quickaccess.NautilusBookmarks" : null;
static final String DEFAULT_USER_INTERFACE_ORIENTATION = NodeOrientation.LEFT_TO_RIGHT.name();
static final boolean DEFAULT_SHOW_MINIMIZE_BUTTON = false;
public static final Instant DEFAULT_TIMESTAMP = Instant.parse("2000-01-01T00:00:00Z");

View File

@@ -90,5 +90,5 @@ class SettingsJson {
boolean useQuickAccess = Settings.DEFAULT_USE_QUICKACCESS;
@JsonProperty("quickAccessService")
String quickAccessService;
String quickAccessService = Settings.DEFAULT_QUICKACCESS_SERVICE;
}

View File

@@ -47,13 +47,11 @@ public class SettingsProvider implements Supplier<Settings> {
private final Supplier<Settings> settings = Suppliers.memoize(this::load);
private final Environment env;
private final ScheduledExecutorService scheduler;
private final Optional<QuickAccessService> quickAccessService;
@Inject
public SettingsProvider(Environment env, ScheduledExecutorService scheduler, List<QuickAccessService> quickAccessServices) {
public SettingsProvider(Environment env, ScheduledExecutorService scheduler) {
this.env = env;
this.scheduler = scheduler;
this.quickAccessService = quickAccessServices.stream().findFirst();
}
@Override
@@ -66,9 +64,6 @@ public class SettingsProvider implements Supplier<Settings> {
.flatMap(this::tryLoad) //
.findFirst() //
.orElseGet(() -> Settings.create(env));
if (settings.quickAccessService.getValue() == null) {
quickAccessService.ifPresent(s -> settings.quickAccessService.setValue(s.getClass().getName()));
}
settings.setSaveCmd(this::scheduleSave);
return settings;
}