mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-06 21:00:22 +00:00
Merge branch 'develop' of https://github.com/sleuthkit/autopsy into 4755-OpenInExternalViewerShortcut
This commit is contained in:
commit
27271d8942
@ -22,6 +22,8 @@ import java.beans.PropertyChangeEvent;
|
|||||||
import java.beans.PropertyChangeListener;
|
import java.beans.PropertyChangeListener;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.Comparator;
|
||||||
import java.util.EnumSet;
|
import java.util.EnumSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
@ -31,7 +33,6 @@ import org.openide.nodes.Node;
|
|||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
import org.sleuthkit.autopsy.casemodule.CasePreferences;
|
import org.sleuthkit.autopsy.casemodule.CasePreferences;
|
||||||
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||||
import org.sleuthkit.autopsy.core.UserPreferences;
|
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.sleuthkit.datamodel.DataSource;
|
import org.sleuthkit.datamodel.DataSource;
|
||||||
import org.sleuthkit.datamodel.SleuthkitCase;
|
import org.sleuthkit.datamodel.SleuthkitCase;
|
||||||
@ -87,6 +88,16 @@ public final class AutopsyTreeChildFactory extends ChildFactory.Detachable<Objec
|
|||||||
|
|
||||||
if (Objects.equals(CasePreferences.getGroupItemsInTreeByDataSource(), true)) {
|
if (Objects.equals(CasePreferences.getGroupItemsInTreeByDataSource(), true)) {
|
||||||
List<DataSource> dataSources = tskCase.getDataSources();
|
List<DataSource> dataSources = tskCase.getDataSources();
|
||||||
|
|
||||||
|
Collections.sort(dataSources, new Comparator<DataSource>() {
|
||||||
|
@Override
|
||||||
|
public int compare(DataSource dataS1, DataSource dataS2) {
|
||||||
|
String dataS1Name = dataS1.getName().toLowerCase();
|
||||||
|
String dataS2Name = dataS2.getName().toLowerCase();
|
||||||
|
return dataS1Name.compareTo(dataS2Name);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
List<DataSourceGrouping> keys = new ArrayList<>();
|
List<DataSourceGrouping> keys = new ArrayList<>();
|
||||||
dataSources.forEach((datasource) -> {
|
dataSources.forEach((datasource) -> {
|
||||||
keys.add(new DataSourceGrouping(datasource));
|
keys.add(new DataSourceGrouping(datasource));
|
||||||
@ -140,4 +151,4 @@ public final class AutopsyTreeChildFactory extends ChildFactory.Detachable<Objec
|
|||||||
public void refreshChildren() {
|
public void refreshChildren() {
|
||||||
refresh(true);
|
refresh(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -23,6 +23,7 @@ import java.beans.PropertyChangeListener;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
import java.util.Comparator;
|
||||||
import java.util.EnumSet;
|
import java.util.EnumSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
@ -123,6 +124,17 @@ public class DataSourcesNode extends DisplayableItemNode {
|
|||||||
Content content = Case.getCurrentCaseThrows().getSleuthkitCase().getDataSource(datasourceObjId);
|
Content content = Case.getCurrentCaseThrows().getSleuthkitCase().getDataSource(datasourceObjId);
|
||||||
currentKeys = new ArrayList<>(Arrays.asList(content));
|
currentKeys = new ArrayList<>(Arrays.asList(content));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Collections.sort(currentKeys, new Comparator<Content>() {
|
||||||
|
@Override
|
||||||
|
public int compare(Content content1, Content content2) {
|
||||||
|
String content1Name = content1.getName().toLowerCase();
|
||||||
|
String content2Name = content2.getName().toLowerCase();
|
||||||
|
return content1Name.compareTo(content2Name);
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
setKeys(currentKeys);
|
setKeys(currentKeys);
|
||||||
} catch (TskCoreException | NoCurrentCaseException | TskDataException ex) {
|
} catch (TskCoreException | NoCurrentCaseException | TskDataException ex) {
|
||||||
logger.log(Level.SEVERE, "Error getting data sources: {0}", ex.getMessage()); // NON-NLS
|
logger.log(Level.SEVERE, "Error getting data sources: {0}", ex.getMessage()); // NON-NLS
|
||||||
@ -165,4 +177,4 @@ public class DataSourcesNode extends DisplayableItemNode {
|
|||||||
NAME));
|
NAME));
|
||||||
return sheet;
|
return sheet;
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user