From cd3245ade209b4672ab5c51003aa66b5908c67a1 Mon Sep 17 00:00:00 2001 From: alwin Date: Tue, 26 Oct 2004 01:08:58 +0000 Subject: Resolved a feature request: unique display of date-time of a mail maillist now sorted for mail-date as default, user can switch sort order to all other items (subject, author, size) --- (limited to 'noncore/net/mail/mailistviewitem.cpp') 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 @@ -2,6 +2,7 @@ #include #include #include +#include MailListViewItem::MailListViewItem(QListView * parent, MailListViewItem * item ) :QListViewItem(parent,item),mail_data() @@ -13,7 +14,7 @@ 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 { @@ -48,11 +49,24 @@ void MailListViewItem::showEntry() 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) -- cgit v0.9.0.2