-rw-r--r-- | korganizer/journalentry.cpp | 7 | ||||
-rw-r--r-- | korganizer/kojournalview.cpp | 6 | ||||
-rw-r--r-- | korganizer/kojournalview.h | 1 | ||||
-rw-r--r-- | korganizer/koviewmanager.h | 1 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 6 |
5 files changed, 16 insertions, 5 deletions
diff --git a/korganizer/journalentry.cpp b/korganizer/journalentry.cpp index 395392c..3c01eeb 100644 --- a/korganizer/journalentry.cpp +++ b/korganizer/journalentry.cpp @@ -259,9 +259,10 @@ void JournalEntry::writeJournal() mJournal->setDtStart(QDateTime(mDate,QTime(0,0,0))); mCalendar->addJournal(mJournal); } - - mJournal->setDescription(mEditor->text()); - mJournal->setSummary(mTitle->text()); + if ( mJournal->description() != mEditor->text() ) + mJournal->setDescription(mEditor->text()); + if ( mJournal->summary() != mTitle->text() ) + mJournal->setSummary(mTitle->text()); } void JournalEntry::flushEntry() diff --git a/korganizer/kojournalview.cpp b/korganizer/kojournalview.cpp index b659d53..51ae0a0 100644 --- a/korganizer/kojournalview.cpp +++ b/korganizer/kojournalview.cpp @@ -118,7 +118,11 @@ void KOJournalView::updateView() } showDates( mDate, QDate() ); } - +void KOJournalView::checkModified() +{ + qDebug("checkmod "); + flushView(); +} void KOJournalView::flushView() { static bool ff = false; diff --git a/korganizer/kojournalview.h b/korganizer/kojournalview.h index 331bdfa..7fa94ae 100644 --- a/korganizer/kojournalview.h +++ b/korganizer/kojournalview.h @@ -50,6 +50,7 @@ class KOJournalView : public KOrg::BaseView DateList selectedDates() {DateList q; return q;}; + void checkModified(); signals: void deleteJournal(Journal *); public slots: diff --git a/korganizer/koviewmanager.h b/korganizer/koviewmanager.h index d5a8e3b..2e6aaed 100644 --- a/korganizer/koviewmanager.h +++ b/korganizer/koviewmanager.h @@ -77,6 +77,7 @@ class KOViewManager : public QObject QDate currentSelectionDate(); KOAgendaView *agendaView() const { return mAgendaView; } + KOJournalView *journalView() const { return mJournalView; } signals: void printWNV(); diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index d8373a6..fb6d6ec 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp @@ -47,6 +47,7 @@ #include "koviewmanager.h" #include "datenavigator.h" #include "koagendaview.h" +#include "kojournalview.h" #include "koagenda.h" #include "kodialogmanager.h" #include "kdialogbase.h" @@ -1834,7 +1835,8 @@ void MainWindow::saveOnClose() p->mToolBarUpF = filterToolBar->x() > width()/2 ; } #endif - + if ( mView->viewManager()->journalView() ) + mView->viewManager()->journalView()->checkModified(); if ( mCalendarModifiedFlag || mView->checkFileChanged( defaultFileName())) save(); mView->writeSettings(); @@ -1899,6 +1901,8 @@ void MainWindow::backupAllFiles() } void MainWindow::save() { + if ( mView->viewManager()->journalView() ) + mView->viewManager()->journalView()->checkModified(); if ( !mCalendarModifiedFlag ) { qDebug("KO: Calendar not modified. Nothing saved."); return; |