author | zautrix <zautrix> | 2004-09-12 19:26:13 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-09-12 19:26:13 (UTC) |
commit | 5b434dd78f71bcea5e6067fc8ae0faaaea313f9d (patch) (side-by-side diff) | |
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) { mAlarmTime = alarmTime; mHasTime = true; mParent->updated(); } +int Alarm::offset() +{ + if ( hasTime() ) { + if (mParent->type()=="Todo") { + Todo *t = static_cast<Todo*>(mParent); + return t->dtDue().secsTo( mAlarmTime ) ; + } else + return mParent->dtStart().secsTo( mAlarmTime ) ; + } + else + { + return mOffset.asSeconds(); + } + +} + QDateTime Alarm::time() const { if ( hasTime() ) return mAlarmTime; else |