From fbe75a63b3f8a861190e575facf47cf621d0a6bb Mon Sep 17 00:00:00 2001 From: Mark Watkins Date: Fri, 2 Dec 2011 21:48:02 +1000 Subject: [PATCH] Fix small Notes glitch when deleting note data --- daily.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/daily.cpp b/daily.cpp index d7b39252..fe7ca149 100644 --- a/daily.cpp +++ b/daily.cpp @@ -848,7 +848,7 @@ void Daily::Unload(QDate date) bool ok; if (journal) { QString jhtml=ui->JournalNotes->toHtml(); - if ((!journal->settings.contains(Journal_Notes) && !nonotes) || (!nonotes && (journal->settings[Journal_Notes]!=jhtml))) { + if ((!journal->settings.contains(Journal_Notes) && !nonotes) || (journal->settings[Journal_Notes]!=jhtml)) { journal->settings[Journal_Notes]=jhtml; journal->SetChanged(true); } @@ -910,6 +910,12 @@ void Daily::Unload(QDate date) } if (journal) { + if (nonotes) { + QHash::iterator it=journal->settings.find(Journal_Notes); + if (it!=journal->settings.end()) { + journal->settings.erase(it); + } + } Machine *jm=PROFILE.GetMachine(MT_JOURNAL); if (jm) jm->SaveSession(journal); }