Move the project index into the project class

This commit is contained in:
Veronica Berglyd Olsen
2022-05-28 14:11:58 +02:00
parent 5d86cfb092
commit 8bdd09400a
17 changed files with 70 additions and 62 deletions
+4 -5
View File
@@ -145,7 +145,6 @@ class GuiProjectDetailsMain(QWidget):
self.theParent = theParent
self.theProject = theProject
self.theTheme = theParent.theTheme
self.theIndex = theParent.theIndex
fPx = self.theTheme.fontPixelSize
fPt = self.theTheme.fontPointSize
@@ -245,8 +244,9 @@ class GuiProjectDetailsMain(QWidget):
def updateValues(self):
"""Set all the values.
"""
hCounts = self.theIndex.getNovelTitleCounts()
nwCount = self.theIndex.getNovelWordCount()
pIndex = self.theProject.index
hCounts = pIndex.getNovelTitleCounts()
nwCount = pIndex.getNovelWordCount()
edTime = self.theProject.getCurrentEditTime()
self.wordCountVal.setText(f"{nwCount:n}")
@@ -277,7 +277,6 @@ class GuiProjectDetailsContents(QWidget):
self.theParent = theParent
self.theProject = theProject
self.theTheme = theParent.theTheme
self.theIndex = theParent.theIndex
self.optState = theProject.optState
# Internal
@@ -424,7 +423,7 @@ class GuiProjectDetailsContents(QWidget):
"""Extract the data for the tree.
"""
self._theToC = []
self._theToC = self.theIndex.getTableOfContents(2)
self._theToC = self.theProject.index.getTableOfContents(2)
self._theToC.append(("", 0, self.tr("END"), 0))
return