summaryrefslogtreecommitdiffabout
path: root/kmicromail/mailistviewitem.cpp
Unidiff
Diffstat (limited to 'kmicromail/mailistviewitem.cpp') (more/less context) (show whitespace changes)
-rw-r--r--kmicromail/mailistviewitem.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/kmicromail/mailistviewitem.cpp b/kmicromail/mailistviewitem.cpp
index 137c482..5119744 100644
--- a/kmicromail/mailistviewitem.cpp
+++ b/kmicromail/mailistviewitem.cpp
@@ -6,30 +6,33 @@
6#include "koprefs.h" 6#include "koprefs.h"
7//#include <qpe/resource.h> 7//#include <qpe/resource.h>
8 8
9MailListViewItem::MailListViewItem(QListView * parent, MailListViewItem * item ) 9MailListViewItem::MailListViewItem(QListView * parent, MailListViewItem * item )
10 :QListViewItem(parent,item),mail_data() 10 :QListViewItem(parent,item),mail_data()
11{ 11{
12} 12}
13 13
14void MailListViewItem::showEntry() 14void MailListViewItem::showEntry()
15{ 15{
16 if ( mail_data->getFlags().testBit( FLAG_ANSWERED ) == true) { 16 if ( mail_data->getFlags().testBit( FLAG_ANSWERED ) == true) {
17 setPixmap( 0, SmallIcon ( "kmmsgreplied") ); 17 setPixmap( 0, SmallIcon ( "kmmsgreplied") );
18 mKeyMap.insert(0, "r" );
18 } else if ( mail_data->getFlags().testBit( FLAG_SEEN ) == true ) { 19 } else if ( mail_data->getFlags().testBit( FLAG_SEEN ) == true ) {
19 /* I think it looks nicer if there are not such a log of icons but only on mails 20 /* I think it looks nicer if there are not such a log of icons but only on mails
20 replied or new - Alwin*/ 21 replied or new - Alwin*/
21 //setPixmap( 0,SmallIcon ("kmmsgunseen") ); 22 //setPixmap( 0,SmallIcon ("kmmsgunseen") );
23 mKeyMap.insert(0, "s" );
22 } else { 24 } else {
23 setPixmap( 0,SmallIcon ( "kmmsgnew") ); 25 setPixmap( 0,SmallIcon ( "kmmsgnew") );
26 mKeyMap.insert(0, "u" );
24 } 27 }
25 QString fsize = mail_data->MsgsizeString(); 28 QString fsize = mail_data->MsgsizeString();
26 // 1.23 29 // 1.23
27 // 11.23 30 // 11.23
28 // 111.23 31 // 111.23
29 // 999.23 maxlen 32 // 999.23 maxlen
30 QString fsort; 33 QString fsort;
31 switch(fsize.length() ) { 34 switch(fsize.length() ) {
32 case 6: 35 case 6:
33 fsort = "00" + fsize ; 36 fsort = "00" + fsize ;
34 break; 37 break;
35 case 7: 38 case 7:
@@ -58,25 +61,25 @@ void MailListViewItem::showEntry()
58 61
59void MailListViewItem::storeData(const RecMailP&data) 62void MailListViewItem::storeData(const RecMailP&data)
60{ 63{
61 mail_data = data; 64 mail_data = data;
62} 65}
63void MailListViewItem::setSortKey(int column,const QString &key) 66void MailListViewItem::setSortKey(int column,const QString &key)
64{ 67{
65 mKeyMap.insert(column,key); 68 mKeyMap.insert(column,key);
66} 69}
67QString MailListViewItem::key(int column, bool) const 70QString MailListViewItem::key(int column, bool) const
68{ 71{
69 // to make is fast, we use here special cases 72 // to make is fast, we use here special cases
70 if ( column == 3 || column == 4 ) { 73 if ( column == 3 || column == 4 || column == 0) {
71 return *mKeyMap.find(column); 74 return *mKeyMap.find(column);
72 } 75 }
73 if ( column == 1 ) { 76 if ( column == 1 ) {
74 if ( text(1).left(4).lower() == "re: " ) 77 if ( text(1).left(4).lower() == "re: " )
75 return text(1).mid(4); 78 return text(1).mid(4);
76 79
77 } 80 }
78 return text(column); 81 return text(column);
79 /* 82 /*
80 QMap<int,QString>::ConstIterator it = mKeyMap.find(column); 83 QMap<int,QString>::ConstIterator it = mKeyMap.find(column);
81 if (it == mKeyMap.end()) return text(column); 84 if (it == mKeyMap.end()) return text(column);
82 else return *it; 85 else return *it;