diff --git a/Core/src/org/sleuthkit/autopsy/corecomponents/GeneralPanel.java b/Core/src/org/sleuthkit/autopsy/corecomponents/GeneralPanel.java index 3b3c77a876..3d697b07ab 100644 --- a/Core/src/org/sleuthkit/autopsy/corecomponents/GeneralPanel.java +++ b/Core/src/org/sleuthkit/autopsy/corecomponents/GeneralPanel.java @@ -34,7 +34,7 @@ final class GeneralPanel extends javax.swing.JPanel { GeneralPanel(GeneralOptionsPanelController controller) { this.controller = controller; initComponents(); - ContentUtils.setLocalTime(useLocalTimeRB.isSelected()); + ContentUtils.setDisplayInLocalTime(useLocalTimeRB.isSelected()); // TODO listen to changes in form fields and call controller.changed() } @@ -152,7 +152,7 @@ final class GeneralPanel extends javax.swing.JPanel { }//GEN-LAST:event_useBestViewerRBActionPerformed private void useGMTTimeRBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_useGMTTimeRBActionPerformed - ContentUtils.setLocalTime(useLocalTimeRB.isSelected()); + ContentUtils.setDisplayInLocalTime(useLocalTimeRB.isSelected()); }//GEN-LAST:event_useGMTTimeRBActionPerformed void load() { diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/ContentUtils.java b/Core/src/org/sleuthkit/autopsy/datamodel/ContentUtils.java index 3dee14bff4..9cc844cae6 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/ContentUtils.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/ContentUtils.java @@ -50,7 +50,7 @@ public final class ContentUtils { private final static Logger logger = Logger.getLogger(ContentUtils.class.getName()); private static final SimpleDateFormat dateFormatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss z"); private static final SimpleDateFormat dateFormatterISO8601 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'"); - private static boolean localTime; + private static boolean displayInLocalTime; // don't instantiate private ContentUtils() { throw new AssertionError(); @@ -108,7 +108,7 @@ public final class ContentUtils { public static TimeZone getTimeZone(Content c) { try { - if (!localTime()) { + if (!getDisplayInLocalTime()) { return TimeZone.getTimeZone("GMT"); } else { @@ -359,18 +359,18 @@ public final class ContentUtils { + cntnt.getClass().getSimpleName()); } } - /**sets localTime value based on button in GeneralPanel.java + /**sets displayInlocalTime value based on button in GeneralPanel.java * * @param flag */ - public static void setLocalTime(boolean flag) { - localTime = flag; + public static void setDisplayInLocalTime(boolean flag) { + displayInLocalTime = flag; } - /** returns true if local time is selected. - * returns false if GMT is selected. + /** get global timezone setting for displaying time values + * * @return */ - public static boolean localTime(){ - return localTime; + public static boolean getDisplayInLocalTime(){ + return displayInLocalTime; } } diff --git a/Timeline/src/org/sleuthkit/autopsy/timeline/Timeline.java b/Timeline/src/org/sleuthkit/autopsy/timeline/Timeline.java index 952e907562..675bfc318f 100644 --- a/Timeline/src/org/sleuthkit/autopsy/timeline/Timeline.java +++ b/Timeline/src/org/sleuthkit/autopsy/timeline/Timeline.java @@ -145,7 +145,6 @@ public class Timeline extends CallableSystemAction implements Presenter.Toolbar, private EventHandler fxMouseExitedListener; private SleuthkitCase skCase; private boolean fxInited = false; - private static boolean localTime = true; public Timeline() { super(); @@ -932,13 +931,13 @@ public class Timeline extends CallableSystemAction implements Presenter.Toolbar, int minute=Integer.valueOf(date[4]); int second=Integer.valueOf(date[5]); - setLocalTime(localTime); Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("GMT")); //set calendar to GMT due to ISO format calendar.set(year, month, day, hour, minute, second); day=calendar.get(Calendar.DAY_OF_MONTH); // this is needed or else timezone change wont work. probably incorrect optimization by compiler //conversion to GMT - if (!localTime()) { + + if (!ContentUtils.getDisplayInLocalTime()) { calendar.setTimeZone(TimeZone.getTimeZone("GMT")); } else{ @@ -1128,20 +1127,6 @@ public class Timeline extends CallableSystemAction implements Presenter.Toolbar, initTimeline(); } - /**set localTime by getting it from ContentUtils class - * - * @param flag - */ - public static void setLocalTime(boolean flag) { - localTime = ContentUtils.localTime(); - } - /**returns whether user has set localTime settings, or GMT if false - * - * @return - */ - public static boolean localTime() { - return localTime; - } private void initTimeline() { if (!Case.existsCurrentCase()) { return;