Skip to content

Commit

Permalink
Github Issue #107: Deleted filesnames were not removed from the map o…
Browse files Browse the repository at this point in the history
…f 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.
  • Loading branch information
AngryFender committed Oct 29, 2023
1 parent 591d39d commit 0425b86
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions views_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down

0 comments on commit 0425b86

Please sign in to comment.