diff --git a/src/board/UBBoardController.cpp b/src/board/UBBoardController.cpp index 53f94efb..78afff8b 100644 --- a/src/board/UBBoardController.cpp +++ b/src/board/UBBoardController.cpp @@ -1592,10 +1592,6 @@ void UBBoardController::setActiveDocumentScene(UBDocumentProxy* pDocumentProxy, if (sceneChange) { - //should not be necessary, but no more time to investigate on it for the moment : - //for some reason, certain thumbnail views are not updating except if we load the document twice.... - //the only workaroud I found for the moment.. - emit initThumbnailsRequired(this); emit activeSceneChanged(); } } @@ -1810,6 +1806,7 @@ void UBBoardController::selectionChanged() { updateActionStates(); emit pageSelectionChanged(activeSceneIndex()); + emit updateThumbnailsRequired(); } diff --git a/src/core/UBPersistenceManager.cpp b/src/core/UBPersistenceManager.cpp index e2dc31ea..543853b0 100644 --- a/src/core/UBPersistenceManager.cpp +++ b/src/core/UBPersistenceManager.cpp @@ -179,10 +179,11 @@ void UBPersistenceManager::errorString(QString error) void UBPersistenceManager::onSceneLoaded(QByteArray scene, UBDocumentProxy* proxy, int sceneIndex) { + Q_UNUSED(scene); qDebug() << "scene loaded " << sceneIndex; QTime time; time.start(); - mSceneCache.insert(proxy,sceneIndex,UBSvgSubsetAdaptor::loadScene(proxy,scene)); + mSceneCache.insert(proxy, sceneIndex, loadDocumentScene(proxy, sceneIndex)); qDebug() << "millisecond for sceneCache " << time.elapsed(); } diff --git a/src/gui/UBBoardThumbnailsView.cpp b/src/gui/UBBoardThumbnailsView.cpp index aca126c4..f2e0f23f 100644 --- a/src/gui/UBBoardThumbnailsView.cpp +++ b/src/gui/UBBoardThumbnailsView.cpp @@ -175,6 +175,7 @@ void UBBoardThumbnailsView::updateThumbnailsPos() } scene()->setSceneRect(scene()->itemsBoundingRect()); + update(); } void UBBoardThumbnailsView::resizeEvent(QResizeEvent *event) @@ -312,11 +313,12 @@ void UBBoardThumbnailsView::dropEvent(QDropEvent *event) { Q_UNUSED(event); - UBApplication::boardController->moveSceneToIndex(mDropSource->sceneIndex(), mDropTarget->sceneIndex()); + if (mDropSource->sceneIndex() != mDropTarget->sceneIndex()) + UBApplication::boardController->moveSceneToIndex(mDropSource->sceneIndex(), mDropTarget->sceneIndex()); mDropSource = NULL; mDropTarget = NULL; mDropBar->hide(); - update(); + updateThumbnailsPos(); }