Make NWDoc class non-reusable

This commit is contained in:
Veronica K. B. Olsen
2021-04-25 23:01:20 +02:00
parent fd28cbca4e
commit 470daf0036
8 changed files with 50 additions and 65 deletions
+4 -4
View File
@@ -286,8 +286,8 @@ class GuiProjectTree(QTreeWidget):
return True
# This is a new files, so let's add some content
newDoc = NWDoc(self.theProject)
curTxt = newDoc.readDocument(tHandle)
newDoc = NWDoc(self.theProject, tHandle)
curTxt = newDoc.readDocument()
if curTxt is None:
curTxt = ""
@@ -527,8 +527,8 @@ class GuiProjectTree(QTreeWidget):
if self.theParent.docEditor.theHandle == tHandle:
self.theParent.closeDocument()
theDoc = NWDoc(self.theProject)
theDoc.deleteDocument(tHandle)
delDoc = NWDoc(self.theProject, tHandle)
delDoc.deleteDocument()
self.theIndex.deleteHandle(tHandle)
self._deleteTreeItem(tHandle)
self._setTreeChanged(True)