mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-12 07:56:16 +00:00
improved checks for availability of eamdb and related resources
This commit is contained in:
parent
a7738ce0bf
commit
06b6e1a89f
@ -87,8 +87,12 @@ public final class CommonAttributePanel extends javax.swing.JDialog {
|
|||||||
|
|
||||||
private static boolean isEamDbAvailable() {
|
private static boolean isEamDbAvailable() {
|
||||||
try {
|
try {
|
||||||
EamDb DbManager = EamDb.getInstance();
|
return (EamDb.isEnabled() &&
|
||||||
return DbManager != null;
|
EamDb.getInstance() != null &&
|
||||||
|
EamDb.getInstance().getCases().size() > 1 &&
|
||||||
|
Case.isCaseOpen() &&
|
||||||
|
Case.getCurrentCase() != null &&
|
||||||
|
EamDb.getInstance().getCase(Case.getCurrentCase()) != null);
|
||||||
} catch (EamDbException ex) {
|
} catch (EamDbException ex) {
|
||||||
LOGGER.log(Level.SEVERE, "Unexpected exception while checking for EamDB enabled.", ex);
|
LOGGER.log(Level.SEVERE, "Unexpected exception while checking for EamDB enabled.", ex);
|
||||||
}
|
}
|
||||||
@ -331,7 +335,7 @@ public final class CommonAttributePanel extends javax.swing.JDialog {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private Map<Integer, String> mapDataSources(List<CorrelationCase> cases) throws Exception {
|
private Map<Integer, String> mapDataSources(List<CorrelationCase> cases) throws EamDbException {
|
||||||
Map<Integer, String> casemap = new HashMap<>();
|
Map<Integer, String> casemap = new HashMap<>();
|
||||||
CorrelationCase currentCorCase = EamDb.getInstance().getCase(Case.getCurrentCase());
|
CorrelationCase currentCorCase = EamDb.getInstance().getCase(Case.getCurrentCase());
|
||||||
for (CorrelationCase correlationCase : cases) {
|
for (CorrelationCase correlationCase : cases) {
|
||||||
|
@ -48,9 +48,17 @@ final public class CommonFilesSearchAction extends CallableSystemAction {
|
|||||||
public boolean isEnabled(){
|
public boolean isEnabled(){
|
||||||
boolean shouldBeEnabled = false;
|
boolean shouldBeEnabled = false;
|
||||||
try {
|
try {
|
||||||
shouldBeEnabled = Case.isCaseOpen()
|
//dont refactor any of this to pull out common expressions - order of evaluation of each expression is significant
|
||||||
&& Case.getCurrentCase().getDataSources().size() > 1
|
shouldBeEnabled =
|
||||||
|| (EamDb.isEnabled() && EamDb.getInstance().getCases().size() > 1);
|
(Case.isCaseOpen() &&
|
||||||
|
Case.getCurrentCase().getDataSources().size() > 1)
|
||||||
|
||
|
||||||
|
(EamDb.isEnabled() &&
|
||||||
|
EamDb.getInstance() != null &&
|
||||||
|
EamDb.getInstance().getCases().size() > 1 &&
|
||||||
|
Case.isCaseOpen() &&
|
||||||
|
Case.getCurrentCase() != null &&
|
||||||
|
EamDb.getInstance().getCase(Case.getCurrentCase()) != null);
|
||||||
|
|
||||||
} catch(TskCoreException ex) {
|
} catch(TskCoreException ex) {
|
||||||
LOGGER.log(Level.SEVERE, "Error getting data sources for action enabled check", ex);
|
LOGGER.log(Level.SEVERE, "Error getting data sources for action enabled check", ex);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user