mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-04-23 02:56:59 -04:00
change scope of HostServiceRevealer to @FxApplicationScoped
because unlock always happens after application start anyway
This commit is contained in:
@@ -1,24 +1,25 @@
|
||||
package org.cryptomator.ui.common;
|
||||
|
||||
import dagger.Lazy;
|
||||
import org.cryptomator.common.vaults.Volume;
|
||||
import org.cryptomator.ui.launcher.FxApplicationStarter;
|
||||
import org.cryptomator.ui.fxapp.FxApplicationScoped;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
import javafx.application.Application;
|
||||
import java.nio.file.Path;
|
||||
|
||||
@Singleton
|
||||
@FxApplicationScoped
|
||||
public class HostServiceRevealer implements Volume.Revealer {
|
||||
|
||||
private final FxApplicationStarter fxApplicationStarter;
|
||||
private final Lazy<Application> application;
|
||||
|
||||
@Inject
|
||||
public HostServiceRevealer(FxApplicationStarter fxApplicationStarter) {
|
||||
this.fxApplicationStarter = fxApplicationStarter;
|
||||
public HostServiceRevealer(Lazy<Application> application) {
|
||||
this.application = application;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reveal(Path p) throws Volume.VolumeException {
|
||||
fxApplicationStarter.get().thenAccept(app -> app.getHostServices().showDocument(p.toUri().toString()));
|
||||
application.get().getHostServices().showDocument(p.toUri().toString());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user