Diffstat (limited to 'noncore/net/mail/mailistviewitem.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/mail/mailistviewitem.cpp | 20 |
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 @@ | |||
1 | #include "mailistviewitem.h" | 1 | #include "mailistviewitem.h" |
2 | #include <libmailwrapper/abstractmail.h> | 2 | #include <libmailwrapper/abstractmail.h> |
3 | #include <qtextstream.h> | 3 | #include <qtextstream.h> |
4 | #include <qpe/resource.h> | 4 | #include <qpe/resource.h> |
5 | #include <qpe/timestring.h> | ||
5 | 6 | ||
6 | MailListViewItem::MailListViewItem(QListView * parent, MailListViewItem * item ) | 7 | MailListViewItem::MailListViewItem(QListView * parent, MailListViewItem * item ) |
7 | :QListViewItem(parent,item),mail_data() | 8 | :QListViewItem(parent,item),mail_data() |
8 | { | 9 | { |
9 | } | 10 | } |
10 | 11 | ||
11 | void MailListViewItem::showEntry() | 12 | void MailListViewItem::showEntry() |
12 | { | 13 | { |
13 | if ( mail_data->getFlags().testBit( FLAG_ANSWERED ) == true) { | 14 | if ( mail_data->getFlags().testBit( FLAG_ANSWERED ) == true) { |
14 | setPixmap( 0, Resource::loadPixmap( "mail/kmmsgreplied") ); | 15 | setPixmap( 0, Resource::loadPixmap( "mail/kmmsgreplied") ); |
15 | } else if ( mail_data->getFlags().testBit( FLAG_SEEN ) == true ) { | 16 | } else if ( mail_data->getFlags().testBit( FLAG_SEEN ) == true ) { |
16 | /* I think it looks nicer if there are not such a log of icons but only on mails | 17 | /* I think it looks nicer if there are not such a lot of icons but only on mails |
17 | replied or new - Alwin*/ | 18 | replied or new - Alwin*/ |
18 | //setPixmap( 0, Resource::loadPixmap( "mail/kmmsgunseen") ); | 19 | //setPixmap( 0, Resource::loadPixmap( "mail/kmmsgunseen") ); |
19 | } else { | 20 | } else { |
20 | setPixmap( 0, Resource::loadPixmap( "mail/kmmsgnew") ); | 21 | setPixmap( 0, Resource::loadPixmap( "mail/kmmsgnew") ); |
21 | } | 22 | } |
22 | double s = mail_data->Msgsize(); | 23 | double s = mail_data->Msgsize(); |
@@ -45,17 +46,30 @@ void MailListViewItem::showEntry() | |||
45 | { | 46 | { |
46 | QTextOStream o(&fsize); | 47 | QTextOStream o(&fsize); |
47 | if (w>0) o.precision(2); else o.precision(0); | 48 | if (w>0) o.precision(2); else o.precision(0); |
48 | o.setf(QTextStream::fixed); | 49 | o.setf(QTextStream::fixed); |
49 | o << s << " " << q << "Byte"; | 50 | o << s << " " << q << "Byte"; |
50 | } | 51 | } |
51 | |||
52 | setText(1,mail_data->getSubject()); | 52 | setText(1,mail_data->getSubject()); |
53 | setText(2,mail_data->getFrom()); | 53 | setText(2,mail_data->getFrom()); |
54 | setText(3,fsize); | 54 | setText(3,fsize); |
55 | setText(4,mail_data->getDate()); | 55 | setText(4,mail_data->getStringDate()); |
56 | } | ||
57 | |||
58 | QString MailListViewItem::key(int col,bool) const | ||
59 | { | ||
60 | QString temp; | ||
61 | if (col == 4) { | ||
62 | temp.sprintf( "%08d",QDateTime().secsTo(mail_data->getDate())); | ||
63 | return temp; | ||
64 | } | ||
65 | if (col == 3) { | ||
66 | temp.sprintf( "%020d",mail_data->Msgsize()); | ||
67 | return temp; | ||
68 | } | ||
69 | return text(col); | ||
56 | } | 70 | } |
57 | 71 | ||
58 | void MailListViewItem::storeData(const RecMailP&data) | 72 | void MailListViewItem::storeData(const RecMailP&data) |
59 | { | 73 | { |
60 | mail_data = data; | 74 | mail_data = data; |
61 | } | 75 | } |