From 04198f3ede4449f69f4464efdd549a26aab4f078 Mon Sep 17 00:00:00 2001 From: Veronica Berglyd Olsen <1619840+vkbo@users.noreply.github.com> Date: Sun, 5 Oct 2025 17:13:08 +0200 Subject: [PATCH] Remove quiet flag from index rebuild --- novelwriter/guimain.py | 8 ++++---- tests/test_gui/test_gui_guimain.py | 2 +- tests/test_gui/test_gui_statusbar.py | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/novelwriter/guimain.py b/novelwriter/guimain.py index 91d7ff59..ac065b03 100644 --- a/novelwriter/guimain.py +++ b/novelwriter/guimain.py @@ -497,7 +497,8 @@ class GuiMain(QMainWindow): # Check if we need to rebuild the index if SHARED.project.index.indexBroken: - SHARED.info(self.tr("The project index is outdated or broken. Rebuilding index.")) + if not SHARED.project.index.indexUpgrade: + SHARED.info(self.tr("The project index is broken. Rebuilding index.")) self.rebuildIndex() # Make sure the changed status is set to false on things opened @@ -729,7 +730,7 @@ class GuiMain(QMainWindow): return - def rebuildIndex(self, beQuiet: bool = False) -> None: + def rebuildIndex(self) -> None: """Rebuild the entire index.""" if SHARED.hasProject: logger.info("Rebuilding index ...") @@ -746,8 +747,7 @@ class GuiMain(QMainWindow): self._updateStatusWordCount() QApplication.restoreOverrideCursor() - if not beQuiet: - SHARED.info(self.tr("The project index has been successfully rebuilt.")) + SHARED.info(self.tr("The project index has been successfully rebuilt.")) ## # Main Dialogs diff --git a/tests/test_gui/test_gui_guimain.py b/tests/test_gui/test_gui_guimain.py index 258d5e0a..092a0486 100644 --- a/tests/test_gui/test_gui_guimain.py +++ b/tests/test_gui/test_gui_guimain.py @@ -713,7 +713,7 @@ def testGuiMain_Features(qtbot, monkeypatch, nwGUI, projPath, mockRnd): cHandle = SHARED.project.newFile("Jane", C.hCharRoot) newDoc = SHARED.project.storage.getDocument(cHandle) newDoc.writeDocument("# Jane\n\n@tag: Jane\n\n") - nwGUI.rebuildIndex(beQuiet=True) + nwGUI.rebuildIndex() assert SHARED.focusMode is False diff --git a/tests/test_gui/test_gui_statusbar.py b/tests/test_gui/test_gui_statusbar.py index 19c3f277..8bbb6fbe 100644 --- a/tests/test_gui/test_gui_statusbar.py +++ b/tests/test_gui/test_gui_statusbar.py @@ -36,7 +36,7 @@ def testGuiStatusBar_Main(qtbot, monkeypatch, nwGUI, projPath, mockRnd): cHandle = SHARED.project.newFile("A Note", C.hCharRoot) newDoc = SHARED.project.storage.getDocument(cHandle) newDoc.writeDocument("# A Note\n\n") - nwGUI.rebuildIndex(beQuiet=True) + nwGUI.rebuildIndex() status = nwGUI.mainStatus