don't call documentThumbnailsUpdated every time + set current document to null if it is about to be deleted

preferencesAboutTextFull
Clément Fauconnier 4 years ago
parent dd19e75211
commit 476d8768ee
  1. 10
      src/document/UBDocumentController.cpp

@ -2370,8 +2370,8 @@ void UBDocumentController::deleteMultipleItems(QModelIndexList indexes, UBDocume
for (int i =0; i < indexes.size(); i++) for (int i =0; i < indexes.size(); i++)
{ {
deleteIndexAndAssociatedData(indexes.at(i)); deleteIndexAndAssociatedData(indexes.at(i));
emit documentThumbnailsUpdated(this);
} }
emit documentThumbnailsUpdated(this);
break; break;
} }
case EmptyFolder: case EmptyFolder:
@ -2762,10 +2762,16 @@ void UBDocumentController::deleteIndexAndAssociatedData(const QModelIndex &pInde
} }
//N/C - NNE - 20140408 //N/C - NNE - 20140408
if(pIndex.column() == 0){ if(pIndex.column() == 0)
{
if (docModel->isDocument(pIndex)) { if (docModel->isDocument(pIndex)) {
UBDocumentProxy *proxyData = docModel->proxyData(pIndex); UBDocumentProxy *proxyData = docModel->proxyData(pIndex);
if (selectedDocument() == proxyData)
{
setDocument(nullptr);
}
if (proxyData) { if (proxyData) {
UBPersistenceManager::persistenceManager()->deleteDocument(proxyData); UBPersistenceManager::persistenceManager()->deleteDocument(proxyData);
} }

Loading…
Cancel
Save