author | zautrix <zautrix> | 2005-04-02 14:07:31 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-04-02 14:07:31 (UTC) |
commit | b0d17f8f2ef9b09b7d8b8aa0f6cc34f400f8fddd (patch) (side-by-side diff) | |
tree | 942bcf89b35cf165e9147c1e4a5efa817c48007f /libkcal/alarm.cpp | |
parent | 997e7660a81baa2b8aeb1b66a3cc3ebe54e00ebe (diff) | |
download | kdepimpi-b0d17f8f2ef9b09b7d8b8aa0f6cc34f400f8fddd.zip kdepimpi-b0d17f8f2ef9b09b7d8b8aa0f6cc34f400f8fddd.tar.gz kdepimpi-b0d17f8f2ef9b09b7d8b8aa0f6cc34f400f8fddd.tar.bz2 |
fixes
-rw-r--r-- | libkcal/alarm.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/libkcal/alarm.cpp b/libkcal/alarm.cpp index 1fc7169..d8f15b5 100644 --- a/libkcal/alarm.cpp +++ b/libkcal/alarm.cpp @@ -22,2 +22,3 @@ #include <kdebug.h> +#include <klocale.h> @@ -351,2 +352,25 @@ 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 ); + return message; +} |