Clean up unused code and add more comments
This commit is contained in:
@@ -48,15 +48,6 @@ class nwConst():
|
|||||||
# END 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():
|
class nwRegEx():
|
||||||
|
|
||||||
FMT_EI = r"(?<![\w\\])(_)(?![\s_])(.+?)(?<![\s\\])(\1)(?!\w)"
|
FMT_EI = r"(?<![\w\\])(_)(?![\s_])(.+?)(?<![\s\\])(\1)(?!\w)"
|
||||||
|
|||||||
@@ -806,15 +806,18 @@ class GuiProjectTree(QTreeWidget):
|
|||||||
|
|
||||||
if allowDrop and not isRoot:
|
if allowDrop and not isRoot:
|
||||||
logger.debug("Drag'n'drop of item '%s' accepted", sHandle)
|
logger.debug("Drag'n'drop of item '%s' accepted", sHandle)
|
||||||
|
|
||||||
wCount = int(sItem.data(self.C_COUNT, Qt.UserRole))
|
wCount = int(sItem.data(self.C_COUNT, Qt.UserRole))
|
||||||
self.propagateCount(sHandle, 0)
|
self.propagateCount(sHandle, 0)
|
||||||
|
|
||||||
QTreeWidget.dropEvent(self, theEvent)
|
QTreeWidget.dropEvent(self, theEvent)
|
||||||
self._postItemMove(sHandle, wCount)
|
self._postItemMove(sHandle, wCount)
|
||||||
self._recordLastMove(sItem, pItem, pIndex)
|
self._recordLastMove(sItem, pItem, pIndex)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
theEvent.ignore()
|
|
||||||
logger.debug("Drag'n'drop of item '%s' not accepted", sHandle)
|
logger.debug("Drag'n'drop of item '%s' not accepted", sHandle)
|
||||||
|
|
||||||
|
theEvent.ignore()
|
||||||
self.theParent.makeAlert(self.tr(
|
self.theParent.makeAlert(self.tr(
|
||||||
"The item cannot be moved to that location."
|
"The item cannot be moved to that location."
|
||||||
), nwAlert.ERROR)
|
), nwAlert.ERROR)
|
||||||
@@ -835,6 +838,8 @@ class GuiProjectTree(QTreeWidget):
|
|||||||
logger.error("Failed to find new parent item of '%s'", tHandle)
|
logger.error("Failed to find new parent item of '%s'", tHandle)
|
||||||
return False
|
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)
|
pHandle = trItemP.data(self.C_NAME, Qt.UserRole)
|
||||||
nwItemS.setParent(pHandle)
|
nwItemS.setParent(pHandle)
|
||||||
self.theProject.projTree.updateItemData(tHandle)
|
self.theProject.projTree.updateItemData(tHandle)
|
||||||
|
|||||||
Reference in New Issue
Block a user