Various fixes

This commit is contained in:
crschnick
2026-09-25 03:55:59 +00:00
parent de26d57913
commit f491e21787
9 changed files with 34 additions and 17 deletions
@@ -72,7 +72,9 @@ public class ActionJacksonMapper {
var makeMulti = ref != null && ref.isArray() && MultiStoreAction.class.isAssignableFrom(clazz.get());
if (makeMulti) {
validateRef(provider.get(), ref.asString());
for (JsonNode singleRef : ref) {
validateRef(provider.get(), singleRef.asString());
}
object.remove("ref");
object.set("refs", ref);
var action = mapper.treeToValue(object, clazz.get());
@@ -87,7 +87,7 @@ public final class BrowserFileSystemTabModel extends BrowserStoreSessionTab<File
return Bindings.createStringBinding(() -> {
var suffix = fileSystemNameSuffix.get();
return name.getValue() + (suffix != null ? " [" + suffix + "]" : "");
});
}, name, fileSystemNameSuffix);
}
public void updateProgress(BrowserTransferProgress n) {
@@ -117,6 +117,10 @@ public class ContextualFileReferenceChoiceComp extends RegionBuilder<HBox> {
var source = rawSource.get();
var target = sync.getTargetLocation().apply(source);
if (target == null) {
return;
}
var shouldCopy = AppDialog.confirm("confirmGitShare");
if (!shouldCopy) {
return;
@@ -135,7 +139,9 @@ public class ContextualFileReferenceChoiceComp extends RegionBuilder<HBox> {
.asLocalPath();
if (Files.exists(pubSource)) {
var pubTarget = sync.getTargetLocation().apply(pubSource);
handler.addDataFile(pubSource, pubTarget, sync.getScope().get());
if (pubTarget != null) {
handler.addDataFile(pubSource, pubTarget, sync.getScope().get());
}
}
var ppkSource = Path.of(sourceBase + ".ppk");
@@ -34,6 +34,7 @@ public class ContextualFileReferenceSync {
while (true) {
var target = dir.resolve(name);
if (Files.exists(target)) {
var replace = new AtomicBoolean(false);
var rename = new AtomicBoolean(false);
var event = ErrorEventFactory.fromMessage(AppI18n.get("syncFileExists", target))
.customAction(new ErrorAction() {
@@ -49,6 +50,7 @@ public class ContextualFileReferenceSync {
@Override
public boolean handle(ErrorEvent event) {
replace.set(true);
return true;
}
})
@@ -81,6 +83,12 @@ public class ContextualFileReferenceSync {
name = newName.get();
continue;
}
if (replace.get()) {
return target;
} else {
return null;
}
}
return target;
@@ -340,7 +340,7 @@ public abstract class AppSystemInfo {
ErrorEventFactory.fromThrowable(e).handle();
}
var fallback = getUserHome().resolve("Desktop");
var fallback = getUserHome().resolve("Downloads");
return (downloads = fallback);
}
@@ -106,7 +106,7 @@ public class StoreCreationMenu {
.getRoot()
.equals(allCat);
},
StoreViewState.get().getAllEntries().getList());
StoreViewState.get().getAllEntries().getList(), StoreViewState.get().getActiveCategory());
automatically.disableProperty().bind(disableSearch);
items.add(new SeparatorMenuItem());
@@ -118,6 +118,15 @@ public class IconsCategory extends AppPrefsCategory {
} catch (Exception ignored) {
}
// Prevent name duplicates
var finalId = id;
var conflict = sources.stream().anyMatch(systemIconSource -> {
return systemIconSource.getId().equals(finalId);
});
if (conflict) {
id = null;
}
if (id == null) {
id = UUID.randomUUID().toString();
}
@@ -187,19 +187,11 @@ public abstract class DataStorageElement {
}
public void setLastModified(Instant lastModified) {
if (lastModified.equals(this.lastModified)) {
return;
}
notifyUpdate(false, true);
this.lastModified = lastModified;
}
public void setLastUsed(Instant lastUsed) {
if (lastUsed.equals(this.lastUsed)) {
return;
}
notifyUpdate(true, false);
this.lastUsed = lastUsed;
}
public interface Listener {
@@ -30,7 +30,7 @@ public interface NetworkTunnelStore extends DataStore, SelfReferentialStore {
return HostAddress.empty();
}
default Optional<DataStoreEntryRef<NetworkTunnelStore>> getUnsupportedParent() {
default Optional<DataStoreEntryRef<?>> getUnsupportedParent() {
DataStoreEntryRef<NetworkTunnelStore> current = getSelfEntry().ref();
while (true) {
var p = current.getStore().getNetworkParent();
@@ -41,7 +41,7 @@ public interface NetworkTunnelStore extends DataStore, SelfReferentialStore {
if (p.getStore() instanceof NetworkTunnelStore) {
current = p.asNeeded();
} else {
return Optional.of(current);
return Optional.of(p);
}
}
}