Merge branch 'main' into release_1.0
This commit is contained in:
+7
-12
@@ -143,16 +143,11 @@ class NWIndex():
|
||||
logger.error(str(e))
|
||||
return False
|
||||
|
||||
if "tagIndex" in theData.keys():
|
||||
self.tagIndex = theData["tagIndex"]
|
||||
if "refIndex" in theData.keys():
|
||||
self.refIndex = theData["refIndex"]
|
||||
if "novelIndex" in theData.keys():
|
||||
self.novelIndex = theData["novelIndex"]
|
||||
if "noteIndex" in theData.keys():
|
||||
self.noteIndex = theData["noteIndex"]
|
||||
if "textCounts" in theData.keys():
|
||||
self.textCounts = theData["textCounts"]
|
||||
self.tagIndex = theData.get("tagIndex", {})
|
||||
self.refIndex = theData.get("refIndex", {})
|
||||
self.novelIndex = theData.get("novelIndex", {})
|
||||
self.noteIndex = theData.get("noteIndex", {})
|
||||
self.textCounts = theData.get("textCounts", {})
|
||||
|
||||
nowTime = round(time())
|
||||
self.timeNovel = nowTime
|
||||
@@ -221,6 +216,7 @@ class NWIndex():
|
||||
except Exception:
|
||||
self.indexBroken = True
|
||||
|
||||
logger.debug("Index check complete")
|
||||
if self.indexBroken:
|
||||
self.clearIndex()
|
||||
self.theParent.makeAlert(
|
||||
@@ -593,8 +589,7 @@ class NWIndex():
|
||||
return theRefs
|
||||
|
||||
for refTitle in self.refIndex[tHandle]:
|
||||
theTags = self.refIndex[tHandle][refTitle].get("tags", None)
|
||||
for aTag in theTags:
|
||||
for aTag in self.refIndex[tHandle][refTitle].get("tags", []):
|
||||
if len(aTag) == 3 and (sTitle is None or sTitle == refTitle):
|
||||
theRefs[aTag[1]].append(aTag[2])
|
||||
|
||||
|
||||
+7
-1
@@ -395,14 +395,19 @@ class GuiOutline(QTreeWidget):
|
||||
self.treeMap[titleKey] = tItem
|
||||
|
||||
if tLevel == "H1":
|
||||
currTitle = tItem
|
||||
self.addTopLevelItem(tItem)
|
||||
currTitle = tItem
|
||||
currChapter = None
|
||||
currScene = None
|
||||
|
||||
elif tLevel == "H2":
|
||||
if currTitle is None:
|
||||
self.addTopLevelItem(tItem)
|
||||
else:
|
||||
currTitle.addChild(tItem)
|
||||
currChapter = tItem
|
||||
currScene = None
|
||||
|
||||
elif tLevel == "H3":
|
||||
if currChapter is None:
|
||||
if currTitle is None:
|
||||
@@ -412,6 +417,7 @@ class GuiOutline(QTreeWidget):
|
||||
else:
|
||||
currChapter.addChild(tItem)
|
||||
currScene = tItem
|
||||
|
||||
elif tLevel == "H4":
|
||||
if currScene is None:
|
||||
if currChapter is None:
|
||||
|
||||
@@ -329,7 +329,7 @@ class GuiOutlineDetails(QScrollArea):
|
||||
def _formatTags(self, theRefs, theKey):
|
||||
"""Format the tags as clickable links.
|
||||
"""
|
||||
if theKey not in theKey:
|
||||
if theKey not in theRefs:
|
||||
return ""
|
||||
refTags = []
|
||||
for tTag in theRefs[theKey]:
|
||||
|
||||
Reference in New Issue
Block a user