author | zautrix <zautrix> | 2004-09-12 19:26:13 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-09-12 19:26:13 (UTC) |
commit | 5b434dd78f71bcea5e6067fc8ae0faaaea313f9d (patch) (unidiff) | |
tree | ed532e602a3b503b72a46ea18d40e3a5dc97aa3f /libkcal/alarm.cpp | |
parent | bc4153a99e205f43d0144e2e910730dd1a14d402 (diff) | |
download | kdepimpi-5b434dd78f71bcea5e6067fc8ae0faaaea313f9d.zip kdepimpi-5b434dd78f71bcea5e6067fc8ae0faaaea313f9d.tar.gz kdepimpi-5b434dd78f71bcea5e6067fc8ae0faaaea313f9d.tar.bz2 |
phone fixes
-rw-r--r-- | libkcal/alarm.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/libkcal/alarm.cpp b/libkcal/alarm.cpp index 07812c2..29e6205 100644 --- a/libkcal/alarm.cpp +++ b/libkcal/alarm.cpp | |||
@@ -291,24 +291,40 @@ void Alarm::setText(const QString &text) | |||
291 | QString Alarm::text() const | 291 | QString Alarm::text() const |
292 | { | 292 | { |
293 | return (mType == Display) ? mDescription : QString::null; | 293 | return (mType == Display) ? mDescription : QString::null; |
294 | } | 294 | } |
295 | 295 | ||
296 | void Alarm::setTime(const QDateTime &alarmTime) | 296 | void Alarm::setTime(const QDateTime &alarmTime) |
297 | { | 297 | { |
298 | mAlarmTime = alarmTime; | 298 | mAlarmTime = alarmTime; |
299 | mHasTime = true; | 299 | mHasTime = true; |
300 | 300 | ||
301 | mParent->updated(); | 301 | mParent->updated(); |
302 | } | 302 | } |
303 | int Alarm::offset() | ||
304 | { | ||
305 | if ( hasTime() ) { | ||
306 | if (mParent->type()=="Todo") { | ||
307 | Todo *t = static_cast<Todo*>(mParent); | ||
308 | return t->dtDue().secsTo( mAlarmTime ) ; | ||
309 | } else | ||
310 | return mParent->dtStart().secsTo( mAlarmTime ) ; | ||
311 | } | ||
312 | else | ||
313 | { | ||
314 | return mOffset.asSeconds(); | ||
315 | } | ||
316 | |||
317 | } | ||
318 | |||
303 | 319 | ||
304 | QDateTime Alarm::time() const | 320 | QDateTime Alarm::time() const |
305 | { | 321 | { |
306 | if ( hasTime() ) | 322 | if ( hasTime() ) |
307 | return mAlarmTime; | 323 | return mAlarmTime; |
308 | else | 324 | else |
309 | { | 325 | { |
310 | if (mParent->type()=="Todo") { | 326 | if (mParent->type()=="Todo") { |
311 | Todo *t = static_cast<Todo*>(mParent); | 327 | Todo *t = static_cast<Todo*>(mParent); |
312 | return mOffset.end( t->dtDue() ); | 328 | return mOffset.end( t->dtDue() ); |
313 | } else if (mEndOffset) { | 329 | } else if (mEndOffset) { |
314 | return mOffset.end( mParent->dtEnd() ); | 330 | return mOffset.end( mParent->dtEnd() ); |