replaced previous workaround on thumbnail views by a fix

preferencesAboutTextFull
Clément Fauconnier 7 years ago
parent a28b58992e
commit 1f9a4858e1
  1. 5
      src/board/UBBoardController.cpp
  2. 3
      src/core/UBPersistenceManager.cpp
  3. 6
      src/gui/UBBoardThumbnailsView.cpp

@ -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()
{ {
updateActionStates(); updateActionStates();
emit pageSelectionChanged(activeSceneIndex()); emit pageSelectionChanged(activeSceneIndex());
emit updateThumbnailsRequired();
} }

@ -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()
} }
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)
{ {
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();
} }

Loading…
Cancel
Save