Some minor code cleanup and redundant code removed

This commit is contained in:
Veronica K. B. Olsen
2021-01-09 20:21:32 +01:00
parent a6cbdfc559
commit e2d5534959
2 changed files with 8 additions and 18 deletions
+7 -17
View File
@@ -51,9 +51,6 @@ class GuiMainStatus(QStatusBar):
self.theTheme = theParent.theTheme self.theTheme = theParent.theTheme
self.refTime = None self.refTime = None
self.projWords = 0
self.sessWords = 0
colNone = QColor(*self.theTheme.statNone) colNone = QColor(*self.theTheme.statNone)
colTrue = QColor(*self.theTheme.statUnsaved) colTrue = QColor(*self.theTheme.statUnsaved)
colFalse = QColor(*self.theTheme.statSaved) colFalse = QColor(*self.theTheme.statSaved)
@@ -182,26 +179,19 @@ class GuiMainStatus(QStatusBar):
def setStats(self, pWC, sWC): def setStats(self, pWC, sWC):
"""Set the current project statistics. """Set the current project statistics.
""" """
self.projWords = pWC self.statsText.setToolTip(
self.sessWords = sWC "Project word count (session change)"
self._updateStats() )
self.statsText.setText(
f"Words: {pWC:n} ({sWC:+n})"
)
return return
## ##
# Internal Functions # Internal Functions
## ##
def _updateStats(self):
"""Update statistics.
"""
self.statsText.setToolTip(
"Project word count (session change)"
)
self.statsText.setText(
f"Words: {self.projWords:n} ({self.sessWords:+n})"
)
return
def _updateTime(self): def _updateTime(self):
"""Update the session clock. """Update the session clock.
""" """
+1 -1
View File
@@ -467,7 +467,7 @@ class GuiMain(QMainWindow):
return False return False
self.treeView.saveTreeOrder() self.treeView.saveTreeOrder()
self.theProject.saveProject(autoSave) self.theProject.saveProject(autoSave=autoSave)
self.theIndex.saveIndex() self.theIndex.saveIndex()
return True return True