From 5b434dd78f71bcea5e6067fc8ae0faaaea313f9d Mon Sep 17 00:00:00 2001 From: zautrix Date: Sun, 12 Sep 2004 19:26:13 +0000 Subject: phone fixes --- (limited to 'libkcal/alarm.cpp') diff --git a/libkcal/alarm.cpp b/libkcal/alarm.cpp index 07812c2..29e6205 100644 --- a/libkcal/alarm.cpp +++ b/libkcal/alarm.cpp @@ -300,6 +300,22 @@ void Alarm::setTime(const QDateTime &alarmTime) mParent->updated(); } +int Alarm::offset() +{ + if ( hasTime() ) { + if (mParent->type()=="Todo") { + Todo *t = static_cast(mParent); + return t->dtDue().secsTo( mAlarmTime ) ; + } else + return mParent->dtStart().secsTo( mAlarmTime ) ; + } + else + { + return mOffset.asSeconds(); + } + +} + QDateTime Alarm::time() const { -- cgit v0.9.0.2