Simplify how the project tree is populated
This commit is contained in:
@@ -166,6 +166,7 @@ class GuiProjectView(QWidget):
|
||||
|
||||
def openProjectTasks(self) -> None:
|
||||
"""Run open project tasks."""
|
||||
self.populateTree()
|
||||
self.projBar.buildQuickLinksMenu()
|
||||
self.projBar.setEnabled(True)
|
||||
return
|
||||
|
||||
@@ -189,9 +189,6 @@ class GuiMain(QMainWindow):
|
||||
self.splitView.setVisible(False)
|
||||
self.docEditor.closeSearch()
|
||||
|
||||
# Initialise the Project Tree
|
||||
self.rebuildTrees()
|
||||
|
||||
# Assemble Main Window Elements
|
||||
self.mainBox = QHBoxLayout()
|
||||
self.mainBox.addWidget(self.sideBar)
|
||||
@@ -463,7 +460,6 @@ class GuiMain(QMainWindow):
|
||||
|
||||
# Update GUI
|
||||
self._updateWindowTitle(SHARED.project.data.name)
|
||||
self.rebuildTrees()
|
||||
self.docEditor.toggleSpellCheck(SHARED.project.data.spellCheck)
|
||||
self.mainStatus.setRefTime(SHARED.project.projOpened)
|
||||
self.projView.openProjectTasks()
|
||||
@@ -737,11 +733,6 @@ class GuiMain(QMainWindow):
|
||||
|
||||
return
|
||||
|
||||
def rebuildTrees(self) -> None:
|
||||
"""Rebuild the project tree."""
|
||||
self.projView.populateTree()
|
||||
return
|
||||
|
||||
def rebuildIndex(self, beQuiet: bool = False) -> None:
|
||||
"""Rebuild the entire index."""
|
||||
if SHARED.hasProject:
|
||||
|
||||
@@ -161,7 +161,7 @@ def testDlgProjSettings_StatusImport(qtbot, monkeypatch, nwGUI, projPath, mockRn
|
||||
project.tree[hCharNote].setImport(C.iMajor) # type: ignore
|
||||
project.tree[hWorldNote].setImport(C.iMain) # type: ignore
|
||||
|
||||
nwGUI.rebuildTrees()
|
||||
nwGUI.projView.populateTree()
|
||||
project.countStatus()
|
||||
|
||||
assert [e.count for _, e in project.data.itemStatus.iterItems()] == [2, 0, 2, 1]
|
||||
|
||||
+1
-1
@@ -197,7 +197,7 @@ def buildTestProject(obj: object, projPath: Path) -> None:
|
||||
project._valid = True
|
||||
|
||||
if nwGUI is not None:
|
||||
nwGUI.rebuildTrees()
|
||||
nwGUI.projView.populateTree()
|
||||
|
||||
return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user