Diffstat (limited to 'kmicromail/mailistviewitem.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | kmicromail/mailistviewitem.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/kmicromail/mailistviewitem.cpp b/kmicromail/mailistviewitem.cpp index 1ca0ada..b92b0cf 100644 --- a/kmicromail/mailistviewitem.cpp +++ b/kmicromail/mailistviewitem.cpp | |||
@@ -1,48 +1,49 @@ | |||
1 | // CHANGED 2004-08-06 Lutz Rogowski | ||
1 | #include "mailistviewitem.h" | 2 | #include "mailistviewitem.h" |
2 | #include <libmailwrapper/abstractmail.h> | 3 | #include <libmailwrapper/abstractmail.h> |
3 | #include <qtextstream.h> | 4 | #include <qtextstream.h> |
4 | #include <kiconloader.h> | 5 | #include <kiconloader.h> |
5 | //#include <qpe/resource.h> | 6 | //#include <qpe/resource.h> |
6 | 7 | ||
7 | MailListViewItem::MailListViewItem(QListView * parent, MailListViewItem * item ) | 8 | MailListViewItem::MailListViewItem(QListView * parent, MailListViewItem * item ) |
8 | :QListViewItem(parent,item),mail_data() | 9 | :QListViewItem(parent,item),mail_data() |
9 | { | 10 | { |
10 | } | 11 | } |
11 | 12 | ||
12 | void MailListViewItem::showEntry() | 13 | void MailListViewItem::showEntry() |
13 | { | 14 | { |
14 | if ( mail_data->getFlags().testBit( FLAG_ANSWERED ) == true) { | 15 | if ( mail_data->getFlags().testBit( FLAG_ANSWERED ) == true) { |
15 | setPixmap( 0, SmallIcon ( "kmmsgreplied") ); | 16 | setPixmap( 0, SmallIcon ( "kmmsgreplied") ); |
16 | } else if ( mail_data->getFlags().testBit( FLAG_SEEN ) == true ) { | 17 | } else if ( mail_data->getFlags().testBit( FLAG_SEEN ) == true ) { |
17 | /* I think it looks nicer if there are not such a log of icons but only on mails | 18 | /* I think it looks nicer if there are not such a log of icons but only on mails |
18 | replied or new - Alwin*/ | 19 | replied or new - Alwin*/ |
19 | //setPixmap( 0,SmallIcon ("kmmsgunseen") ); | 20 | //setPixmap( 0,SmallIcon ("kmmsgunseen") ); |
20 | } else { | 21 | } else { |
21 | setPixmap( 0,SmallIcon ( "kmmsgnew") ); | 22 | setPixmap( 0,SmallIcon ( "kmmsgnew") ); |
22 | } | 23 | } |
23 | double s = mail_data->Msgsize(); | 24 | double s = mail_data->Msgsize(); |
24 | int w = 0; | 25 | int w = 0; |
25 | s/=1024; | 26 | s/=1024; |
26 | if (s>999.0) { | 27 | if (s>999.0) { |
27 | s/=1024.0; | 28 | s/=1024.0; |
28 | ++w; | 29 | ++w; |
29 | } | 30 | } |
30 | QString fsort; | 31 | QString fsort; |
31 | fsort.sprintf( "%.2f", s ); | 32 | fsort.sprintf( "%.2f", s ); |
32 | QString fsize = QString::number( s, 'f', 2 ); | 33 | QString fsize = QString::number( s, 'f', 2 ); |
33 | // 1.23 | 34 | // 1.23 |
34 | // 11.23 | 35 | // 11.23 |
35 | // 111.23 | 36 | // 111.23 |
36 | // 999.23 maxlen | 37 | // 999.23 maxlen |
37 | switch(fsize.length() ) { | 38 | switch(fsize.length() ) { |
38 | case 4: | 39 | case 4: |
39 | fsort = "00" + fsize ; | 40 | fsort = "00" + fsize ; |
40 | break; | 41 | break; |
41 | case 5: | 42 | case 5: |
42 | fsort = "0" + fsize ; | 43 | fsort = "0" + fsize ; |
43 | break; | 44 | break; |
44 | default: | 45 | default: |
45 | fsort = fsize ; | 46 | fsort = fsize ; |
46 | break; | 47 | break; |
47 | 48 | ||
48 | } | 49 | } |