author | zautrix <zautrix> | 2005-06-30 06:47:32 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-06-30 06:47:32 (UTC) |
commit | 0e4ec4bb2a13a89d3d6145ea076a5734481cb252 (patch) (side-by-side diff) | |
tree | fecf6ecb38a726323fb9522eaae1764930ec49cf | |
parent | 0fc571a7eadda739fd1a93d627e7129b9956c9f6 (diff) | |
download | kdepimpi-0e4ec4bb2a13a89d3d6145ea076a5734481cb252.zip kdepimpi-0e4ec4bb2a13a89d3d6145ea076a5734481cb252.tar.gz kdepimpi-0e4ec4bb2a13a89d3d6145ea076a5734481cb252.tar.bz2 |
fixixix
-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 @@ -250,26 +250,27 @@ void JournalEntry::writeJournal() KOPrefs::instance()->mConfirm = conf; } return; } // kdDebug() << "JournalEntry::writeJournal()..." << endl; if (!mJournal) { mJournal = new Journal; 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() { writeJournal(); } void JournalEntry::keyPressEvent ( QKeyEvent * e ) { e->ignore(); } diff --git a/korganizer/kojournalview.cpp b/korganizer/kojournalview.cpp index b659d53..51ae0a0 100644 --- a/korganizer/kojournalview.cpp +++ b/korganizer/kojournalview.cpp @@ -109,25 +109,29 @@ void KOJournalView::updateConfig() mEntry = jEntries.next(); } } void KOJournalView::updateView() { JournalEntry* mEntry = jEntries.first(); while ( mEntry ) { mEntry->setFont ( KOPrefs::instance()->mJornalViewFont ); mEntry = jEntries.next(); } showDates( mDate, QDate() ); } - +void KOJournalView::checkModified() +{ + qDebug("checkmod "); + flushView(); +} void KOJournalView::flushView() { static bool ff = false; if ( ff ) return; ff = true; JournalEntry* mEntry = jEntries.first(); while ( mEntry ) { mEntry->flushEntry(); mEntry = jEntries.next(); } ff = false; } diff --git a/korganizer/kojournalview.h b/korganizer/kojournalview.h index 331bdfa..7fa94ae 100644 --- a/korganizer/kojournalview.h +++ b/korganizer/kojournalview.h @@ -41,24 +41,25 @@ class KOJournalView : public KOrg::BaseView Q_OBJECT public: KOJournalView(Calendar *calendar, QWidget *parent = 0, const char *name = 0); ~KOJournalView(); virtual int currentDateCount(); void clearList(); virtual QPtrList<Incidence> selectedIncidences(); DateList selectedDates() {DateList q; return q;}; + void checkModified(); signals: void deleteJournal(Journal *); public slots: void showOnly ( Journal* ); void newJournal(); void updateView(); void flushView(); void updateConfig(); void showDates( const QDate &start, const QDate &end ); void showEvents(QPtrList<Event> eventList); void changeEventDisplay(Event *, int); diff --git a/korganizer/koviewmanager.h b/korganizer/koviewmanager.h index d5a8e3b..2e6aaed 100644 --- a/korganizer/koviewmanager.h +++ b/korganizer/koviewmanager.h @@ -68,24 +68,25 @@ class KOViewManager : public QObject void updateView( const QDate &start, const QDate &end ); void clearAllViews(); void raiseCurrentView( bool fullScreen = false , bool updateView = false); void addView(KOrg::BaseView *); Incidence *currentSelection(); QDate currentSelectionDate(); KOAgendaView *agendaView() const { return mAgendaView; } + KOJournalView *journalView() const { return mJournalView; } signals: void printWNV(); void signalFullScreen( bool ); void signalAgendaView( bool ); public slots: void setDefaultCalendar(int); void slotprintWNV(); void showNextView(); void showMonth( const QDate & ); void showDateView( int, QDate ); void updateView(); diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index d8373a6..fb6d6ec 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp @@ -38,24 +38,25 @@ #include <libkcal/calendarlocal.h> #include <libkcal/todo.h> #include <libkcal/phoneformat.h> #include <libkdepim/ksyncprofile.h> #include <libkdepim/phoneaccess.h> #include <libkcal/kincidenceformatter.h> #include <libkdepim/kpimglobalprefs.h> #include "calendarview.h" #include "koviewmanager.h" #include "datenavigator.h" #include "koagendaview.h" +#include "kojournalview.h" #include "koagenda.h" #include "kodialogmanager.h" #include "kdialogbase.h" #include "kapplication.h" #include "kofilterview.h" #include "kstandarddirs.h" #include "koprefs.h" #include "kfiledialog.h" #include "koglobals.h" #include "kglobal.h" #include "ktoolbar.h" #include "klocale.h" @@ -1825,25 +1826,26 @@ void MainWindow::saveOnClose() if ( p->mToolBarHorN ) p->mToolBarUpN = navigatorToolBar->y() > height()/2; else p->mToolBarUpN = navigatorToolBar->x() > width()/2 ; if ( filterToolBar ) { if ( p->mToolBarHorF ) p->mToolBarUpF = filterToolBar->y() > height()/2; else p->mToolBarUpF = filterToolBar->x() > width()/2 ; } #endif - + if ( mView->viewManager()->journalView() ) + mView->viewManager()->journalView()->checkModified(); if ( mCalendarModifiedFlag || mView->checkFileChanged( defaultFileName())) save(); mView->writeSettings(); } void MainWindow::slotModifiedChanged( bool changed ) { if ( mBlockAtStartup ) return; int msec; // we store the changes after 1 minute, // and for safety reasons after 10 minutes again @@ -1890,24 +1892,26 @@ void MainWindow::backupAllFiles() KOPrefs::instance()->mLastBackupDate = daysTo; setCaption(i18n("Backup succesfully finished" )); } else if ( retval == 2 ){ setCaption(i18n("Backup globally disabled" )); qDebug("KO: Backup globally cancelled."); // backup globally cancelled KPimGlobalPrefs::instance()->mBackupEnabled = false; } // retval == 3: do nothing, try again later } void MainWindow::save() { + if ( mView->viewManager()->journalView() ) + mView->viewManager()->journalView()->checkModified(); if ( !mCalendarModifiedFlag ) { qDebug("KO: Calendar not modified. Nothing saved."); return; } if ( mSyncManager->blockSave() ) return; mSyncManager->setBlockSave(true); if ( mView->checkAllFileVersions() ) { if ( KPimGlobalPrefs::instance()->mBackupEnabled ){ QDate reference ( 2000,1,1); int daysTo = reference.daysTo ( QDate::currentDate() ); if ( daysTo - KPimGlobalPrefs::instance()->mBackupDayCount >= KOPrefs::instance()->mLastBackupDate ) { |