Rename open and save document to read and write in NWDoc

This commit is contained in:
Veronica K. B. Olsen
2021-04-25 17:10:12 +02:00
parent 1e48c6dcfe
commit d473615ccf
11 changed files with 67 additions and 59 deletions
+5 -2
View File
@@ -287,7 +287,10 @@ class GuiProjectTree(QTreeWidget):
# This is a new files, so let's add some content
newDoc = NWDoc(self.theProject, self.theParent)
curTxt = newDoc.openDocument(tHandle, showStatus=False)
curTxt = newDoc.readDocument(tHandle, showStatus=False)
if curTxt is None:
curTxt = ""
if curTxt == "":
if nwItem.itemLayout == nwItemLayout.CHAPTER:
newText = f"## {nwItem.itemName}\n\n"
@@ -299,7 +302,7 @@ class GuiProjectTree(QTreeWidget):
newText = f"# {nwItem.itemName}\n\n"
# Save the text and index it
newDoc.saveDocument(newText)
newDoc.writeDocument(newText)
self.theIndex.scanText(tHandle, newText)
# Get Word Counts