Fixed some potential issues with getting the trash folder handle, and made some minor improvements to index class methods

This commit is contained in:
Veronica K. B. Olsen
2020-09-30 21:50:59 +02:00
parent d382e70d72
commit 6fc5dad938
3 changed files with 27 additions and 28 deletions
+2 -2
View File
@@ -209,7 +209,7 @@ class GuiProjectTree(QTreeWidget):
)
return False
if pHandle == self.theProject.projTree.trashRoot():
if self.theProject.projTree.isTrashRoot(pHandle):
self.makeAlert(
"Cannot add new files or folders to the %s folder." % (
nwLabels.CLASS_NAME[nwItemClass.TRASH]
@@ -411,7 +411,7 @@ class GuiProjectTree(QTreeWidget):
return False
pHandle = nwItemS.parHandle
if pHandle is not None and pHandle == self.theProject.projTree.trashRoot():
if self.theProject.projTree.isTrashRoot(pHandle):
# If the file is in the trash folder already, as the
# user if they want to permanently delete the file.
doPermanent = False