From aebf26fa9c8f489247deebd6eff4fc38e43ce3d9 Mon Sep 17 00:00:00 2001 From: millmanorama Date: Wed, 28 Jun 2017 13:55:51 +0200 Subject: [PATCH] use boolean expresison that is true in both SQLite and PostgreSQL --- .../sleuthkit/autopsy/datamodel/FileTypesByExtension.java | 2 +- .../sleuthkit/autopsy/datamodel/FileTypesByMimeType.java | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/FileTypesByExtension.java b/Core/src/org/sleuthkit/autopsy/datamodel/FileTypesByExtension.java index 9520d62d89..8f0802007e 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/FileTypesByExtension.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/FileTypesByExtension.java @@ -122,7 +122,7 @@ public final class FileTypesByExtension implements AutopsyVisitableItem { private boolean shouldShowCounts(SleuthkitCase skCase) { if (showCounts) { try { - if (skCase.countFilesWhere("1") > 200000) { + if (skCase.countFilesWhere("1=1") > 200000) { showCounts = false; } } catch (TskCoreException tskCoreException) { diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/FileTypesByMimeType.java b/Core/src/org/sleuthkit/autopsy/datamodel/FileTypesByMimeType.java index 53b2ad0581..2ccc1dc1e8 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/FileTypesByMimeType.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/FileTypesByMimeType.java @@ -159,7 +159,7 @@ public final class FileTypesByMimeType extends Observable implements AutopsyVisi */ try { Case.getCurrentCase(); - shouldShowCounts(); + shouldShowCounts(skCase); populateHashMap(); } catch (IllegalStateException notUsed) { @@ -185,10 +185,10 @@ public final class FileTypesByMimeType extends Observable implements AutopsyVisi * * @return True, unless the DB has more than 200k rows. */ - private boolean shouldShowCounts() { + private boolean shouldShowCounts(final SleuthkitCase skCase) { if (showCounts) { try { - if (skCase.countFilesWhere("1") > 200000) { + if (skCase.countFilesWhere("1=1") > 200000) { showCounts = false; } } catch (TskCoreException tskCoreException) { @@ -381,7 +381,7 @@ public final class FileTypesByMimeType extends Observable implements AutopsyVisi * results */ private void updateDisplayName(String mimeType) { - final String count = shouldShowCounts() + final String count = shouldShowCounts(skCase) ? " (" + Long.toString(new MediaSubTypeNodeChildren(mimeType).calculateItems(skCase, mimeType)) + ")" : ""; String[] mimeTypeParts = mimeType.split("/");