author | zautrix <zautrix> | 2005-04-14 20:32:31 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-04-14 20:32:31 (UTC) |
commit | 7e87a287a0860882af27e26288bc9cc553dd3a0b (patch) (unidiff) | |
tree | a55374f708a8c27da182bcd8d975ad3f20f39057 /korganizer/koeditorgeneralevent.cpp | |
parent | 2a449f785f955649df9de639d38dcb250fe1376d (diff) | |
download | kdepimpi-7e87a287a0860882af27e26288bc9cc553dd3a0b.zip kdepimpi-7e87a287a0860882af27e26288bc9cc553dd3a0b.tar.gz kdepimpi-7e87a287a0860882af27e26288bc9cc553dd3a0b.tar.bz2 |
fix
Diffstat (limited to 'korganizer/koeditorgeneralevent.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | korganizer/koeditorgeneralevent.cpp | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/korganizer/koeditorgeneralevent.cpp b/korganizer/koeditorgeneralevent.cpp index 3b2a276..af97ee9 100644 --- a/korganizer/koeditorgeneralevent.cpp +++ b/korganizer/koeditorgeneralevent.cpp | |||
@@ -143,7 +143,6 @@ void KOEditorGeneralEvent::initTime(QWidget *parent,QBoxLayout *topLayout) | |||
143 | connect(mEndDateEdit, SIGNAL(dateChanged(QDate)), | 143 | connect(mEndDateEdit, SIGNAL(dateChanged(QDate)), |
144 | this, SLOT(endDateChanged(QDate))); | 144 | this, SLOT(endDateChanged(QDate))); |
145 | connect(mStartDateEdit,SIGNAL(setTimeTo(QTime)),mStartTimeEdit,SLOT(setTime(QTime))); | 145 | connect(mStartDateEdit,SIGNAL(setTimeTo(QTime)),this,SLOT(sTimeChanged(QTime))); |
146 | connect(mEndDateEdit,SIGNAL(setTimeTo(QTime)),mEndTimeEdit,SLOT(setTime(QTime))); | 146 | connect(mEndDateEdit,SIGNAL(setTimeTo(QTime)),this,SLOT(eTimeChanged(QTime))); |
147 | |||
148 | } | 147 | } |
149 | 148 | ||
@@ -197,14 +196,23 @@ void KOEditorGeneralEvent::setDateTimes(QDateTime start, QDateTime end) | |||
197 | } | 196 | } |
198 | 197 | ||
198 | void KOEditorGeneralEvent::sTimeChanged(QTime ti) | ||
199 | { | ||
200 | mStartTimeEdit->setTime( ti ); | ||
201 | startTimeChanged ( ti); | ||
202 | } | ||
203 | void KOEditorGeneralEvent::eTimeChanged(QTime ti ) | ||
204 | { | ||
205 | mEndTimeEdit->setTime( ti ); | ||
206 | endTimeChanged( ti ); | ||
207 | } | ||
199 | void KOEditorGeneralEvent::startTimeChanged(QTime newtime) | 208 | void KOEditorGeneralEvent::startTimeChanged(QTime newtime) |
200 | { | 209 | { |
201 | kdDebug() << "KOEditorGeneralEvent::startTimeChanged() " << newtime.toString() << endl; | ||
202 | 210 | ||
203 | int secsep = mCurrStartDateTime.secsTo(mCurrEndDateTime); | 211 | int secsep = mCurrStartDateTime.secsTo(mCurrEndDateTime); |
204 | 212 | ||
205 | mCurrStartDateTime.setTime(newtime); | 213 | mCurrStartDateTime = QDateTime( mStartDateEdit->date(), QTime(newtime.hour(),newtime.minute(),0) ); |
206 | |||
207 | // adjust end time so that the event has the same duration as before. | 214 | // adjust end time so that the event has the same duration as before. |
208 | mCurrEndDateTime = mCurrStartDateTime.addSecs(secsep); | 215 | if( secsep > 0 ) |
216 | mCurrEndDateTime = mCurrStartDateTime.addSecs(secsep); | ||
209 | mEndTimeEdit->setTime(mCurrEndDateTime.time()); | 217 | mEndTimeEdit->setTime(mCurrEndDateTime.time()); |
210 | mEndDateEdit->setDate(mCurrEndDateTime.date()); | 218 | mEndDateEdit->setDate(mCurrEndDateTime.date()); |
@@ -215,8 +223,6 @@ void KOEditorGeneralEvent::startTimeChanged(QTime newtime) | |||
215 | void KOEditorGeneralEvent::endTimeChanged(QTime newtime) | 223 | void KOEditorGeneralEvent::endTimeChanged(QTime newtime) |
216 | { | 224 | { |
217 | // kdDebug() << "KOEditorGeneralEvent::endTimeChanged " << newtime.toString() << endl; | ||
218 | 225 | ||
219 | QDateTime newdt(mCurrEndDateTime.date(), newtime); | 226 | mCurrEndDateTime = QDateTime ( mEndDateEdit->date(), QTime(newtime.hour(),newtime.minute(),0)); |
220 | mCurrEndDateTime = newdt; | ||
221 | 227 | ||
222 | emit dateTimesChanged(mCurrStartDateTime,mCurrEndDateTime); | 228 | emit dateTimesChanged(mCurrStartDateTime,mCurrEndDateTime); |