summaryrefslogtreecommitdiffabout
path: root/libkcal/alarm.cpp
authorzautrix <zautrix>2005-04-02 14:07:31 (UTC)
committer zautrix <zautrix>2005-04-02 14:07:31 (UTC)
commitb0d17f8f2ef9b09b7d8b8aa0f6cc34f400f8fddd (patch) (side-by-side diff)
tree942bcf89b35cf165e9147c1e4a5efa817c48007f /libkcal/alarm.cpp
parent997e7660a81baa2b8aeb1b66a3cc3ebe54e00ebe (diff)
downloadkdepimpi-b0d17f8f2ef9b09b7d8b8aa0f6cc34f400f8fddd.zip
kdepimpi-b0d17f8f2ef9b09b7d8b8aa0f6cc34f400f8fddd.tar.gz
kdepimpi-b0d17f8f2ef9b09b7d8b8aa0f6cc34f400f8fddd.tar.bz2
fixes
Diffstat (limited to 'libkcal/alarm.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/alarm.cpp24
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;
+}