mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-05-21 04:01:27 +00:00
Load quick access service lazy
This commit is contained in:
@@ -130,12 +130,6 @@ public abstract class CommonsModule {
|
||||
return executorService;
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
static List<QuickAccessService> provideQuickAccessServices() {
|
||||
return QuickAccessService.get().toList();
|
||||
}
|
||||
|
||||
private static void handleUncaughtExceptionInBackgroundThread(Thread thread, Throwable throwable) {
|
||||
LOG.error("Uncaught exception in " + thread.getName(), throwable);
|
||||
}
|
||||
|
||||
@@ -74,7 +74,6 @@ public class Vault {
|
||||
private final ObjectBinding<Mountpoint> mountPoint;
|
||||
private final Mounter mounter;
|
||||
private final Settings settings;
|
||||
private final List<QuickAccessService> quickAccessServices;
|
||||
private final BooleanProperty showingStats;
|
||||
|
||||
private final AtomicReference<Mounter.MountHandle> mountHandle = new AtomicReference<>(null);
|
||||
@@ -86,7 +85,7 @@ public class Vault {
|
||||
VaultState state, //
|
||||
@Named("lastKnownException") ObjectProperty<Exception> lastKnownException, //
|
||||
VaultStats stats, //
|
||||
Mounter mounter, Settings settings, List<QuickAccessService> quickAccessServices) {
|
||||
Mounter mounter, Settings settings) {
|
||||
this.vaultSettings = vaultSettings;
|
||||
this.configCache = configCache;
|
||||
this.cryptoFileSystem = cryptoFileSystem;
|
||||
@@ -103,7 +102,6 @@ public class Vault {
|
||||
this.mountPoint = Bindings.createObjectBinding(this::getMountPoint, state);
|
||||
this.mounter = mounter;
|
||||
this.settings = settings;
|
||||
this.quickAccessServices = quickAccessServices;
|
||||
this.showingStats = new SimpleBooleanProperty(false);
|
||||
this.quickAccessEntry = new AtomicReference<>(null);
|
||||
}
|
||||
@@ -207,7 +205,7 @@ public class Vault {
|
||||
return;
|
||||
}
|
||||
|
||||
quickAccessServices.stream() //
|
||||
QuickAccessService.get() //
|
||||
.filter(s -> s.getClass().getName().equals(settings.quickAccessService.getValue())) //
|
||||
.findFirst() //
|
||||
.ifPresentOrElse( //
|
||||
|
||||
@@ -48,12 +48,12 @@ public class GeneralPreferencesController implements FxController {
|
||||
public ToggleGroup nodeOrientation;
|
||||
|
||||
@Inject
|
||||
GeneralPreferencesController(@PreferencesWindow Stage window, Settings settings, Optional<AutoStartProvider> autoStartProvider, List<KeychainAccessProvider> keychainAccessProviders, List<QuickAccessService> quickAccessServices, Application application, Environment environment, FxApplicationWindows appWindows) {
|
||||
GeneralPreferencesController(@PreferencesWindow Stage window, Settings settings, Optional<AutoStartProvider> autoStartProvider, List<KeychainAccessProvider> keychainAccessProviders, Application application, Environment environment, FxApplicationWindows appWindows) {
|
||||
this.window = window;
|
||||
this.settings = settings;
|
||||
this.autoStartProvider = autoStartProvider;
|
||||
this.keychainAccessProviders = keychainAccessProviders;
|
||||
this.quickAccessServices = quickAccessServices;
|
||||
this.quickAccessServices = QuickAccessService.get().toList();
|
||||
this.application = application;
|
||||
this.environment = environment;
|
||||
this.appWindows = appWindows;
|
||||
|
||||
Reference in New Issue
Block a user