Fix small Notes glitch when deleting note data

This commit is contained in:
Mark Watkins 2011-12-02 21:48:02 +10:00
parent 4d5d09b5f0
commit fbe75a63b3

View File

@ -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<ChannelID,QVariant>::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);
}