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); UBDocumentProxy *replaceProxy = mDocumentTreeStructureModel->proxyData(replaceIndex);
if (mDocumentTreeStructureModel->currentIndex() == replaceIndex) if (mDocumentTreeStructureModel->currentIndex() == replaceIndex)
{
if (pProxy->pageCount() > 0)
{ {
UBApplication::documentController->selectDocument(pProxy, true, true); UBApplication::documentController->selectDocument(pProxy, true, true);
} }
}
if (replaceProxy) { if (replaceProxy) {
deleteDocument(replaceProxy); deleteDocument(replaceProxy);

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

@ -1854,6 +1854,8 @@ void UBDocumentController::selectDocument(UBDocumentProxy* proxy, bool setAsCurr
if (setAsCurrentDocument) { if (setAsCurrentDocument) {
UBPersistenceManager::persistenceManager()->mDocumentTreeStructureModel->setCurrentDocument(proxy); UBPersistenceManager::persistenceManager()->mDocumentTreeStructureModel->setCurrentDocument(proxy);
QModelIndex indexCurrentDoc = UBPersistenceManager::persistenceManager()->mDocumentTreeStructureModel->indexForProxy(proxy); QModelIndex indexCurrentDoc = UBPersistenceManager::persistenceManager()->mDocumentTreeStructureModel->indexForProxy(proxy);
if (indexCurrentDoc.isValid())
{
mDocumentUI->documentTreeView->setSelectedAndExpanded(indexCurrentDoc, true, editMode); 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 (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); mBoardController->setActiveDocumentScene(proxy, 0, true, onImport);
} }
} }
}
mSelectionType = Document; mSelectionType = Document;
setDocument(proxy); setDocument(proxy);

@ -224,6 +224,8 @@ void UBDocumentNavigator::updateSpecificThumbnail(int iPage)
mThumbsWithLabels[iPage].setThumbnail(newItem); mThumbsWithLabels[iPage].setThumbnail(newItem);
if (mLastClickedThumbnail == oldItem) if (mLastClickedThumbnail == oldItem)
mLastClickedThumbnail = newItem; mLastClickedThumbnail = newItem;
if (mSelectedThumbnail == oldItem)
mSelectedThumbnail = newItem;
delete oldItem; delete oldItem;
oldItem = NULL; oldItem = NULL;
} }

Loading…
Cancel
Save