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 | |||
@@ -297,12 +297,28 @@ 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 |