From 758bd16da7829c2bc4c660f6d5bd5b3477ab47d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fauconnier?= Date: Fri, 4 Mar 2022 11:13:56 +0100 Subject: [PATCH] fixed missing calls to reloadThumbnails in some cases --- src/board/UBBoardController.cpp | 7 +++++-- src/document/UBDocumentController.cpp | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/board/UBBoardController.cpp b/src/board/UBBoardController.cpp index 79bbd3ce..306a2028 100644 --- a/src/board/UBBoardController.cpp +++ b/src/board/UBBoardController.cpp @@ -1428,12 +1428,15 @@ UBItem *UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QUrl QStringList fileNames; fileNames << pdfFile.fileName(); result = UBDocumentManager::documentManager()->addFilesToDocument(selectedDocument(), fileNames); - emit documentThumbnailsUpdated(this); pdfFile.close(); } } - if (result){ + if (result) + { + if (UBApplication::documentController->selectedDocument() == selectedDocument()) + UBApplication::documentController->reloadThumbnails(); + selectedDocument()->setMetaData(UBSettings::documentUpdatedAt, UBStringUtils::toUtcIsoDateTime(QDateTime::currentDateTime())); } } diff --git a/src/document/UBDocumentController.cpp b/src/document/UBDocumentController.cpp index 693fbd85..94008f34 100644 --- a/src/document/UBDocumentController.cpp +++ b/src/document/UBDocumentController.cpp @@ -3049,6 +3049,7 @@ bool UBDocumentController::addFileToDocument(UBDocumentProxy* document) { document->setMetaData(UBSettings::documentUpdatedAt, UBStringUtils::toUtcIsoDateTime(QDateTime::currentDateTime())); UBMetadataDcSubsetAdaptor::persist(document); + reloadThumbnails(); } else {