diff --git a/app/src/main/java/io/xpipe/app/browser/file/BrowserFileSystemSavedState.java b/app/src/main/java/io/xpipe/app/browser/file/BrowserFileSystemSavedState.java index a7385c22a..caf680aaf 100644 --- a/app/src/main/java/io/xpipe/app/browser/file/BrowserFileSystemSavedState.java +++ b/app/src/main/java/io/xpipe/app/browser/file/BrowserFileSystemSavedState.java @@ -53,7 +53,7 @@ public class BrowserFileSystemSavedState { public BrowserFileSystemSavedState() { lastDirectory = null; - recentDirectories = FXCollections.observableList(new ArrayList<>(STORED)); + recentDirectories = FXCollections.synchronizedObservableList(FXCollections.observableList(new ArrayList<>(STORED))); } static BrowserFileSystemSavedState loadForStore(BrowserFileSystemTabModel model) { @@ -164,7 +164,7 @@ public class BrowserFileSystemSavedState { .map(recentEntry -> new RecentEntry(FileNames.toDirectory(recentEntry.directory), recentEntry.time)) .filter(distinctBy(recentEntry -> recentEntry.getDirectory())) .collect(Collectors.toCollection(ArrayList::new)); - return new BrowserFileSystemSavedState(null, FXCollections.observableList(cleaned)); + return new BrowserFileSystemSavedState(null, FXCollections.synchronizedObservableList(FXCollections.observableList(cleaned))); } } diff --git a/app/src/main/java/io/xpipe/app/browser/file/BrowserHistorySavedStateImpl.java b/app/src/main/java/io/xpipe/app/browser/file/BrowserHistorySavedStateImpl.java index f8278f349..a9ff269b0 100644 --- a/app/src/main/java/io/xpipe/app/browser/file/BrowserHistorySavedStateImpl.java +++ b/app/src/main/java/io/xpipe/app/browser/file/BrowserHistorySavedStateImpl.java @@ -26,7 +26,7 @@ public class BrowserHistorySavedStateImpl implements BrowserHistorySavedState { ObservableList lastSystems; public BrowserHistorySavedStateImpl(List lastSystems) { - this.lastSystems = FXCollections.observableArrayList(lastSystems); + this.lastSystems = FXCollections.synchronizedObservableList(FXCollections.observableArrayList(lastSystems)); } private static BrowserHistorySavedStateImpl INSTANCE; diff --git a/app/src/main/java/io/xpipe/app/browser/file/BrowserHistoryTabComp.java b/app/src/main/java/io/xpipe/app/browser/file/BrowserHistoryTabComp.java index c8049828e..8cb8479b1 100644 --- a/app/src/main/java/io/xpipe/app/browser/file/BrowserHistoryTabComp.java +++ b/app/src/main/java/io/xpipe/app/browser/file/BrowserHistoryTabComp.java @@ -53,7 +53,6 @@ public class BrowserHistoryTabComp extends SimpleComp { return true; }) - .createSynchronized() .getList(); var empty = Bindings.createBooleanBinding(() -> list.isEmpty(), list); var contentDisplay = createListDisplay(list); diff --git a/app/src/main/java/io/xpipe/app/browser/file/BrowserOverviewComp.java b/app/src/main/java/io/xpipe/app/browser/file/BrowserOverviewComp.java index 076b44dfb..2266a2a1b 100644 --- a/app/src/main/java/io/xpipe/app/browser/file/BrowserOverviewComp.java +++ b/app/src/main/java/io/xpipe/app/browser/file/BrowserOverviewComp.java @@ -70,7 +70,6 @@ public class BrowserOverviewComp extends SimpleComp { var recent = new DerivedObservableList<>(model.getSavedState().getRecentDirectories(), true) .mapped(s -> FileEntry.ofDirectory(model.getFileSystem(), s.getDirectory())) - .createSynchronized() .getList(); var recentOverview = new BrowserFileOverviewComp(model, recent, true); var recentPane = new SimpleTitledPaneComp(AppI18n.observable("recent"), recentOverview, false); diff --git a/app/src/main/java/io/xpipe/app/comp/store/StoreCategoryComp.java b/app/src/main/java/io/xpipe/app/comp/store/StoreCategoryComp.java index 21942d569..635e7da20 100644 --- a/app/src/main/java/io/xpipe/app/comp/store/StoreCategoryComp.java +++ b/app/src/main/java/io/xpipe/app/comp/store/StoreCategoryComp.java @@ -163,7 +163,6 @@ public class StoreCategoryComp extends SimpleComp { }); var l = category.getChildren() - .createSynchronized() .getList() .sorted(Comparator.comparing(storeCategoryWrapper -> storeCategoryWrapper.nameProperty().getValue().toLowerCase(Locale.ROOT))); diff --git a/app/src/main/java/io/xpipe/app/comp/store/StoreSection.java b/app/src/main/java/io/xpipe/app/comp/store/StoreSection.java index ee60fc598..dd927e864 100644 --- a/app/src/main/java/io/xpipe/app/comp/store/StoreSection.java +++ b/app/src/main/java/io/xpipe/app/comp/store/StoreSection.java @@ -135,7 +135,7 @@ public class StoreSection { category, filterString, updateObservable); - return new StoreSection(null, ordered.createSynchronized(), shown.createSynchronized(), 0); + return new StoreSection(null, ordered, shown, 0); } private static StoreSection create( @@ -212,7 +212,7 @@ public class StoreSection { e.getPersistentState(), e.getCache(), updateObservable); - return new StoreSection(e, cached.createSynchronized(), filtered.createSynchronized(), depth); + return new StoreSection(e, cached, filtered, depth); } private static boolean showInCategory(StoreCategoryWrapper categoryWrapper, StoreEntryWrapper entryWrapper) { diff --git a/app/src/main/java/io/xpipe/app/util/DerivedObservableList.java b/app/src/main/java/io/xpipe/app/util/DerivedObservableList.java index 7b30bcb6c..16b8c3c35 100644 --- a/app/src/main/java/io/xpipe/app/util/DerivedObservableList.java +++ b/app/src/main/java/io/xpipe/app/util/DerivedObservableList.java @@ -32,11 +32,6 @@ public class DerivedObservableList { return new DerivedObservableList<>(l, unique); } - public DerivedObservableList createSynchronized() { - var l = FXCollections.synchronizedObservableList(list); - return new DerivedObservableList<>(l, unique); - } - public void setContent(List newList) { if (list.equals(newList)) { return;