summaryrefslogtreecommitdiffabout
path: root/libkcal/alarm.cpp
authorzautrix <zautrix>2005-06-13 13:57:22 (UTC)
committer zautrix <zautrix>2005-06-13 13:57:22 (UTC)
commit56de219c5ce910a470a01a0e5003d1a113837ef4 (patch) (unidiff)
tree3393cb306cec8dcdc05d6ed0fae3ae7d374f2794 /libkcal/alarm.cpp
parent4f3ff02932b39bf16b9692c3cb69c101a28b4616 (diff)
downloadkdepimpi-56de219c5ce910a470a01a0e5003d1a113837ef4.zip
kdepimpi-56de219c5ce910a470a01a0e5003d1a113837ef4.tar.gz
kdepimpi-56de219c5ce910a470a01a0e5003d1a113837ef4.tar.bz2
fixxx
Diffstat (limited to 'libkcal/alarm.cpp') (more/less context) (ignore 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()
350 } 350 }
351 351
352} 352}
353QString Alarm::offsetText() 353QString Alarm::offsetText()
354{ 354{
355 int min = -offset()/60; 355 int min = -offset()/60;
356 int hours = min /60; 356 int hours = min /60;
357 min = min % 60; 357 min = min % 60;
358 int days = hours /24; 358 int days = hours /24;
359 hours = hours % 24; 359 hours = hours % 24;
360 QString message; 360 QString message;
361 //qDebug("%d %d %d ", days, hours, min ); 361 //qDebug("%d %d %d ", days, hours, min );
362 if ( days > 0 ) 362 if ( days > 0 )
363 message += i18n("%1d").arg( days ); 363 message += i18n("%1d").arg( days );
364 if ( hours > 0 ) { 364 if ( hours > 0 ) {
365 if ( !message.isEmpty() ) message += "/"; 365 if ( !message.isEmpty() ) message += "/";
366 message += i18n("%1h").arg( hours ); 366 message += i18n("%1h").arg( hours );
367 } 367 }
368 if ( min > 0 ) { 368 if ( min > 0 ) {
369 if ( !message.isEmpty() ) message += "/"; 369 if ( !message.isEmpty() ) message += "/";
370 message += i18n("%1min").arg( min ); 370 message += i18n("%1min").arg( min );
371 } 371 }
372 if ( message.isEmpty() ) 372 if ( message.isEmpty() )
373 message = i18n("%1min").arg( 0 ); 373 message = i18n("%1min").arg( 0 );
374 if ( !mParent->alarmEnabled() )
375 return "!"+message + i18n("(disabled)");
374 return message; 376 return message;
375} 377}
376 378
377 379
378QDateTime Alarm::time() const 380QDateTime Alarm::time() const
379{ 381{
380 if ( hasTime() ) 382 if ( hasTime() )
381 return mAlarmTime; 383 return mAlarmTime;
382 else 384 else
383 { 385 {
384 if (mParent->typeID() == todoID ) { 386 if (mParent->typeID() == todoID ) {
385 Todo *t = static_cast<Todo*>(mParent); 387 Todo *t = static_cast<Todo*>(mParent);
386 return mOffset.end( t->dtDue() ); 388 return mOffset.end( t->dtDue() );
387 } else if (mEndOffset) { 389 } else if (mEndOffset) {
388 return mOffset.end( mParent->dtEnd() ); 390 return mOffset.end( mParent->dtEnd() );
389 } else { 391 } else {
390 return mOffset.end( mParent->dtStart() ); 392 return mOffset.end( mParent->dtStart() );
391 } 393 }
392 } 394 }
393} 395}
394 396
395bool Alarm::hasTime() const 397bool Alarm::hasTime() const
396{ 398{
397 return mHasTime; 399 return mHasTime;