Fixed sorting bug for line numbers in index
This commit is contained in:
+4
-4
@@ -354,7 +354,7 @@ class NWIndex():
|
|||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
sTitle = "T%d" % nLine
|
sTitle = "T%06d" % nLine
|
||||||
self.refIndex[tHandle][sTitle] = {
|
self.refIndex[tHandle][sTitle] = {
|
||||||
"tags" : [],
|
"tags" : [],
|
||||||
"updated" : time(),
|
"updated" : time(),
|
||||||
@@ -384,7 +384,7 @@ class NWIndex():
|
|||||||
"""Count text stats and save the counts to the index.
|
"""Count text stats and save the counts to the index.
|
||||||
"""
|
"""
|
||||||
cC, wC, pC = countWords(theText)
|
cC, wC, pC = countWords(theText)
|
||||||
sTitle = "T%d" % nTitle
|
sTitle = "T%06d" % nTitle
|
||||||
if isNovel:
|
if isNovel:
|
||||||
if tHandle in self.novelIndex:
|
if tHandle in self.novelIndex:
|
||||||
if sTitle in self.novelIndex[tHandle]:
|
if sTitle in self.novelIndex[tHandle]:
|
||||||
@@ -404,7 +404,7 @@ class NWIndex():
|
|||||||
def _indexSynopsis(self, tHandle, isNovel, theText, nTitle):
|
def _indexSynopsis(self, tHandle, isNovel, theText, nTitle):
|
||||||
"""Save the synopsis to the index.
|
"""Save the synopsis to the index.
|
||||||
"""
|
"""
|
||||||
sTitle = "T%d" % nTitle
|
sTitle = "T%06d" % nTitle
|
||||||
if isNovel:
|
if isNovel:
|
||||||
if tHandle in self.novelIndex:
|
if tHandle in self.novelIndex:
|
||||||
if sTitle in self.novelIndex[tHandle]:
|
if sTitle in self.novelIndex[tHandle]:
|
||||||
@@ -425,7 +425,7 @@ class NWIndex():
|
|||||||
if not isValid or len(theBits) == 0:
|
if not isValid or len(theBits) == 0:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
sTitle = "T%d" % nTitle
|
sTitle = "T%06d" % nTitle
|
||||||
if sTitle not in self.refIndex[tHandle]:
|
if sTitle not in self.refIndex[tHandle]:
|
||||||
logger.error("Cannot save tags to file %s, no title %s" % (tHandle, sTitle))
|
logger.error("Cannot save tags to file %s, no title %s" % (tHandle, sTitle))
|
||||||
return False
|
return False
|
||||||
|
|||||||
@@ -408,7 +408,7 @@ class GuiProjectOutline(QTreeWidget):
|
|||||||
newItem.setText(self.colIndex[nwOutline.HANDLE], tHandle)
|
newItem.setText(self.colIndex[nwOutline.HANDLE], tHandle)
|
||||||
newItem.setText(self.colIndex[nwOutline.LEVEL], novIdx["level"])
|
newItem.setText(self.colIndex[nwOutline.LEVEL], novIdx["level"])
|
||||||
newItem.setText(self.colIndex[nwOutline.LABEL], nwItem.itemName)
|
newItem.setText(self.colIndex[nwOutline.LABEL], nwItem.itemName)
|
||||||
newItem.setText(self.colIndex[nwOutline.LINE], sTitle[1:])
|
newItem.setText(self.colIndex[nwOutline.LINE], sTitle[1:].lstrip("0"))
|
||||||
newItem.setText(self.colIndex[nwOutline.SYNOP], novIdx["synopsis"])
|
newItem.setText(self.colIndex[nwOutline.SYNOP], novIdx["synopsis"])
|
||||||
newItem.setText(self.colIndex[nwOutline.CCOUNT], str(novIdx["cCount"]))
|
newItem.setText(self.colIndex[nwOutline.CCOUNT], str(novIdx["cCount"]))
|
||||||
newItem.setText(self.colIndex[nwOutline.WCOUNT], str(novIdx["wCount"]))
|
newItem.setText(self.colIndex[nwOutline.WCOUNT], str(novIdx["wCount"]))
|
||||||
|
|||||||
Reference in New Issue
Block a user