Diffstat (limited to 'kmicromail/mailistviewitem.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kmicromail/mailistviewitem.cpp | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/kmicromail/mailistviewitem.cpp b/kmicromail/mailistviewitem.cpp index ffb835c..137c482 100644 --- a/kmicromail/mailistviewitem.cpp +++ b/kmicromail/mailistviewitem.cpp | |||
@@ -17,48 +17,40 @@ void MailListViewItem::showEntry() | |||
17 | setPixmap( 0, SmallIcon ( "kmmsgreplied") ); | 17 | setPixmap( 0, SmallIcon ( "kmmsgreplied") ); |
18 | } else if ( mail_data->getFlags().testBit( FLAG_SEEN ) == true ) { | 18 | } 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 | 19 | /* I think it looks nicer if there are not such a log of icons but only on mails |
20 | replied or new - Alwin*/ | 20 | replied or new - Alwin*/ |
21 | //setPixmap( 0,SmallIcon ("kmmsgunseen") ); | 21 | //setPixmap( 0,SmallIcon ("kmmsgunseen") ); |
22 | } else { | 22 | } else { |
23 | setPixmap( 0,SmallIcon ( "kmmsgnew") ); | 23 | setPixmap( 0,SmallIcon ( "kmmsgnew") ); |
24 | } | 24 | } |
25 | double s = mail_data->Msgsize(); | 25 | QString fsize = mail_data->MsgsizeString(); |
26 | int w = 0; | ||
27 | s/=1024; | ||
28 | if (s>999.0) { | ||
29 | s/=1024.0; | ||
30 | ++w; | ||
31 | } | ||
32 | QString fsort; | ||
33 | fsort.sprintf( "%.2f", s ); | ||
34 | QString fsize = QString::number( s, 'f', 2 ); | ||
35 | // 1.23 | 26 | // 1.23 |
36 | // 11.23 | 27 | // 11.23 |
37 | // 111.23 | 28 | // 111.23 |
38 | // 999.23 maxlen | 29 | // 999.23 maxlen |
30 | QString fsort; | ||
39 | switch(fsize.length() ) { | 31 | switch(fsize.length() ) { |
40 | case 4: | 32 | case 6: |
41 | fsort = "00" + fsize ; | 33 | fsort = "00" + fsize ; |
42 | break; | 34 | break; |
43 | case 5: | 35 | case 7: |
44 | fsort = "0" + fsize ; | 36 | fsort = "0" + fsize ; |
45 | break; | 37 | break; |
46 | default: | 38 | default: |
47 | fsort = fsize ; | 39 | fsort = fsize ; |
48 | break; | 40 | break; |
49 | 41 | ||
50 | } | 42 | } |
51 | if ( w == 0 ) { | 43 | setText(3, fsize ); |
52 | setText(3, fsize + "kB" ); | 44 | //qDebug("fsize *%s* ",fsize.latin1() ); |
45 | //qDebug("fsort *%s* ",fsort.latin1() ); | ||
46 | if ( fsize.right(2) == "kB" ) { | ||
53 | mKeyMap.insert(3, "k" + fsort); | 47 | mKeyMap.insert(3, "k" + fsort); |
54 | //setText(3, "kB" + fsort ); // test only | ||
55 | } else { | 48 | } else { |
56 | //setText(3, fsize + "MB"); | ||
57 | mKeyMap.insert(3, "M" +fsort ); | 49 | mKeyMap.insert(3, "M" +fsort ); |
58 | } | 50 | } |
59 | setText(1,mail_data->getSubject()); | 51 | setText(1,mail_data->getSubject()); |
60 | setText(2,mail_data->getFrom()); | 52 | setText(2,mail_data->getFrom()); |
61 | mKeyMap.insert(4,mail_data->getIsoDate()); | 53 | mKeyMap.insert(4,mail_data->getIsoDate()); |
62 | setText(4,mail_data->getDate()); | 54 | setText(4,mail_data->getDate()); |
63 | if ( KOPrefs::instance()->mShowToField ) | 55 | if ( KOPrefs::instance()->mShowToField ) |
64 | setText(5,mail_data->To()[0]); | 56 | setText(5,mail_data->To()[0]); |