From f99e4facab2ca04f71aab0b8a5ffecef13e56d80 Mon Sep 17 00:00:00 2001 From: Olivier Keshavjee Date: Wed, 25 Oct 2017 19:15:30 +0200 Subject: [PATCH] Fixes a bug in #169: when dragging a folder and dropping it between two same folder split panes it is silently deleted --- manuskript/models/outlineModel.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/manuskript/models/outlineModel.py b/manuskript/models/outlineModel.py index 9a4005d9..fc6dbc84 100644 --- a/manuskript/models/outlineModel.py +++ b/manuskript/models/outlineModel.py @@ -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