Add some clear data functions

This commit is contained in:
Veronica Berglyd Olsen
2024-11-22 00:44:14 +01:00
parent ffe6cd0a65
commit a64ed405f3
8 changed files with 29 additions and 15 deletions
+3 -3
View File
@@ -116,7 +116,7 @@ class NWIndex:
# Public Methods
##
def clearIndex(self) -> None:
def clear(self) -> None:
"""Clear the index dictionaries and time stamps."""
self._tagsIndex.clear()
self._itemIndex.clear()
@@ -125,9 +125,9 @@ class NWIndex:
SHARED.indexSignalProxy({"event": "clearIndex"})
return
def rebuildIndex(self) -> None:
def rebuild(self) -> None:
"""Rebuild the entire index from scratch."""
self.clearIndex()
self.clear()
for nwItem in self._project.tree:
if nwItem.isFileType():
text = self._project.storage.getDocumentText(nwItem.itemHandle)