Selaa lähdekoodia

final cleanup:
* renamed methods
* apply code style

Armin Schrenk 4 vuotta sitten
vanhempi
commit
1947623be8

+ 1 - 1
main/commons/src/main/java/org/cryptomator/common/mountpoint/IrregularUnmountCleaner.java

@@ -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 {

+ 5 - 5
main/ui/src/main/java/org/cryptomator/ui/launcher/UiLauncher.java

@@ -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);

+ 2 - 2
main/ui/src/main/java/org/cryptomator/ui/vaultoptions/GeneralVaultOptionsController.java

@@ -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);