summaryrefslogtreecommitdiffabout
path: root/libkcal/alarm.cpp
Side-by-side diff
Diffstat (limited to 'libkcal/alarm.cpp') (more/less context) (show whitespace changes)
-rw-r--r--libkcal/alarm.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/libkcal/alarm.cpp b/libkcal/alarm.cpp
index 0afa0a7..79e0464 100644
--- a/libkcal/alarm.cpp
+++ b/libkcal/alarm.cpp
@@ -350,48 +350,50 @@ int Alarm::offset()
}
}
QString Alarm::offsetText()
{
int min = -offset()/60;
int hours = min /60;
min = min % 60;
int days = hours /24;
hours = hours % 24;
QString message;
//qDebug("%d %d %d ", days, hours, min );
if ( days > 0 )
message += i18n("%1d").arg( days );
if ( hours > 0 ) {
if ( !message.isEmpty() ) message += "/";
message += i18n("%1h").arg( hours );
}
if ( min > 0 ) {
if ( !message.isEmpty() ) message += "/";
message += i18n("%1min").arg( min );
}
if ( message.isEmpty() )
message = i18n("%1min").arg( 0 );
+ if ( !mParent->alarmEnabled() )
+ return "!"+message + i18n("(disabled)");
return message;
}
QDateTime Alarm::time() const
{
if ( hasTime() )
return mAlarmTime;
else
{
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() );
}
}
}
bool Alarm::hasTime() const
{
return mHasTime;