Restructure the record of root items in the tree class
This commit is contained in:
@@ -608,6 +608,7 @@ class NWProject():
|
||||
self.theParent.setStatus(self.tr("Opened Project: {0}").format(self.projName))
|
||||
|
||||
self._scanProjectFolder()
|
||||
self._checkProjectTree()
|
||||
self._loadProjectLocalisation()
|
||||
self.updateWordCounts()
|
||||
|
||||
@@ -1340,6 +1341,17 @@ class NWProject():
|
||||
xEntry.text = aValue
|
||||
return
|
||||
|
||||
def _checkProjectTree(self):
|
||||
"""Check the project tree and make sure all items have sensible
|
||||
values.
|
||||
"""
|
||||
for tItem in self.projTree:
|
||||
tHandle = tItem.itemHandle
|
||||
logger.verbose("Checking item '%s'", tHandle)
|
||||
if tItem.itemRoot is None:
|
||||
self.projTree.updateItemRoot(tHandle)
|
||||
logger.warning("Corrected the root setting of item '%s'", tHandle)
|
||||
|
||||
def _scanProjectFolder(self):
|
||||
"""Scan the project folder and check that the files in it are
|
||||
also in the project XML file. If they aren't, import them as
|
||||
|
||||
Reference in New Issue
Block a user