Small bug fixes

This commit is contained in:
crschnick 2023-10-20 07:52:43 +00:00
parent 1f3afa3ad4
commit 7c2b07f560
3 changed files with 10 additions and 10 deletions

View file

@ -177,10 +177,10 @@ public class StoreViewState {
public void onStoreAdd(DataStoreEntry... entry) {
var l = Arrays.stream(entry).map(StoreEntryWrapper::new).toList();
Platform.runLater(() -> {
synchronized (allEntries) {
synchronized (this) {
allEntries.addAll(l);
}
synchronized (categories) {
synchronized (this) {
categories.stream()
.filter(storeCategoryWrapper -> allEntries.stream()
.anyMatch(storeEntryWrapper -> storeEntryWrapper
@ -198,13 +198,13 @@ public class StoreViewState {
public void onStoreRemove(DataStoreEntry... entry) {
var a = Arrays.stream(entry).collect(Collectors.toSet());
List<StoreEntryWrapper> l;
synchronized (allEntries) {
synchronized (this) {
l = allEntries.stream()
.filter(storeEntryWrapper -> a.contains(storeEntryWrapper.getEntry()))
.toList();
}
List<StoreCategoryWrapper> cats;
synchronized (categories) {
synchronized (this) {
cats = categories.stream()
.filter(storeCategoryWrapper -> allEntries.stream()
.anyMatch(storeEntryWrapper -> storeEntryWrapper
@ -216,7 +216,7 @@ public class StoreViewState {
.toList();
}
Platform.runLater(() -> {
synchronized (allEntries) {
synchronized (this) {
allEntries.removeAll(l);
}
cats.forEach(storeCategoryWrapper -> storeCategoryWrapper.update());
@ -227,7 +227,7 @@ public class StoreViewState {
public void onCategoryAdd(DataStoreCategory category) {
var l = new StoreCategoryWrapper(category);
Platform.runLater(() -> {
synchronized (categories) {
synchronized (this) {
categories.add(l);
}
l.update();
@ -237,7 +237,7 @@ public class StoreViewState {
@Override
public void onCategoryRemove(DataStoreCategory category) {
Optional<StoreCategoryWrapper> found;
synchronized (categories) {
synchronized (this) {
found = categories.stream()
.filter(storeCategoryWrapper ->
storeCategoryWrapper.getCategory().equals(category))
@ -248,7 +248,7 @@ public class StoreViewState {
}
Platform.runLater(() -> {
synchronized (categories) {
synchronized (this) {
categories.remove(found.get());
}
var p = found.get().getParent();

View file

@ -368,7 +368,7 @@ public interface ExternalTerminalType extends PrefsChoiceValue {
@Override
protected CommandBuilder toCommand(String name, String file) {
return CommandBuilder.of().add("-r").addQuoted(name).add("-e").addQuoted(file);
return CommandBuilder.of().add("-n", "~").add("-r").addQuoted(name).add("-e").addQuoted(file);
}
@Override

View file

@ -201,7 +201,7 @@ public abstract class DataStorage {
}
var oldChildren = getStoreEntries().stream()
.filter(other -> e.equals(other.getProvider().getDisplayParent(other)))
.filter(other -> e.equals(getDisplayParent(other).orElse(null)))
.toList();
var toRemove = oldChildren.stream()
.filter(entry -> newChildren.stream()