From 0425b8613fcde47f529a57f72d3d1b6a8830dcba Mon Sep 17 00:00:00 2001 From: AngryFender Date: Sun, 29 Oct 2023 01:27:52 +0100 Subject: [PATCH] Github Issue #107: Deleted filesnames were not removed from the map of MkTextDocument. This meant MkTextDocument objects still existed when even their respective files were already deleted. Now those all those documents from the map are removed properly. --- views_handler.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/views_handler.cpp b/views_handler.cpp index f7ee4be..af3b21f 100644 --- a/views_handler.cpp +++ b/views_handler.cpp @@ -396,8 +396,15 @@ void ViewsHandler::fileDeleteDialogue(QModelIndex &index) currentFilePath.replace(vaultPath, ""); } emit fileDeletePath(currentFilePath); + viewTitle->setText("Startup Tips"); + currentDocument = recentFileDocumentMap.value("startup"); currentDocument->setPlainText(startupText); + highlighter.setDocument(currentDocument.data()); + viewText->setDocument(currentDocument.data()); + + const QString filePath = info.absoluteFilePath(); + recentFileDocumentMap.remove(filePath); } }