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. 3
      src/core/UBPersistenceManager.cpp
  2. 1
      src/document/UBDocumentContainer.cpp
  3. 3
      src/document/UBDocumentController.cpp
  4. 2
      src/gui/UBDocumentNavigator.cpp

@ -237,9 +237,12 @@ QDialog::DialogCode UBPersistenceManager::processInteractiveReplacementDialog(UB
UBDocumentProxy *replaceProxy = mDocumentTreeStructureModel->proxyData(replaceIndex);
if (mDocumentTreeStructureModel->currentIndex() == replaceIndex)
{
if (pProxy->pageCount() > 0)
{
UBApplication::documentController->selectDocument(pProxy, true, true);
}
}
if (replaceProxy) {
deleteDocument(replaceProxy);

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

@ -1854,6 +1854,8 @@ void UBDocumentController::selectDocument(UBDocumentProxy* proxy, bool setAsCurr
if (setAsCurrentDocument) {
UBPersistenceManager::persistenceManager()->mDocumentTreeStructureModel->setCurrentDocument(proxy);
QModelIndex indexCurrentDoc = UBPersistenceManager::persistenceManager()->mDocumentTreeStructureModel->indexForProxy(proxy);
if (indexCurrentDoc.isValid())
{
mDocumentUI->documentTreeView->setSelectedAndExpanded(indexCurrentDoc, true, editMode);
if (proxy != mBoardController->selectedDocument()) // only if wanted Document is different from document actually on Board, // ALTI/AOU - 20140217
@ -1862,6 +1864,7 @@ void UBDocumentController::selectDocument(UBDocumentProxy* proxy, bool setAsCurr
mBoardController->setActiveDocumentScene(proxy, 0, true, onImport);
}
}
}
mSelectionType = Document;
setDocument(proxy);

@ -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;
}

Loading…
Cancel
Save