Merge branch 'main' into multi_root

This commit is contained in:
Veronica Berglyd Olsen
2022-04-03 22:53:45 +02:00
29 changed files with 481 additions and 419 deletions
+7 -7
View File
@@ -46,7 +46,7 @@ from novelwriter.common import (
checkString, checkBool, checkInt, isHandle, formatTimeStamp,
makeFileNameSafe, hexToInt
)
from novelwriter.constants import trConst, nwFiles, nwLabels
from novelwriter.constants import nwLists, trConst, nwFiles, nwLabels
logger = logging.getLogger(__name__)
@@ -1077,7 +1077,7 @@ class NWProject():
"""
replaceMap = self.statusItems.setNewEntries(newCols)
for nwItem in self.projTree:
if nwItem.itemClass == nwItemClass.NOVEL:
if nwItem.itemClass in nwLists.CLS_NOVEL:
if nwItem.itemStatus in replaceMap:
nwItem.setStatus(replaceMap[nwItem.itemStatus])
self.setProjectChanged(True)
@@ -1089,9 +1089,9 @@ class NWProject():
"""
replaceMap = self.importItems.setNewEntries(newCols)
for nwItem in self.projTree:
if nwItem.itemClass != nwItemClass.NOVEL:
if nwItem.itemStatus in replaceMap:
nwItem.setStatus(replaceMap[nwItem.itemStatus])
if nwItem.itemClass not in nwLists.CLS_NOVEL:
if nwItem.itemImport in replaceMap:
nwItem.setImport(replaceMap[nwItem.itemImport])
self.setProjectChanged(True)
return True
@@ -1212,10 +1212,10 @@ class NWProject():
self.statusItems.resetCounts()
self.importItems.resetCounts()
for nwItem in self.projTree:
if nwItem.itemClass == nwItemClass.NOVEL:
if nwItem.itemClass in nwLists.CLS_NOVEL:
self.statusItems.countEntry(nwItem.itemStatus)
else:
self.importItems.countEntry(nwItem.itemStatus)
self.importItems.countEntry(nwItem.itemImport)
return
def localLookup(self, theWord):