fixed an issue where mSelectedThumbnail could become inconsistent + fixed an issue where a blank page would be added while importing the same document again and again

preferencesAboutTextFull
Clément Fauconnier 3 years ago
parent e45255efc3
commit 6504c42e75
  1. 5
      src/core/UBPersistenceManager.cpp
  2. 1
      src/document/UBDocumentContainer.cpp
  3. 13
      src/document/UBDocumentController.cpp
  4. 4
      src/gui/UBDocumentNavigator.cpp

@ -238,7 +238,10 @@ QDialog::DialogCode UBPersistenceManager::processInteractiveReplacementDialog(UB
if (mDocumentTreeStructureModel->currentIndex() == replaceIndex)
{
UBApplication::documentController->selectDocument(pProxy, true, true);
if (pProxy->pageCount() > 0)
{
UBApplication::documentController->selectDocument(pProxy, true, true);
}
}
if (replaceProxy) {

@ -49,7 +49,6 @@ void UBDocumentContainer::setDocument(UBDocumentProxy* document, bool forceReloa
{
mCurrentDocument = document;
//qDebug() << documentThumbs();
clearThumbPage();
reloadThumbnails();
emit documentSet(mCurrentDocument);

@ -1854,12 +1854,15 @@ void UBDocumentController::selectDocument(UBDocumentProxy* proxy, bool setAsCurr
if (setAsCurrentDocument) {
UBPersistenceManager::persistenceManager()->mDocumentTreeStructureModel->setCurrentDocument(proxy);
QModelIndex indexCurrentDoc = UBPersistenceManager::persistenceManager()->mDocumentTreeStructureModel->indexForProxy(proxy);
mDocumentUI->documentTreeView->setSelectedAndExpanded(indexCurrentDoc, true, editMode);
if (proxy != mBoardController->selectedDocument()) // only if wanted Document is different from document actually on Board, // ALTI/AOU - 20140217
if (indexCurrentDoc.isValid())
{
//issue 1629 - NNE - 20131105 : When set a current document, change in the board controller
mBoardController->setActiveDocumentScene(proxy, 0, true, onImport);
mDocumentUI->documentTreeView->setSelectedAndExpanded(indexCurrentDoc, true, editMode);
if (proxy != mBoardController->selectedDocument()) // only if wanted Document is different from document actually on Board, // ALTI/AOU - 20140217
{
//issue 1629 - NNE - 20131105 : When set a current document, change in the board controller
mBoardController->setActiveDocumentScene(proxy, 0, true, onImport);
}
}
}

@ -224,6 +224,8 @@ void UBDocumentNavigator::updateSpecificThumbnail(int iPage)
mThumbsWithLabels[iPage].setThumbnail(newItem);
if (mLastClickedThumbnail == oldItem)
mLastClickedThumbnail = newItem;
if (mSelectedThumbnail == oldItem)
mSelectedThumbnail = newItem;
delete oldItem;
oldItem = NULL;
}
@ -317,7 +319,7 @@ void UBDocumentNavigator::resizeEvent(QResizeEvent *event)
mThumbnailWidth = (width() > mThumbnailMinWidth) ? width() - 2*border() : mThumbnailMinWidth;
if(mSelectedThumbnail)
ensureVisible(mSelectedThumbnail);
ensureVisible(mSelectedThumbnail);
// Refresh the scene
refreshScene();

Loading…
Cancel
Save