Clean up unused code and add more comments

This commit is contained in:
Veronica Berglyd Olsen
2022-04-17 18:38:25 +02:00
parent 3f4356467e
commit 4eec2926cb
2 changed files with 6 additions and 10 deletions
-9
View File
@@ -48,15 +48,6 @@ class nwConst():
# END Class nwConst
class nwLists():
"""Lists used for grouping various other constants.
"""
# Item classes which do not require items to have same class
FREE_CLASS = {nwItemClass.ARCHIVE, nwItemClass.TRASH}
# END Class nwLists
class nwRegEx():
FMT_EI = r"(?<![\w\\])(_)(?![\s_])(.+?)(?<![\s\\])(\1)(?!\w)"
+6 -1
View File
@@ -806,15 +806,18 @@ class GuiProjectTree(QTreeWidget):
if allowDrop and not isRoot:
logger.debug("Drag'n'drop of item '%s' accepted", sHandle)
wCount = int(sItem.data(self.C_COUNT, Qt.UserRole))
self.propagateCount(sHandle, 0)
QTreeWidget.dropEvent(self, theEvent)
self._postItemMove(sHandle, wCount)
self._recordLastMove(sItem, pItem, pIndex)
else:
theEvent.ignore()
logger.debug("Drag'n'drop of item '%s' not accepted", sHandle)
theEvent.ignore()
self.theParent.makeAlert(self.tr(
"The item cannot be moved to that location."
), nwAlert.ERROR)
@@ -835,6 +838,8 @@ class GuiProjectTree(QTreeWidget):
logger.error("Failed to find new parent item of '%s'", tHandle)
return False
# Update item parent handle in the project, make sure meta data
# is updated accordingly, and update word count
pHandle = trItemP.data(self.C_NAME, Qt.UserRole)
nwItemS.setParent(pHandle)
self.theProject.projTree.updateItemData(tHandle)