Fixed alert for orphaned items, and fixed setting item depth.
This commit is contained in:
@@ -292,6 +292,7 @@ class GuiDocTree(QTreeWidget):
|
|||||||
return
|
return
|
||||||
pHandle = trItemP.text(self.C_HANDLE)
|
pHandle = trItemP.text(self.C_HANDLE)
|
||||||
nwItemS.setParent(pHandle)
|
nwItemS.setParent(pHandle)
|
||||||
|
nwItemS.setDepth(self.theProject.countItemDepth(tHandle))
|
||||||
self.setTreeItemValues(tHandle)
|
self.setTreeItemValues(tHandle)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
@@ -345,7 +345,7 @@ class NWProject():
|
|||||||
|
|
||||||
# Report status
|
# Report status
|
||||||
if len(orphanFiles) > 0:
|
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:
|
else:
|
||||||
logger.verbose("File check OK")
|
logger.verbose("File check OK")
|
||||||
return
|
return
|
||||||
@@ -363,7 +363,7 @@ class NWProject():
|
|||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
def _countItemDepth(self, tHandle):
|
def countItemDepth(self, tHandle):
|
||||||
theDepth = 0
|
theDepth = 0
|
||||||
nwItem = self.getItem(tHandle)
|
nwItem = self.getItem(tHandle)
|
||||||
while nwItem.parHandle is not None:
|
while nwItem.parHandle is not None:
|
||||||
@@ -390,7 +390,7 @@ class NWProject():
|
|||||||
logger.verbose("Entry %s is a root item" % str(tHandle))
|
logger.verbose("Entry %s is a root item" % str(tHandle))
|
||||||
self.treeRoots.append(tHandle)
|
self.treeRoots.append(tHandle)
|
||||||
|
|
||||||
itemDepth = self._countItemDepth(tHandle)
|
itemDepth = self.countItemDepth(tHandle)
|
||||||
if itemDepth is None:
|
if itemDepth is None:
|
||||||
logger.error("The depth of entry %s could not be determined" % tHandle)
|
logger.error("The depth of entry %s could not be determined" % tHandle)
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<?xml version='1.0' encoding='utf-8'?>
|
<?xml version='1.0' encoding='utf-8'?>
|
||||||
<novelWriterXML appVersion="0.0.1" fileVersion="1.0" timeStamp="2019-05-03 22:26:20">
|
<novelWriterXML appVersion="0.0.1" fileVersion="1.0" timeStamp="2019-05-04 11:53:50">
|
||||||
<project>
|
<project>
|
||||||
<name>Sample Project</name>
|
<name>Sample Project</name>
|
||||||
<title>Sample Project</title>
|
<title>Sample Project</title>
|
||||||
@@ -47,7 +47,7 @@
|
|||||||
<children>False</children>
|
<children>False</children>
|
||||||
<expanded>False</expanded>
|
<expanded>False</expanded>
|
||||||
<layout>SCENE</layout>
|
<layout>SCENE</layout>
|
||||||
<charCount>2575</charCount>
|
<charCount>2571</charCount>
|
||||||
<wordCount>377</wordCount>
|
<wordCount>377</wordCount>
|
||||||
<paraCount>5</paraCount>
|
<paraCount>5</paraCount>
|
||||||
</item>
|
</item>
|
||||||
@@ -69,7 +69,7 @@
|
|||||||
<type>FILE</type>
|
<type>FILE</type>
|
||||||
<class>NOVEL</class>
|
<class>NOVEL</class>
|
||||||
<status>0</status>
|
<status>0</status>
|
||||||
<depth>1</depth>
|
<depth>2</depth>
|
||||||
<children>False</children>
|
<children>False</children>
|
||||||
<expanded>False</expanded>
|
<expanded>False</expanded>
|
||||||
<layout>SCENE</layout>
|
<layout>SCENE</layout>
|
||||||
@@ -92,7 +92,7 @@
|
|||||||
<class>CHARACTER</class>
|
<class>CHARACTER</class>
|
||||||
<status>0</status>
|
<status>0</status>
|
||||||
<depth>1</depth>
|
<depth>1</depth>
|
||||||
<children>False</children>
|
<children>True</children>
|
||||||
<expanded>True</expanded>
|
<expanded>True</expanded>
|
||||||
</item>
|
</item>
|
||||||
<item handle="14298de4d9524" order="0" parent="f7e2d9f330615">
|
<item handle="14298de4d9524" order="0" parent="f7e2d9f330615">
|
||||||
@@ -100,7 +100,7 @@
|
|||||||
<type>FILE</type>
|
<type>FILE</type>
|
||||||
<class>CHARACTER</class>
|
<class>CHARACTER</class>
|
||||||
<status>0</status>
|
<status>0</status>
|
||||||
<depth>1</depth>
|
<depth>2</depth>
|
||||||
<children>False</children>
|
<children>False</children>
|
||||||
<expanded>False</expanded>
|
<expanded>False</expanded>
|
||||||
<layout>NOTE</layout>
|
<layout>NOTE</layout>
|
||||||
@@ -113,7 +113,7 @@
|
|||||||
<type>FILE</type>
|
<type>FILE</type>
|
||||||
<class>CHARACTER</class>
|
<class>CHARACTER</class>
|
||||||
<status>0</status>
|
<status>0</status>
|
||||||
<depth>1</depth>
|
<depth>2</depth>
|
||||||
<children>False</children>
|
<children>False</children>
|
||||||
<expanded>False</expanded>
|
<expanded>False</expanded>
|
||||||
<layout>NOTE</layout>
|
<layout>NOTE</layout>
|
||||||
|
|||||||
Reference in New Issue
Block a user