From e6a8488e08e8e91771724e1758f88415027f4a1f Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Sat, 27 Jun 2020 17:00:41 +0200 Subject: [PATCH] Some minor tweaks to the session log filter logic --- nw/gui/sessionlog.py | 11 ++++++----- sample/nwProject.nwx | 8 ++++---- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/nw/gui/sessionlog.py b/nw/gui/sessionlog.py index cab4a92c..9e620f13 100644 --- a/nw/gui/sessionlog.py +++ b/nw/gui/sessionlog.py @@ -497,16 +497,17 @@ class GuiSessionLog(QDialog): wcTotal += wcNotes dwTotal = wcTotal - pcTotal + if isFirst: + # Subtract the offset from the first list entry + dwTotal -= self.wordOffset + dwTotal = max(dwTotal, 0) # But don't go negative + isFirst = False + if hideZeros and dwTotal == 0: continue if hideNegative and dwTotal < 0: continue - if isFirst: - # Subtract the offset from the first list entry - dwTotal -= self.wordOffset - isFirst = False - if groupByDay: sStart = dStart.strftime(nwConst.dStampFmt) else: diff --git a/sample/nwProject.nwx b/sample/nwProject.nwx index 015816ff..c88c5269 100644 --- a/sample/nwProject.nwx +++ b/sample/nwProject.nwx @@ -1,13 +1,13 @@ - + Sample Project Sample Project Jane Smith Jay Doh - 589 - 102 - 24247 + 591 + 103 + 24557 False