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