From afb5b65458d9173f35cb811a5e61b9c62a2f0e69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fauconnier?= Date: Mon, 10 Dec 2018 11:11:44 +0100 Subject: [PATCH] don't move indexes if we're moving an document's page --- src/document/UBDocumentController.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/document/UBDocumentController.cpp b/src/document/UBDocumentController.cpp index 206ae201..8d458bc1 100644 --- a/src/document/UBDocumentController.cpp +++ b/src/document/UBDocumentController.cpp @@ -1451,15 +1451,17 @@ void UBDocumentTreeView::dropEvent(QDropEvent *event) docModel->setHighLighted(QModelIndex()); } - - if(targetIsInTrash) + else { - if (!UBApplication::mainWindow->yesNoQuestion(tr("Remove Item"), tr("Are you sure you want to remove the selected item(s) ?"))) - return; + if(targetIsInTrash) + { + if (!UBApplication::mainWindow->yesNoQuestion(tr("Remove Item"), tr("Are you sure you want to remove the selected item(s) ?"))) + return; - UBApplication::documentController->moveIndexesToTrash(dropIndex, docModel); - }else{ - docModel->moveIndexes(dropIndex, targetIndex); + UBApplication::documentController->moveIndexesToTrash(dropIndex, docModel); + }else{ + docModel->moveIndexes(dropIndex, targetIndex); + } } expand(proxy->mapFromSource(targetIndex));