summaryrefslogtreecommitdiffabout
path: root/libkcal/alarm.cpp
Unidiff
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
@@ -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}
303int 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
304QDateTime Alarm::time() const 320QDateTime Alarm::time() const
305{ 321{
306 if ( hasTime() ) 322 if ( hasTime() )
307 return mAlarmTime; 323 return mAlarmTime;
308 else 324 else