Fixed alert for orphaned items, and fixed setting item depth.

This commit is contained in:
Veronica K. B. Olsen
2019-05-04 11:54:24 +02:00
parent 92da5a335b
commit 6331125b0c
3 changed files with 10 additions and 9 deletions
+1
View File
@@ -292,6 +292,7 @@ class GuiDocTree(QTreeWidget):
return
pHandle = trItemP.text(self.C_HANDLE)
nwItemS.setParent(pHandle)
nwItemS.setDepth(self.theProject.countItemDepth(tHandle))
self.setTreeItemValues(tHandle)
return
+3 -3
View File
@@ -345,7 +345,7 @@ class NWProject():
# Report status
if len(orphanFiles) > 0:
logger.warning("Found %d orphaned file(s) in project folder!" % len(orphanFiles))
self.theParent.makeAlert("Found %d orphaned file(s) in project folder!" % len(orphanFiles),1)
else:
logger.verbose("File check OK")
return
@@ -363,7 +363,7 @@ class NWProject():
return
def _countItemDepth(self, tHandle):
def countItemDepth(self, tHandle):
theDepth = 0
nwItem = self.getItem(tHandle)
while nwItem.parHandle is not None:
@@ -390,7 +390,7 @@ class NWProject():
logger.verbose("Entry %s is a root item" % str(tHandle))
self.treeRoots.append(tHandle)
itemDepth = self._countItemDepth(tHandle)
itemDepth = self.countItemDepth(tHandle)
if itemDepth is None:
logger.error("The depth of entry %s could not be determined" % tHandle)
else: