From b05d6f2dc12e46cf7c23f134a25a88435143b7fd Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Fri, 26 Jun 2020 18:28:36 +0200 Subject: [PATCH] Remove some unused data and variables from the code --- nw/gui/sessionlog.py | 8 +++----- sample/nwProject.nwx | 8 ++++---- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/nw/gui/sessionlog.py b/nw/gui/sessionlog.py index 709a0961..9c66e923 100644 --- a/nw/gui/sessionlog.py +++ b/nw/gui/sessionlog.py @@ -68,7 +68,6 @@ class GuiSessionLog(QDialog): self.logData = [] self.filterData = [] self.timeFilter = 0.0 - self.timeTotal = 0.0 self.wordOffset = 0 self.setWindowTitle("Session Log") @@ -395,6 +394,7 @@ class GuiSessionLog(QDialog): ttNovel = 0 ttNotes = 0 + ttTime = 0 try: logFile = path.join(self.theProject.projMeta, nwFiles.SESS_STATS) @@ -421,7 +421,7 @@ class GuiSessionLog(QDialog): tDiff = dEnd - dStart sDiff = tDiff.total_seconds() - self.timeTotal += sDiff + ttTime += sDiff wcNovel = int(inData[4]) wcNotes = int(inData[5]) @@ -436,7 +436,7 @@ class GuiSessionLog(QDialog): ) return False - self.labelTotal.setText(self._formatTime(self.timeTotal)) + self.labelTotal.setText(self._formatTime(ttTime)) self.novelWords.setText("{:n}".format(ttNovel)) self.notesWords.setText("{:n}".format(ttNotes)) self.totalWords.setText("{:n}".format(ttNovel + ttNotes)) @@ -522,9 +522,7 @@ class GuiSessionLog(QDialog): newItem = QTreeWidgetItem() newItem.setText(self.C_TIME, sStart) newItem.setText(self.C_LENGTH, self._formatTime(sDiff)) - newItem.setData(self.C_LENGTH, Qt.UserRole, sDiff) newItem.setText(self.C_COUNT, "{:n}".format(nWords)) - newItem.setData(self.C_COUNT, Qt.UserRole, nWords) if nWords > 0 and listMax > 0: theBar = self.barImage.scaled( diff --git a/sample/nwProject.nwx b/sample/nwProject.nwx index c29a7788..8f8ee49c 100644 --- a/sample/nwProject.nwx +++ b/sample/nwProject.nwx @@ -1,13 +1,13 @@ - + Sample Project Sample Project Jane Smith Jay Doh - 565 - 99 - 23298 + 583 + 102 + 24189 False