From b8ff50297ecee7800d997c38beef4355a1f3d880 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fauconnier?= Date: Wed, 6 Apr 2022 12:34:46 +0200 Subject: [PATCH] update thumbnails when a page is dropped in its own document + don't call treeviewselectionChanged if dropped a page as it will not change treeview --- src/document/UBDocumentController.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/document/UBDocumentController.cpp b/src/document/UBDocumentController.cpp index db095b51..f2b7c477 100644 --- a/src/document/UBDocumentController.cpp +++ b/src/document/UBDocumentController.cpp @@ -1558,8 +1558,11 @@ void UBDocumentTreeView::dropEvent(QDropEvent *event) Q_ASSERT(QFileInfo(thumbTo).exists()); auto pix = std::make_shared(thumbTmp); - UBDocumentController *ctrl = UBApplication::documentController; - ctrl->addPixmapAt(pix, toIndex); + UBApplication::documentController->insertExistingThumbPage(toIndex, pix); + if (UBApplication::documentController->selectedDocument() == targetDocProxy) + { + UBApplication::documentController->reloadThumbnails(); + } if (UBApplication::boardController->selectedDocument() == targetDocProxy) { UBApplication::boardController->insertThumbPage(toIndex); @@ -1572,8 +1575,6 @@ void UBDocumentTreeView::dropEvent(QDropEvent *event) } UBApplication::applicationController->showMessage(tr("%1 pages copied", "", total).arg(total), false); - UBApplication::documentController->TreeViewSelectionChanged(UBApplication::documentController->firstSelectedTreeIndex(), QModelIndex()); - } else {