Outline should not show non-exported items
This commit is contained in:
+7
-2
@@ -529,13 +529,18 @@ class NWIndex():
|
|||||||
# Extract Data
|
# Extract Data
|
||||||
##
|
##
|
||||||
|
|
||||||
def getNovelStructure(self):
|
def getNovelStructure(self, skipExcluded=True):
|
||||||
"""Builds a list of all titles in the novel, in the correct
|
"""Builds a list of all titles in the novel, in the correct
|
||||||
order as they appear in the tree view and in the respective
|
order as they appear in the tree view and in the respective
|
||||||
document files, but skipping all note files.
|
document files, but skipping all note files.
|
||||||
"""
|
"""
|
||||||
theStructure = []
|
theStructure = []
|
||||||
for tHandle in self.theProject.projTree.handles():
|
for tItem in self.theProject.projTree:
|
||||||
|
if tItem is None:
|
||||||
|
continue
|
||||||
|
if not tItem.isExported and skipExcluded:
|
||||||
|
continue
|
||||||
|
tHandle = tItem.itemHandle
|
||||||
if tHandle not in self.novelIndex:
|
if tHandle not in self.novelIndex:
|
||||||
continue
|
continue
|
||||||
for sTitle in sorted(self.novelIndex[tHandle].keys()):
|
for sTitle in sorted(self.novelIndex[tHandle].keys()):
|
||||||
|
|||||||
@@ -319,7 +319,6 @@ class GuiProjectOutline(QTreeWidget):
|
|||||||
if they are hidden. This ensures that showing and hiding columns
|
if they are hidden. This ensures that showing and hiding columns
|
||||||
is fast and doesn't require a rebuild of the tree.
|
is fast and doesn't require a rebuild of the tree.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
self.clear()
|
self.clear()
|
||||||
|
|
||||||
if self.firstView:
|
if self.firstView:
|
||||||
@@ -347,7 +346,7 @@ class GuiProjectOutline(QTreeWidget):
|
|||||||
currChapter = None
|
currChapter = None
|
||||||
currScene = None
|
currScene = None
|
||||||
|
|
||||||
for titleKey in self.theIndex.getNovelStructure():
|
for titleKey in self.theIndex.getNovelStructure(skipExcluded=True):
|
||||||
|
|
||||||
if len(titleKey) < 16:
|
if len(titleKey) < 16:
|
||||||
continue
|
continue
|
||||||
@@ -404,7 +403,6 @@ class GuiProjectOutline(QTreeWidget):
|
|||||||
def _createTreeItem(self, tHandle, sTitle):
|
def _createTreeItem(self, tHandle, sTitle):
|
||||||
"""Populate a tree item with all the column values.
|
"""Populate a tree item with all the column values.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
nwItem = self.theProject.projTree[tHandle]
|
nwItem = self.theProject.projTree[tHandle]
|
||||||
novIdx = self.theIndex.novelIndex[tHandle][sTitle]
|
novIdx = self.theIndex.novelIndex[tHandle][sTitle]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user