Skip to content

Commit

Permalink
'#2163 Removes unnecessary field and corrects getQuery method to return
Browse files Browse the repository at this point in the history
a value only if a filter is defined.
  • Loading branch information
patrickdalla committed Jun 4, 2024
1 parent df5d086 commit 77d3e11
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions iped-app/src/main/java/iped/app/ui/TreeListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ public class TreeListener extends MouseAdapter implements TreeSelectionListener,
boolean rootSelected = false;
HashSet<TreePath> selection = new HashSet<TreePath>();
private long collapsedTime = 0;
private boolean clearing = false;
private ArrayList<IFilter> definedFilters;

@Override
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand All @@ -245,7 +241,6 @@ public void clearFilter() {
App.get().tree.addTreeSelectionListener(lis);
}
}
clearing = false;
}

class PathFilter extends QueryFilter {
Expand Down Expand Up @@ -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() {
Expand Down

0 comments on commit 77d3e11

Please sign in to comment.