-rw-r--r-- | korganizer/koeditorgeneralevent.cpp | 24 | ||||
-rw-r--r-- | korganizer/koeditorgeneralevent.h | 1 |
2 files changed, 14 insertions, 11 deletions
diff --git a/korganizer/koeditorgeneralevent.cpp b/korganizer/koeditorgeneralevent.cpp index 42c3df1..fc5be71 100644 --- a/korganizer/koeditorgeneralevent.cpp +++ b/korganizer/koeditorgeneralevent.cpp @@ -47,12 +47,13 @@ #include "kolocationbox.h" KOEditorGeneralEvent::KOEditorGeneralEvent(QObject* parent, const char* name) : KOEditorGeneral( parent, name) { + mTemplate = false; connect(this,SIGNAL(dateTimesChanged(QDateTime,QDateTime)), SLOT(setDuration())); connect(this,SIGNAL(dateTimesChanged(QDateTime,QDateTime)), SLOT(emitDateTimeStr())); } @@ -172,19 +173,20 @@ void KOEditorGeneralEvent::dontAssociateTime(bool noTime) allDayChanged(noTime); } void KOEditorGeneralEvent::setDateTimes(QDateTime start, QDateTime end) { // kdDebug() << "KOEditorGeneralEvent::setDateTimes(): Start DateTime: " << start.toString() << endl; - - mStartDateEdit->setDate(start.date()); + if ( !mTemplate ) + mStartDateEdit->setDate(start.date()); // KTimeEdit seems to emit some signals when setTime() is called. mStartTimeEdit->blockSignals( true ); mStartTimeEdit->setTime(start.time()); mStartTimeEdit->blockSignals( false ); - mEndDateEdit->setDate(end.date()); + if ( !mTemplate ) + mEndDateEdit->setDate(end.date()); mEndTimeEdit->setTime(end.time()); mCurrStartDateTime = start; mCurrEndDateTime = end; setDuration(); @@ -258,20 +260,20 @@ void KOEditorGeneralEvent::setDefaults(QDateTime from,QDateTime to,bool allDay) } void KOEditorGeneralEvent::readEvent( Event *event, bool tmpl ) { QString tmpStr; - if ( !tmpl ) { - // the rest is for the events only - mNoTimeButton->setChecked(event->doesFloat()); - timeStuffDisable(event->doesFloat()); - - setDateTimes(event->dtStart(),event->dtEnd()); - } - + mTemplate = tmpl; + // the rest is for the events only + mNoTimeButton->setChecked(event->doesFloat()); + timeStuffDisable(event->doesFloat()); + + setDateTimes(event->dtStart(),event->dtEnd()); + + mTemplate = false; switch( event->transparency() ) { case Event::Transparent: mFreeTimeCombo->setCurrentItem(1); break; case Event::Opaque: mFreeTimeCombo->setCurrentItem(0); diff --git a/korganizer/koeditorgeneralevent.h b/korganizer/koeditorgeneralevent.h index 188dc93..0174788 100644 --- a/korganizer/koeditorgeneralevent.h +++ b/korganizer/koeditorgeneralevent.h @@ -87,12 +87,13 @@ class KOEditorGeneralEvent : public KOEditorGeneral signals: void dateTimesChanged(QDateTime start,QDateTime end); void allDayChanged(bool); void dateTimeStrChanged(const QString &); private: + bool mTemplate; QLabel *mStartDateLabel; QLabel *mEndDateLabel; KDateEdit *mStartDateEdit; KDateEdit *mEndDateEdit; KOTimeEdit *mStartTimeEdit; KOTimeEdit *mEndTimeEdit; |