Clean up unused part of header check function in doc editor

This commit is contained in:
Veronica Berglyd Olsen
2022-10-20 00:22:09 +02:00
parent 815c0f1125
commit 6a6742275f
+2 -11
View File
@@ -513,7 +513,7 @@ class GuiDocEditor(QTextEdit):
newHeader = self._nwItem.mainHeading newHeader = self._nwItem.mainHeading
# ToDo: This should be a signal # ToDo: This should be a signal
if self._updateHeaders(checkLevel=True): if self._updateHeaders():
self.mainGui.requestNovelTreeRefresh() self.mainGui.requestNovelTreeRefresh()
else: else:
self.mainGui.novelView.updateWordCounts(tHandle) self.mainGui.novelView.updateWordCounts(tHandle)
@@ -2025,7 +2025,7 @@ class GuiDocEditor(QTextEdit):
return False return False
return True return True
def _updateHeaders(self, checkPos=False, checkLevel=False): def _updateHeaders(self):
"""Update the headers record and return True if anything """Update the headers record and return True if anything
changed, if a check flag was provided. changed, if a check flag was provided.
""" """
@@ -2033,22 +2033,13 @@ class GuiDocEditor(QTextEdit):
return False return False
newHeaders = self.theProject.index.getHandleHeaders(self._docHandle) newHeaders = self.theProject.index.getHandleHeaders(self._docHandle)
if checkPos:
newPos = [x[0] for x in newHeaders]
oldPos = [x[0] for x in self._docHeaders]
if checkLevel:
newLev = [x[1] for x in newHeaders] newLev = [x[1] for x in newHeaders]
oldLev = [x[1] for x in self._docHeaders] oldLev = [x[1] for x in self._docHeaders]
self._docHeaders = newHeaders self._docHeaders = newHeaders
if checkPos:
return newPos != oldPos
if checkLevel:
return newLev != oldLev return newLev != oldLev
return False
def _checkDocSize(self, theSize): def _checkDocSize(self, theSize):
"""Check if document size crosses the big document limit set in """Check if document size crosses the big document limit set in
config. If so, we will set the big document flag to True. config. If so, we will set the big document flag to True.