summaryrefslogtreecommitdiff
path: root/noncore/net/mail/mailistviewitem.cpp
Side-by-side diff
Diffstat (limited to 'noncore/net/mail/mailistviewitem.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/mailistviewitem.cpp20
1 files changed, 17 insertions, 3 deletions
diff --git a/noncore/net/mail/mailistviewitem.cpp b/noncore/net/mail/mailistviewitem.cpp
index 0b926da..d3a0723 100644
--- a/noncore/net/mail/mailistviewitem.cpp
+++ b/noncore/net/mail/mailistviewitem.cpp
@@ -1,22 +1,23 @@
#include "mailistviewitem.h"
#include <libmailwrapper/abstractmail.h>
#include <qtextstream.h>
#include <qpe/resource.h>
+#include <qpe/timestring.h>
MailListViewItem::MailListViewItem(QListView * parent, MailListViewItem * item )
:QListViewItem(parent,item),mail_data()
{
}
void MailListViewItem::showEntry()
{
if ( mail_data->getFlags().testBit( FLAG_ANSWERED ) == true) {
setPixmap( 0, Resource::loadPixmap( "mail/kmmsgreplied") );
} else if ( mail_data->getFlags().testBit( FLAG_SEEN ) == true ) {
- /* I think it looks nicer if there are not such a log of icons but only on mails
+ /* I think it looks nicer if there are not such a lot of icons but only on mails
replied or new - Alwin*/
//setPixmap( 0, Resource::loadPixmap( "mail/kmmsgunseen") );
} else {
setPixmap( 0, Resource::loadPixmap( "mail/kmmsgnew") );
}
double s = mail_data->Msgsize();
@@ -45,17 +46,30 @@ void MailListViewItem::showEntry()
{
QTextOStream o(&fsize);
if (w>0) o.precision(2); else o.precision(0);
o.setf(QTextStream::fixed);
o << s << " " << q << "Byte";
}
-
setText(1,mail_data->getSubject());
setText(2,mail_data->getFrom());
setText(3,fsize);
- setText(4,mail_data->getDate());
+ setText(4,mail_data->getStringDate());
+}
+
+QString MailListViewItem::key(int col,bool) const
+{
+ QString temp;
+ if (col == 4) {
+ temp.sprintf( "%08d",QDateTime().secsTo(mail_data->getDate()));
+ return temp;
+ }
+ if (col == 3) {
+ temp.sprintf( "%020d",mail_data->Msgsize());
+ return temp;
+ }
+ return text(col);
}
void MailListViewItem::storeData(const RecMailP&data)
{
mail_data = data;
}