improved thumbnails reloading (fixes somes cases and is more respectful of reponsibility)

preferencesAboutTextFull
Clément Fauconnier 3 years ago
parent 88129a048b
commit 836f0f2705
  1. 2
      src/core/UBDocumentManager.cpp
  2. 14
      src/document/UBDocumentController.cpp

@ -286,8 +286,6 @@ int UBDocumentManager::addFilesToDocument(UBDocumentProxy* document, QStringList
UBGraphicsScene* scene = UBPersistenceManager::persistenceManager()->createDocumentSceneAt(document, pageIndex);
importAdaptor->placeImportedItemToScene(scene, page);
UBPersistenceManager::persistenceManager()->persistDocumentScene(document, scene, pageIndex);
if (UBApplication::documentController->selectedDocument() == UBApplication::boardController->selectedDocument())
UBApplication::boardController->insertThumbPage(pageIndex);
}
UBPersistenceManager::persistenceManager()->persistDocumentMetadata(document);

@ -2393,10 +2393,13 @@ void UBDocumentController::duplicateSelectedItem()
int sceneCount = selectedSceneIndexes.count();
showMessage(tr("duplicated %1 page","duplicated %1 pages",sceneCount).arg(sceneCount), false);
if (selectedDocument() == mBoardController->selectedDocument())
{
mBoardController->setActiveDocumentScene(selectedThumbnail);
mBoardController->reloadThumbnails();
}
}
}
else
{
UBDocumentTreeModel *docModel = UBPersistenceManager::persistenceManager()->mDocumentTreeStructureModel;
@ -2999,6 +3002,8 @@ void UBDocumentController::addFolderOfImages()
document->setMetaData(UBSettings::documentUpdatedAt, UBStringUtils::toUtcIsoDateTime(QDateTime::currentDateTime()));
UBMetadataDcSubsetAdaptor::persist(document);
reloadThumbnails();
if (selectedDocument() == UBApplication::boardController->selectedDocument())
UBApplication::boardController->reloadThumbnails();
}
}
}
@ -3012,11 +3017,6 @@ void UBDocumentController::addFileToDocument()
if (document)
{
addFileToDocument(document);
reloadThumbnails();
if (UBApplication::boardController->selectedDocument() == selectedDocument())
{
UBApplication::boardController->reloadThumbnails();
}
}
}
@ -3050,6 +3050,8 @@ bool UBDocumentController::addFileToDocument(UBDocumentProxy* document)
document->setMetaData(UBSettings::documentUpdatedAt, UBStringUtils::toUtcIsoDateTime(QDateTime::currentDateTime()));
UBMetadataDcSubsetAdaptor::persist(document);
reloadThumbnails();
if (selectedDocument() == UBApplication::boardController->selectedDocument())
UBApplication::boardController->reloadThumbnails();
}
else
{
@ -3328,6 +3330,8 @@ void UBDocumentController::addImages()
document->setMetaData(UBSettings::documentUpdatedAt, UBStringUtils::toUtcIsoDateTime(QDateTime::currentDateTime()));
UBMetadataDcSubsetAdaptor::persist(document);
reloadThumbnails();
if (selectedDocument() == UBApplication::boardController->selectedDocument())
UBApplication::boardController->reloadThumbnails();
}
}
}

Loading…
Cancel
Save