mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-05-14 08:41:28 +00:00
cleanup
This commit is contained in:
@@ -259,7 +259,7 @@ public class Vault {
|
||||
|
||||
|
||||
private void consumeVaultEvent(FilesystemEvent e) {
|
||||
fileSystemEventAggregator.enqueue(this, e);
|
||||
fileSystemEventAggregator.put(this, e);
|
||||
}
|
||||
|
||||
// ******************************************************************************
|
||||
|
||||
@@ -29,12 +29,12 @@ public class FileSystemEventAggregator {
|
||||
}
|
||||
|
||||
/**
|
||||
* Enques the given event to be inserted into the map.
|
||||
* Adds the given event to the map. If a bucket for this event already exists, only the count is updated and the event set as the most recent one.
|
||||
*
|
||||
* @param v Vault where the event occurred
|
||||
* @param e Actual {@link FilesystemEvent}
|
||||
*/
|
||||
public void enqueue(Vault v, FilesystemEvent e) {
|
||||
public void put(Vault v, FilesystemEvent e) {
|
||||
var key = computeKey(v, e);
|
||||
hasUpdates.set(true);
|
||||
map.compute(key, (k, val) -> {
|
||||
|
||||
@@ -34,15 +34,10 @@ public class FxFSEventList {
|
||||
flush();
|
||||
}
|
||||
}, 1000, 1000, TimeUnit.MILLISECONDS);
|
||||
//TODO: allow the task to be canceled (to enable ui actions, e.g. when the contextMenu is open, the list should not be updated
|
||||
}
|
||||
|
||||
public ObservableList<Map.Entry<FSEventBucket, FSEventBucketContent>> getObservableList() {
|
||||
return events;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clones the aggregator into the observable list
|
||||
* Starts the clone task on the FX thread and wait till it is completed
|
||||
*/
|
||||
private void flush() {
|
||||
var latch = new CountDownLatch(1);
|
||||
@@ -58,6 +53,10 @@ public class FxFSEventList {
|
||||
}
|
||||
}
|
||||
|
||||
public ObservableList<Map.Entry<FSEventBucket, FSEventBucketContent>> getObservableList() {
|
||||
return events;
|
||||
}
|
||||
|
||||
public BooleanProperty unreadEventsProperty() {
|
||||
return unreadEvents;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user