From 50973d198edf5874fc8c41275e30a698dd51c2e9 Mon Sep 17 00:00:00 2001 From: gmungoc Date: Fri, 5 Aug 2016 14:53:23 +0100 Subject: [PATCH] JAL-2168 skip news feed if parameter "-nonews" is supplied --- src/jalview/bin/Jalview.java | 5 ++++- src/jalview/gui/BlogReader.java | 11 ++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/jalview/bin/Jalview.java b/src/jalview/bin/Jalview.java index 76ae3ff..764c92c 100755 --- a/src/jalview/bin/Jalview.java +++ b/src/jalview/bin/Jalview.java @@ -336,7 +336,10 @@ public class Jalview { System.err.println("CMD [-noquestionnaire] executed successfully!"); } - desktop.checkForNews(); + if (!aparser.contains("nonews")) + { + desktop.checkForNews(); + } } if (!isHeadlessMode()) diff --git a/src/jalview/gui/BlogReader.java b/src/jalview/gui/BlogReader.java index edea2dc..ab9aad7 100644 --- a/src/jalview/gui/BlogReader.java +++ b/src/jalview/gui/BlogReader.java @@ -41,6 +41,7 @@ import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Calendar; import java.util.Collections; +import java.util.Date; import java.util.Iterator; import java.util.List; import java.util.Map; @@ -370,9 +371,9 @@ public class BlogReader extends JPanel + " and lastDate is " + lastDate); for (Item i : (List) chan.getItems()) { + Date published = i.getPublishDate(); boolean isread = lastDate == null ? false - : (i.getPublishDate() != null && !lastDate.before(i - .getPublishDate())); + : (published != null && !lastDate.before(published)); if (!updating || updateItems) { @@ -382,11 +383,11 @@ public class BlogReader extends JPanel { i.setRead(isread); } - if (i.getPublishDate() != null && !i.isRead()) + if (published != null && !i.isRead()) { - if (earliest == null || earliest.after(i.getPublishDate())) + if (earliest == null || earliest.after(published)) { - earliest = i.getPublishDate(); + earliest = published; } } } -- 1.7.10.2