From cae9705e4f0fe7f09e1736ba010aa781f2edf09d Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Fri, 29 May 2020 23:03:04 +0200 Subject: [PATCH] Files don't need the expanded flag saved to XML --- nw/core/project.py | 3 ++- sample/nwProject.nwx | 18 +----------------- 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/nw/core/project.py b/nw/core/project.py index c89bb645..abaed265 100644 --- a/nw/core/project.py +++ b/nw/core/project.py @@ -1572,7 +1572,6 @@ class NWItem(): xSub = self._subPack(xPack,"type", text=str(self.itemType.name)) xSub = self._subPack(xPack,"class", text=str(self.itemClass.name)) xSub = self._subPack(xPack,"status", text=str(self.itemStatus)) - xSub = self._subPack(xPack,"expanded", text=str(self.isExpanded)) if self.itemType == nwItemType.FILE: xSub = self._subPack(xPack,"exported", text=str(self.isExported)) xSub = self._subPack(xPack,"layout", text=str(self.itemLayout.name)) @@ -1580,6 +1579,8 @@ class NWItem(): xSub = self._subPack(xPack,"wordCount", text=str(self.wordCount), none=False) xSub = self._subPack(xPack,"paraCount", text=str(self.paraCount), none=False) xSub = self._subPack(xPack,"cursorPos", text=str(self.cursorPos), none=False) + else: + xSub = self._subPack(xPack,"expanded", text=str(self.isExpanded)) return def unpackXML(self, xItem): diff --git a/sample/nwProject.nwx b/sample/nwProject.nwx index 58b97959..60752873 100644 --- a/sample/nwProject.nwx +++ b/sample/nwProject.nwx @@ -1,5 +1,5 @@ - + Sample Project Sample Project @@ -57,7 +57,6 @@ FILE NOVEL Started - False True TITLE 72 @@ -70,7 +69,6 @@ FILE NOVEL New - False True PAGE 208 @@ -83,7 +81,6 @@ FILE NOVEL New - False True PARTITION 23 @@ -103,7 +100,6 @@ FILE NOVEL Notes - False True CHAPTER 12 @@ -116,7 +112,6 @@ FILE NOVEL 1st Draft - False True SCENE 1199 @@ -129,7 +124,6 @@ FILE NOVEL 1st Draft - False True SCENE 476 @@ -142,7 +136,6 @@ FILE NOVEL Finished - False True UNNUMBERED 633 @@ -155,7 +148,6 @@ FILE NOVEL 2nd Draft - False False NOTE 1692 @@ -168,7 +160,6 @@ FILE NOVEL 1st Draft - False True CHAPTER 139 @@ -181,7 +172,6 @@ FILE NOVEL 1st Draft - False True SCENE 189 @@ -208,7 +198,6 @@ FILE CHARACTER Minor - False True NOTE 49 @@ -221,7 +210,6 @@ FILE CHARACTER Major - False True NOTE 55 @@ -241,7 +229,6 @@ FILE WORLD Main - False True NOTE 76 @@ -254,7 +241,6 @@ FILE WORLD Minor - False True NOTE 115 @@ -267,7 +253,6 @@ FILE WORLD Major - False True NOTE 28 @@ -287,7 +272,6 @@ FILE NOVEL New - False True SCENE 0