Commit 1f9a4858 authored by Clément Fauconnier's avatar Clément Fauconnier

replaced previous workaround on thumbnail views by a fix

No related merge requests found
...@@ -1592,10 +1592,6 @@ void UBBoardController::setActiveDocumentScene(UBDocumentProxy* pDocumentProxy, ...@@ -1592,10 +1592,6 @@ void UBBoardController::setActiveDocumentScene(UBDocumentProxy* pDocumentProxy,
if (sceneChange) 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(); emit activeSceneChanged();
} }
} }
...@@ -1810,6 +1806,7 @@ void UBBoardController::selectionChanged() ...@@ -1810,6 +1806,7 @@ void UBBoardController::selectionChanged()
{ {
updateActionStates(); updateActionStates();
emit pageSelectionChanged(activeSceneIndex()); emit pageSelectionChanged(activeSceneIndex());
emit updateThumbnailsRequired();
} }
......
...@@ -179,10 +179,11 @@ void UBPersistenceManager::errorString(QString error) ...@@ -179,10 +179,11 @@ void UBPersistenceManager::errorString(QString error)
void UBPersistenceManager::onSceneLoaded(QByteArray scene, UBDocumentProxy* proxy, int sceneIndex) void UBPersistenceManager::onSceneLoaded(QByteArray scene, UBDocumentProxy* proxy, int sceneIndex)
{ {
Q_UNUSED(scene);
qDebug() << "scene loaded " << sceneIndex; qDebug() << "scene loaded " << sceneIndex;
QTime time; QTime time;
time.start(); time.start();
mSceneCache.insert(proxy,sceneIndex,UBSvgSubsetAdaptor::loadScene(proxy,scene)); mSceneCache.insert(proxy, sceneIndex, loadDocumentScene(proxy, sceneIndex));
qDebug() << "millisecond for sceneCache " << time.elapsed(); qDebug() << "millisecond for sceneCache " << time.elapsed();
} }
......
...@@ -175,6 +175,7 @@ void UBBoardThumbnailsView::updateThumbnailsPos() ...@@ -175,6 +175,7 @@ void UBBoardThumbnailsView::updateThumbnailsPos()
} }
scene()->setSceneRect(scene()->itemsBoundingRect()); scene()->setSceneRect(scene()->itemsBoundingRect());
update();
} }
void UBBoardThumbnailsView::resizeEvent(QResizeEvent *event) void UBBoardThumbnailsView::resizeEvent(QResizeEvent *event)
...@@ -312,11 +313,12 @@ void UBBoardThumbnailsView::dropEvent(QDropEvent *event) ...@@ -312,11 +313,12 @@ void UBBoardThumbnailsView::dropEvent(QDropEvent *event)
{ {
Q_UNUSED(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; mDropSource = NULL;
mDropTarget = NULL; mDropTarget = NULL;
mDropBar->hide(); mDropBar->hide();
update(); updateThumbnailsPos();
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment