summaryrefslogtreecommitdiffabout
path: root/libkcal
Side-by-side diff
Diffstat (limited to 'libkcal') (more/less context) (show whitespace changes)
-rw-r--r--libkcal/alarm.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/libkcal/alarm.cpp b/libkcal/alarm.cpp
index 6de1566..0afa0a7 100644
--- a/libkcal/alarm.cpp
+++ b/libkcal/alarm.cpp
@@ -335,13 +335,13 @@ void Alarm::setTime(const QDateTime &alarmTime)
mParent->updated();
}
int Alarm::offset()
{
if ( hasTime() ) {
- if (mParent->type()=="Todo") {
+ if (mParent->typeID() == todoID ) {
Todo *t = static_cast<Todo*>(mParent);
return t->dtDue().secsTo( mAlarmTime ) ;
} else
return mParent->dtStart().secsTo( mAlarmTime ) ;
}
else
@@ -378,13 +378,13 @@ QString Alarm::offsetText()
QDateTime Alarm::time() const
{
if ( hasTime() )
return mAlarmTime;
else
{
- if (mParent->type()=="Todo") {
+ if (mParent->typeID() == todoID ) {
Todo *t = static_cast<Todo*>(mParent);
return mOffset.end( t->dtDue() );
} else if (mEndOffset) {
return mOffset.end( mParent->dtEnd() );
} else {
return mOffset.end( mParent->dtStart() );