summaryrefslogtreecommitdiffabout
path: root/libkcal/alarm.cpp
authorzautrix <zautrix>2004-09-12 19:26:13 (UTC)
committer zautrix <zautrix>2004-09-12 19:26:13 (UTC)
commit5b434dd78f71bcea5e6067fc8ae0faaaea313f9d (patch) (side-by-side diff)
treeed532e602a3b503b72a46ea18d40e3a5dc97aa3f /libkcal/alarm.cpp
parentbc4153a99e205f43d0144e2e910730dd1a14d402 (diff)
downloadkdepimpi-5b434dd78f71bcea5e6067fc8ae0faaaea313f9d.zip
kdepimpi-5b434dd78f71bcea5e6067fc8ae0faaaea313f9d.tar.gz
kdepimpi-5b434dd78f71bcea5e6067fc8ae0faaaea313f9d.tar.bz2
phone fixes
Diffstat (limited to 'libkcal/alarm.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/alarm.cpp16
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
@@ -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<Todo*>(mParent);
+ return t->dtDue().secsTo( mAlarmTime ) ;
+ } else
+ return mParent->dtStart().secsTo( mAlarmTime ) ;
+ }
+ else
+ {
+ return mOffset.asSeconds();
+ }
+
+}
+
QDateTime Alarm::time() const
{