final cleanup:

* renamed methods
* apply code style
This commit is contained in:
Armin Schrenk
2020-11-10 12:24:49 +01:00
parent 4f8602684d
commit 1947623be8
3 changed files with 8 additions and 8 deletions

View File

@@ -14,7 +14,7 @@ public class IrregularUnmountCleaner {
public static Logger LOG = LoggerFactory.getLogger(IrregularUnmountCleaner.class);
public static void removeUnregularUnmountDebris(Path dirContainingMountPoints) {
public static void removeIrregularUnmountDebris(Path dirContainingMountPoints) {
IOException cleanupFailed = new IOException("Cleanup failed");
try {

View File

@@ -31,8 +31,8 @@ public class UiLauncher {
private final TrayMenuComponent.Builder trayComponent;
private final FxApplicationStarter fxApplicationStarter;
private final AppLaunchEventHandler launchEventHandler;
private final Optional<TrayIntegrationProvider> trayIntegration;
private final Environment env;
private final Optional<TrayIntegrationProvider> trayIntegration;
private final Environment env;
@Inject
public UiLauncher(Settings settings, ObservableList<Vault> vaults, TrayMenuComponent.Builder trayComponent, FxApplicationStarter fxApplicationStarter, AppLaunchEventHandler launchEventHandler, Optional<TrayIntegrationProvider> trayIntegration, Environment env) {
@@ -41,8 +41,8 @@ public class UiLauncher {
this.trayComponent = trayComponent;
this.fxApplicationStarter = fxApplicationStarter;
this.launchEventHandler = launchEventHandler;
this.trayIntegration = trayIntegration;
this.env = env;
this.trayIntegration = trayIntegration;
this.env = env;
}
public void launch() {
@@ -67,7 +67,7 @@ public class UiLauncher {
//clean leftovers of not-regularly unmounted vaults
//see https://github.com/cryptomator/cryptomator/issues/1013 and https://github.com/cryptomator/cryptomator/issues/1061
env.getMountPointsDir().filter(path -> Files.exists(path, LinkOption.NOFOLLOW_LINKS)).ifPresent(IrregularUnmountCleaner::removeUnregularUnmountDebris);
env.getMountPointsDir().filter(path -> Files.exists(path, LinkOption.NOFOLLOW_LINKS)).ifPresent(IrregularUnmountCleaner::removeIrregularUnmountDebris);
// auto unlock
Collection<Vault> vaultsToAutoUnlock = vaults.filtered(this::shouldAttemptAutoUnlock);

View File

@@ -38,7 +38,7 @@ public class GeneralVaultOptionsController implements FxController {
@FXML
public void initialize() {
vaultName.textProperty().set(vault.getVaultSettings().displayName().get());
vaultName.focusedProperty().addListener(this::checkTrimAndTuncateVaultName);
vaultName.focusedProperty().addListener(this::trimVaultNameOnFocusLoss);
vaultName.setTextFormatter(new TextFormatter<>(this::checkVaultNameLength));
unlockOnStartupCheckbox.selectedProperty().bindBidirectional(vault.getVaultSettings().unlockAfterStartup());
actionAfterUnlockChoiceBox.getItems().addAll(WhenUnlocked.values());
@@ -46,7 +46,7 @@ public class GeneralVaultOptionsController implements FxController {
actionAfterUnlockChoiceBox.setConverter(new WhenUnlockedConverter(resourceBundle));
}
private void checkTrimAndTuncateVaultName(Observable observable, Boolean wasFocussed, Boolean isFocussed) {
private void trimVaultNameOnFocusLoss(Observable observable, Boolean wasFocussed, Boolean isFocussed) {
if (!isFocussed) {
var trimmed = vaultName.getText().trim();
vault.getVaultSettings().displayName().set(trimmed);