From 77d3e11e9118fcf724a6cd2824495a1a35015d19 Mon Sep 17 00:00:00 2001 From: "patrick.pdb" Date: Tue, 4 Jun 2024 10:29:09 -0400 Subject: [PATCH] '#2163 Removes unnecessary field and corrects getQuery method to return a value only if a filter is defined. --- .../main/java/iped/app/ui/TreeListener.java | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/iped-app/src/main/java/iped/app/ui/TreeListener.java b/iped-app/src/main/java/iped/app/ui/TreeListener.java index 3ee22d2fa8..32cf17e9ca 100644 --- a/iped-app/src/main/java/iped/app/ui/TreeListener.java +++ b/iped-app/src/main/java/iped/app/ui/TreeListener.java @@ -61,7 +61,6 @@ public class TreeListener extends MouseAdapter implements TreeSelectionListener, boolean rootSelected = false; HashSet selection = new HashSet(); private long collapsedTime = 0; - private boolean clearing = false; private ArrayList definedFilters; @Override @@ -185,8 +184,7 @@ public void actionPerformed(ActionEvent e) { App.get().setEvidenceDefaultColor(false); } - if (!clearing) - App.get().appletListener.updateFileListing(); + App.get().appletListener.updateFileListing(); if (selection.size() == 1 && selection.iterator().next().getPathCount() > 2) { int luceneId = ((Node) selection.iterator().next().getLastPathComponent()).docId; @@ -229,8 +227,6 @@ private void showTreeMenu(MouseEvent e) { @Override public void clearFilter() { - clearing = true; - TreeSelectionListener[] listeners = App.get().tree.getTreeSelectionListeners(); for (TreeSelectionListener lis : listeners) { App.get().tree.removeTreeSelectionListener(lis); @@ -245,7 +241,6 @@ public void clearFilter() { App.get().tree.addTreeSelectionListener(lis); } } - clearing = false; } class PathFilter extends QueryFilter { @@ -295,10 +290,13 @@ public boolean hasFiltersApplied() { @Override public Query getQuery() { - if (App.get().recursiveTreeList.isSelected()) - return recursiveTreeQuery; - else - return treeQuery; + if (definedFilters != null) { + if (App.get().recursiveTreeList.isSelected()) + return recursiveTreeQuery; + else + return treeQuery; + } + return null; } public String toString() {