Refresh model when document heading count changes
This commit is contained in:
@@ -115,7 +115,6 @@ class GuiDocEditor(QPlainTextEdit):
|
||||
editedStatusChanged = pyqtSignal(bool)
|
||||
itemHandleChanged = pyqtSignal(str)
|
||||
loadDocumentTagRequest = pyqtSignal(str, Enum)
|
||||
novelItemMetaChanged = pyqtSignal(str)
|
||||
novelStructureChanged = pyqtSignal()
|
||||
openDocumentRequest = pyqtSignal(str, Enum, str, bool)
|
||||
requestNewNoteCreation = pyqtSignal(str, nwItemClass)
|
||||
@@ -498,18 +497,8 @@ class GuiDocEditor(QPlainTextEdit):
|
||||
|
||||
self.setDocumentChanged(False)
|
||||
self.docTextChanged.emit(self._docHandle, self._lastEdit)
|
||||
|
||||
oldCount = SHARED.project.index.getHandleHeaderCount(tHandle)
|
||||
SHARED.project.index.scanText(tHandle, text)
|
||||
newCount = SHARED.project.index.getHandleHeaderCount(tHandle)
|
||||
|
||||
if self._nwItem.itemClass == nwItemClass.NOVEL:
|
||||
if oldCount == newCount:
|
||||
self.novelItemMetaChanged.emit(tHandle)
|
||||
else:
|
||||
self.novelStructureChanged.emit()
|
||||
|
||||
# Update the status bar
|
||||
self.updateStatusMessage.emit(self.tr("Saved Document: {0}").format(self._nwItem.itemName))
|
||||
|
||||
return True
|
||||
|
||||
Reference in New Issue
Block a user