Fixes a bug in #169: when dragging a folder and dropping it between two same folder split panes it is silently deleted

This commit is contained in:
Olivier Keshavjee 2017-10-25 19:15:30 +02:00
parent 761286c497
commit f99e4facab

View file

@ -309,6 +309,13 @@ class outlineModel(QAbstractItemModel):
if action == Qt.IgnoreAction:
return True # What is that?
# Strangely, on some cases, we get a call to dropMimeData though
# self.canDropMimeData returned False.
# See https://github.com/olivierkes/manuskript/issues/169 to reproduce.
# So we double check for safety.
if not self.canDropMimeData(data, action, row, column, parent):
return False
items = self.decodeMimeData(data)
if items is None:
return False