mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-14 17:06:16 +00:00
more work to keep autopsy and ImageGallery tags in sync
add setFiles method to DrawableGroup; don't clear groups from GroupMap except for CaseChange; reuse groups via setFiles method when regrouping reselect group in navpanel after regroup
This commit is contained in:
parent
2eecaa297e
commit
1f813a6708
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Autopsy Forensic Browser
|
* Autopsy Forensic Browser
|
||||||
*
|
*
|
||||||
* Copyright 2013 Basis Technology Corp.
|
* Copyright 2013-15 Basis Technology Corp.
|
||||||
* Contact: carrier <at> sleuthkit <dot> org
|
* Contact: carrier <at> sleuthkit <dot> org
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
@ -165,11 +165,13 @@ public class DrawableGroup implements Comparable<DrawableGroup> {
|
|||||||
|
|
||||||
// By default, sort by group key name
|
// By default, sort by group key name
|
||||||
@Override
|
@Override
|
||||||
public int compareTo(DrawableGroup other) {
|
public int compareTo(DrawableGroup other
|
||||||
|
) {
|
||||||
return this.groupKey.getValueDisplayName().compareTo(other.groupKey.getValueDisplayName());
|
return this.groupKey.getValueDisplayName().compareTo(other.groupKey.getValueDisplayName());
|
||||||
}
|
}
|
||||||
|
|
||||||
void setSeen(boolean isSeen) {
|
void setSeen(boolean isSeen
|
||||||
|
) {
|
||||||
this.seen.set(isSeen);
|
this.seen.set(isSeen);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -200,21 +200,7 @@ public class GroupManager {
|
|||||||
@Nullable
|
@Nullable
|
||||||
public DrawableGroup getGroupForKey(@Nonnull GroupKey<?> groupKey) {
|
public DrawableGroup getGroupForKey(@Nonnull GroupKey<?> groupKey) {
|
||||||
synchronized (groupMap) {
|
synchronized (groupMap) {
|
||||||
if (groupKey.getAttribute() == DrawableAttribute.TAGS) {
|
|
||||||
|
|
||||||
System.out.println(groupKey);
|
|
||||||
// @SuppressWarnings("unchecked")
|
|
||||||
// GroupKey<TagName> tagKey = (GroupKey<TagName>) groupKey;
|
|
||||||
//
|
|
||||||
// return groupMap.keySet().stream()
|
|
||||||
// .filter((GroupKey<?> t) -> t.getAttribute() == DrawableAttribute.TAGS)
|
|
||||||
// .map((GroupKey<?> t) -> (GroupKey<TagName>) t)
|
|
||||||
// .filter(t -> tagKey.getValue().getDisplayName().equals(t.getValue().getDisplayName()))
|
|
||||||
// .findFirst().map(groupMap::get).orElse(null);
|
|
||||||
|
|
||||||
} //else {
|
|
||||||
return groupMap.get(groupKey);
|
return groupMap.get(groupKey);
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -258,15 +244,19 @@ public class GroupManager {
|
|||||||
/**
|
/**
|
||||||
* 'mark' the given group as seen. This removes it from the queue of
|
* 'mark' the given group as seen. This removes it from the queue of
|
||||||
* groups
|
* groups
|
||||||
|
* files.
|
||||||
public DrawableGroup makeGroup(GroupKey<?> groupKey, Set<Long> files) {
|
public DrawableGroup makeGroup(GroupKey<?> groupKey, Set<Long> files) {
|
||||||
|
|
||||||
Set<Long> newFiles = ObjectUtils.defaultIfNull(files, new HashSet<Long>());
|
Set<Long> newFiles = ObjectUtils.defaultIfNull(files, new HashSet<Long>());
|
||||||
|
}
|
||||||
|
* groups
|
||||||
* to review, and is persisted in the drawable db.
|
* to review, and is persisted in the drawable db.
|
||||||
*
|
*
|
||||||
* @param group the {@link DrawableGroup} to mark as seen
|
* @param group the {@link DrawableGroup} to mark as seen
|
||||||
*/
|
*/
|
||||||
@ThreadConfined(type = ThreadType.JFX)
|
@ThreadConfined(type = ThreadType.JFX)
|
||||||
public void markGroupSeen(DrawableGroup group, boolean seen) {
|
public void markGroupSeen(DrawableGroup group, boolean seen
|
||||||
|
) {
|
||||||
db.markGroupSeen(group.getGroupKey(), seen);
|
db.markGroupSeen(group.getGroupKey(), seen);
|
||||||
group.setSeen(seen);
|
group.setSeen(seen);
|
||||||
if (seen) {
|
if (seen) {
|
||||||
@ -546,6 +536,7 @@ public class GroupManager {
|
|||||||
unmodifiableUnSeenGroups.setComparator(sortBy.getGrpComparator(sortOrder));
|
unmodifiableUnSeenGroups.setComparator(sortBy.getGrpComparator(sortOrder));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -705,6 +696,7 @@ public class GroupManager {
|
|||||||
LOGGER.log(Level.SEVERE, "failed to get files for group: " + groupKey.getAttribute().attrName.toString() + " = " + groupKey.getValue(), ex);
|
LOGGER.log(Level.SEVERE, "failed to get files for group: " + groupKey.getAttribute().attrName.toString() + " = " + groupKey.getValue(), ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user