From 50b1b3af8a4e7a56de51664a7f297ff6bea31890 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fauconnier?= Date: Wed, 3 Nov 2021 10:29:37 +0100 Subject: [PATCH 1/2] don't reload thumbnails every time a thumbnail is added --- src/document/UBDocumentContainer.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/document/UBDocumentContainer.cpp b/src/document/UBDocumentContainer.cpp index 456c37a7..481a415a 100644 --- a/src/document/UBDocumentContainer.cpp +++ b/src/document/UBDocumentContainer.cpp @@ -106,7 +106,6 @@ void UBDocumentContainer::addPage(int index) void UBDocumentContainer::addPixmapAt(const QPixmap *pix, int index) { mDocumentThumbs.insert(index, pix); - emit documentThumbnailsUpdated(this); } From d8c9ebf46f6c685139ef74b854c01a33f26897a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fauconnier?= Date: Wed, 3 Nov 2021 10:30:48 +0100 Subject: [PATCH 2/2] call treeViewSelectionChanged just once --- src/document/UBDocumentController.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/document/UBDocumentController.cpp b/src/document/UBDocumentController.cpp index dffa1be2..fbd1e03c 100644 --- a/src/document/UBDocumentController.cpp +++ b/src/document/UBDocumentController.cpp @@ -1548,7 +1548,6 @@ void UBDocumentTreeView::dropEvent(QDropEvent *event) const QPixmap *pix = new QPixmap(thumbTmp); UBDocumentController *ctrl = UBApplication::documentController; ctrl->addPixmapAt(pix, toIndex); - ctrl->TreeViewSelectionChanged(ctrl->firstSelectedTreeIndex(), QModelIndex()); } QApplication::restoreOverrideCursor(); @@ -1557,6 +1556,8 @@ void UBDocumentTreeView::dropEvent(QDropEvent *event) docModel->setHighLighted(QModelIndex()); } + UBApplication::documentController->TreeViewSelectionChanged(UBApplication::documentController->firstSelectedTreeIndex(), QModelIndex()); + } else {