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 | |||
@@ -22,25 +22,17 @@ void MailListViewItem::showEntry() | |||
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: |
@@ -48,12 +40,12 @@ void MailListViewItem::showEntry() | |||
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()); |