mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-19 11:07:43 +00:00
No need to refresh entire tree when ingest completes or new data added. Only need to trigger openCoreWindows() when the first data source is added.
This commit is contained in:
parent
f32a70cdad
commit
d30ce3c785
@ -45,6 +45,7 @@ import org.openide.nodes.Children;
|
|||||||
import org.openide.nodes.Node;
|
import org.openide.nodes.Node;
|
||||||
import org.openide.nodes.NodeNotFoundException;
|
import org.openide.nodes.NodeNotFoundException;
|
||||||
import org.openide.nodes.NodeOp;
|
import org.openide.nodes.NodeOp;
|
||||||
|
import org.openide.util.Exceptions;
|
||||||
import org.openide.util.NbBundle;
|
import org.openide.util.NbBundle;
|
||||||
import org.openide.windows.TopComponent;
|
import org.openide.windows.TopComponent;
|
||||||
import org.openide.windows.WindowManager;
|
import org.openide.windows.WindowManager;
|
||||||
@ -566,12 +567,15 @@ public final class DirectoryTreeTopComponent extends TopComponent implements Dat
|
|||||||
* already closed.
|
* already closed.
|
||||||
*/
|
*/
|
||||||
try {
|
try {
|
||||||
Case.getCurrentCase();
|
Case currentCase = Case.getCurrentCase();
|
||||||
|
// We only need to trigger openCoreWindows() when the
|
||||||
|
// first data source is added.
|
||||||
|
if (currentCase.getDataSources().size() == 1) {
|
||||||
SwingUtilities.invokeLater(() -> {
|
SwingUtilities.invokeLater(() -> {
|
||||||
CoreComponentControl.openCoreWindows();
|
CoreComponentControl.openCoreWindows();
|
||||||
componentOpened();
|
|
||||||
});
|
});
|
||||||
} catch (IllegalStateException notUsed) {
|
}
|
||||||
|
} catch (IllegalStateException | TskCoreException notUsed) {
|
||||||
/**
|
/**
|
||||||
* Case is closed, do nothing.
|
* Case is closed, do nothing.
|
||||||
*/
|
*/
|
||||||
@ -584,23 +588,6 @@ public final class DirectoryTreeTopComponent extends TopComponent implements Dat
|
|||||||
} else if (changed.equals(IngestManager.IngestModuleEvent.DATA_ADDED.toString())) {
|
} else if (changed.equals(IngestManager.IngestModuleEvent.DATA_ADDED.toString())) {
|
||||||
// nothing to do here.
|
// nothing to do here.
|
||||||
// all nodes should be listening for these events and update accordingly.
|
// all nodes should be listening for these events and update accordingly.
|
||||||
} else if (changed.equals(IngestManager.IngestJobEvent.COMPLETED.toString())
|
|
||||||
|| changed.equals(IngestManager.IngestJobEvent.CANCELLED.toString())
|
|
||||||
|| changed.equals(IngestManager.IngestModuleEvent.CONTENT_CHANGED.toString())) {
|
|
||||||
/**
|
|
||||||
* Checking for a current case is a stop gap measure until a
|
|
||||||
* different way of handling the closing of cases is worked out.
|
|
||||||
* Currently, remote events may be received for a case that is
|
|
||||||
* already closed.
|
|
||||||
*/
|
|
||||||
try {
|
|
||||||
Case.getCurrentCase();
|
|
||||||
SwingUtilities.invokeLater(this::refreshDataSourceTree);
|
|
||||||
} catch (IllegalStateException notUsed) {
|
|
||||||
/**
|
|
||||||
* Case is closed, do nothing.
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user