mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-05-21 04:01:27 +00:00
hard code default quickaccess service
This commit is contained in:
@@ -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");
|
||||
|
||||
@@ -90,5 +90,5 @@ class SettingsJson {
|
||||
boolean useQuickAccess = Settings.DEFAULT_USE_QUICKACCESS;
|
||||
|
||||
@JsonProperty("quickAccessService")
|
||||
String quickAccessService;
|
||||
String quickAccessService = Settings.DEFAULT_QUICKACCESS_SERVICE;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user