You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tdetoys/kteatime/tealist.cpp

65 lines
1.0 KiB

/* -------------------------------------------------------------
tealist.cpp
(C) 2003 by Daniel Teske (teske@bigfoot.com)
------------------------------------------------------------- */
#include <klocale.h>
#include <tqlistview.h>
#include "tealist.h"
TQString int2time(int time)
{
TQString str;
if (time / 60)
str.append(i18n("%1 min").tqarg(time / 60));
if (time % 60)
if (str.isEmpty())
str.append(i18n("%1 s").tqarg(time % 60));
else
str.append(i18n(" %1 s").tqarg(time % 60));
return str;
}
TeaListItem::TeaListItem(TQListView * tqparent)
:TQListViewItem(tqparent)
{
}
TeaListItem::TeaListItem(TQListView * tqparent, TQListViewItem *after)
:TQListViewItem(tqparent, after)
{
}
TeaListItem::~TeaListItem()
{
}
void TeaListItem::setTime(int t)
{
TQListViewItem::setText(1, int2time(t));
tim = t;
}
void TeaListItem::setName(const TQString &n)
{
nam = n;
TQListViewItem::setText(0, n);
}
TQString TeaListItem::name()
{
return nam;
}
int TeaListItem::time()
{
return tim;
}