From 76cfee3dc5bad8d83943b1f6860a23b46ae5d23d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fauconnier?= Date: Fri, 21 Jan 2022 10:17:38 +0100 Subject: [PATCH] don't reload thumbnails everytime documentscenechanged is called + reload after duplicate in Board Mode --- src/board/UBBoardController.cpp | 2 +- src/document/UBDocumentController.cpp | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/board/UBBoardController.cpp b/src/board/UBBoardController.cpp index 2401d30a..3d1e4fa3 100644 --- a/src/board/UBBoardController.cpp +++ b/src/board/UBBoardController.cpp @@ -589,8 +589,8 @@ void UBBoardController::duplicateScene(int nIndex) if (UBApplication::documentController->selectedDocument() == selectedDocument()) { UBApplication::documentController->insertThumbPage(nIndex); + UBApplication::documentController->reloadThumbnails(); } - //emit documentThumbnailsUpdated(this); emit addThumbnailRequired(this, nIndex + 1); selectedDocument()->setMetaData(UBSettings::documentUpdatedAt, UBStringUtils::toUtcIsoDateTime(QDateTime::currentDateTime())); diff --git a/src/document/UBDocumentController.cpp b/src/document/UBDocumentController.cpp index de19b90f..a551fed2 100644 --- a/src/document/UBDocumentController.cpp +++ b/src/document/UBDocumentController.cpp @@ -2382,7 +2382,10 @@ void UBDocumentController::duplicateSelectedItem() if (selectedSceneIndexes.count() > 0) { duplicatePages(selectedSceneIndexes); - emit documentThumbnailsUpdated(this); + if (selectedDocument() == selectedDocumentProxy()) + { + reloadThumbnails(); + } selectedDocument()->setMetaData(UBSettings::documentUpdatedAt, UBStringUtils::toUtcIsoDateTime(QDateTime::currentDateTime())); UBMetadataDcSubsetAdaptor::persist(selectedDocument()); int selectedThumbnail = selectedSceneIndexes.last() + selectedSceneIndexes.size(); @@ -3132,11 +3135,6 @@ void UBDocumentController::documentSceneChanged(UBDocumentProxy* proxy, int pSce { Q_UNUSED(pSceneIndex); - if (proxy == selectedDocumentProxy()) - { - reloadThumbnails(); - } - QModelIndexList sel = mDocumentUI->documentTreeView->selectionModel()->selectedRows(0); QModelIndex selection;