diff --git a/pom.xml b/pom.xml index c71252fd4..0a89a27c8 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ org.ow2.asm,org.apache.jackrabbit,org.apache.httpcomponents - 2.9.0-beta1 + 2.9.0-beta2 1.5.0 1.3.0 1.2.4 diff --git a/src/main/java/org/cryptomator/common/EventMap.java b/src/main/java/org/cryptomator/common/EventMap.java index 22f07bde7..2e8dbf035 100644 --- a/src/main/java/org/cryptomator/common/EventMap.java +++ b/src/main/java/org/cryptomator/common/EventMap.java @@ -132,12 +132,12 @@ public class EventMap implements ObservableMap { if (nullOrEntry == null) { if (size() == MAX_SIZE) { delegate.entrySet().stream() // - .min(Comparator.comparing(entry -> entry.getValue().timestamp())) // + .min(Comparator.comparing(entry -> entry.getValue().actualEvent().getTimestamp())) // .ifPresent(oldestEntry -> delegate.remove(oldestEntry.getKey())); } delegate.put(key, e); } else { - delegate.put(key, nullOrEntry.incrementCount(e.timestamp())); + delegate.put(key, nullOrEntry.incrementCount(e.actualEvent())); } } @@ -149,11 +149,11 @@ public class EventMap implements ObservableMap { private EventKey computeKey(FilesystemEvent e) { var p = switch (e) { - case DecryptionFailedEvent(Path ciphertextPath, _) -> ciphertextPath; - case ConflictResolvedEvent(_, _, _, Path resolvedCiphertext) -> resolvedCiphertext; - case ConflictResolutionFailedEvent(_, Path conflictingCiphertext, _) -> conflictingCiphertext; - case BrokenDirFileEvent(Path ciphertext) -> ciphertext; - case BrokenFileNodeEvent(_, Path ciphertext) -> ciphertext; + case DecryptionFailedEvent(_, Path ciphertextPath, _) -> ciphertextPath; + case ConflictResolvedEvent(_, _, _, _, Path resolvedCiphertext) -> resolvedCiphertext; + case ConflictResolutionFailedEvent(_, _, Path conflictingCiphertext, _) -> conflictingCiphertext; + case BrokenDirFileEvent(_, Path ciphertext) -> ciphertext; + case BrokenFileNodeEvent(_, _, Path ciphertext) -> ciphertext; }; return new EventKey(p, e.getClass()); } diff --git a/src/main/java/org/cryptomator/event/VaultEvent.java b/src/main/java/org/cryptomator/event/VaultEvent.java index 7ec47d647..8b31747cf 100644 --- a/src/main/java/org/cryptomator/event/VaultEvent.java +++ b/src/main/java/org/cryptomator/event/VaultEvent.java @@ -5,15 +5,15 @@ import org.cryptomator.cryptofs.event.FilesystemEvent; import java.time.Instant; -public record VaultEvent(Instant timestamp, Vault v, FilesystemEvent actualEvent, int count) implements Comparable { +public record VaultEvent(Vault v, FilesystemEvent actualEvent, int count) implements Comparable { public VaultEvent(Vault v, FilesystemEvent actualEvent) { - this(Instant.now(), v, actualEvent, 1); + this(v, actualEvent, 1); } @Override public int compareTo(VaultEvent other) { - var timeResult = this.timestamp.compareTo(other.timestamp); + var timeResult = actualEvent.getTimestamp().compareTo(other.actualEvent().getTimestamp()); if(timeResult != 0) { return timeResult; } else { @@ -21,7 +21,7 @@ public record VaultEvent(Instant timestamp, Vault v, FilesystemEvent actualEvent } } - public VaultEvent incrementCount(Instant timestamp) { - return new VaultEvent(timestamp, v, actualEvent, count+1); + public VaultEvent incrementCount(FilesystemEvent update) { + return new VaultEvent(v, update, count+1); } } diff --git a/src/main/java/org/cryptomator/ui/eventview/EventListCellController.java b/src/main/java/org/cryptomator/ui/eventview/EventListCellController.java index 84de27ffe..613ba43c5 100644 --- a/src/main/java/org/cryptomator/ui/eventview/EventListCellController.java +++ b/src/main/java/org/cryptomator/ui/eventview/EventListCellController.java @@ -87,8 +87,8 @@ public class EventListCellController implements FxController { this.eventIcon = new SimpleObjectProperty<>(); this.eventCount = ObservableUtil.mapWithDefault(event, e -> e.count() == 1? "" : "("+ e.count() +")", ""); this.vaultUnlocked = ObservableUtil.mapWithDefault(event.flatMap(e -> e.v().unlockedProperty()), Function.identity(), false); - this.readableTime = ObservableUtil.mapWithDefault(event, e -> LOCAL_TIME_FORMATTER.format(e.timestamp()), ""); - this.readableDate = ObservableUtil.mapWithDefault(event, e -> LOCAL_DATE_FORMATTER.format(e.timestamp()), ""); + this.readableTime = ObservableUtil.mapWithDefault(event, e -> LOCAL_TIME_FORMATTER.format(e.actualEvent().getTimestamp()), ""); + this.readableDate = ObservableUtil.mapWithDefault(event, e -> LOCAL_DATE_FORMATTER.format(e.actualEvent().getTimestamp()), ""); this.message = Bindings.createStringBinding(this::selectMessage, vaultUnlocked, eventMessage); this.description = Bindings.createStringBinding(this::selectDescription, vaultUnlocked, eventDescription); this.icon = Bindings.createObjectBinding(this::selectIcon, vaultUnlocked, eventIcon);