summaryrefslogtreecommitdiffstats
path: root/kteatime/tealist.cpp
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commitae2a03c2941bf92573f89b88ef73f8aa842bea0a (patch)
tree3566563f3fb6ac3cb3496669d8f233062d3091bc /kteatime/tealist.cpp
downloadtdetoys-ae2a03c2941bf92573f89b88ef73f8aa842bea0a.tar.gz
tdetoys-ae2a03c2941bf92573f89b88ef73f8aa842bea0a.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdetoys@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kteatime/tealist.cpp')
-rw-r--r--kteatime/tealist.cpp64
1 files changed, 64 insertions, 0 deletions
diff --git a/kteatime/tealist.cpp b/kteatime/tealist.cpp
new file mode 100644
index 0000000..0f7aa26
--- /dev/null
+++ b/kteatime/tealist.cpp
@@ -0,0 +1,64 @@
+/* -------------------------------------------------------------
+
+ tealist.cpp
+
+ (C) 2003 by Daniel Teske (teske@bigfoot.com)
+
+ ------------------------------------------------------------- */
+
+#include <klocale.h>
+#include <qlistview.h>
+#include "tealist.h"
+
+
+QString int2time(int time)
+{
+ QString str;
+ if (time / 60)
+ str.append(i18n("%1 min").arg(time / 60));
+ if (time % 60)
+ if (str.isEmpty())
+ str.append(i18n("%1 s").arg(time % 60));
+ else
+ str.append(i18n(" %1 s").arg(time % 60));
+ return str;
+}
+
+
+TeaListItem::TeaListItem(QListView * parent)
+ :QListViewItem(parent)
+{
+
+}
+
+TeaListItem::TeaListItem(QListView * parent, QListViewItem *after)
+ :QListViewItem(parent, after)
+{
+
+}
+
+TeaListItem::~TeaListItem()
+{
+}
+
+void TeaListItem::setTime(int t)
+{
+ QListViewItem::setText(1, int2time(t));
+ tim = t;
+}
+
+void TeaListItem::setName(const QString &n)
+{
+ nam = n;
+ QListViewItem::setText(0, n);
+}
+
+QString TeaListItem::name()
+{
+ return nam;
+}
+
+int TeaListItem::time()
+{
+ return tim;
+}