Diffstat (limited to 'noncore/net/mail/mailistviewitem.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/mail/mailistviewitem.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/noncore/net/mail/mailistviewitem.cpp b/noncore/net/mail/mailistviewitem.cpp index 75633ef..0b926da 100644 --- a/noncore/net/mail/mailistviewitem.cpp +++ b/noncore/net/mail/mailistviewitem.cpp | |||
@@ -1,72 +1,72 @@ | |||
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 | 5 | ||
6 | MailListViewItem::MailListViewItem(QListView * parent, MailListViewItem * item ) | 6 | MailListViewItem::MailListViewItem(QListView * parent, MailListViewItem * item ) |
7 | :QListViewItem(parent,item),mail_data() | 7 | :QListViewItem(parent,item),mail_data() |
8 | { | 8 | { |
9 | } | 9 | } |
10 | 10 | ||
11 | void MailListViewItem::showEntry() | 11 | void MailListViewItem::showEntry() |
12 | { | 12 | { |
13 | if ( mail_data.getFlags().testBit( FLAG_ANSWERED ) == true) { | 13 | if ( mail_data->getFlags().testBit( FLAG_ANSWERED ) == true) { |
14 | setPixmap( 0, Resource::loadPixmap( "mail/kmmsgreplied") ); | 14 | setPixmap( 0, Resource::loadPixmap( "mail/kmmsgreplied") ); |
15 | } else if ( mail_data.getFlags().testBit( FLAG_SEEN ) == true ) { | 15 | } 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 | 16 | /* I think it looks nicer if there are not such a log of icons but only on mails |
17 | replied or new - Alwin*/ | 17 | replied or new - Alwin*/ |
18 | //setPixmap( 0, Resource::loadPixmap( "mail/kmmsgunseen") ); | 18 | //setPixmap( 0, Resource::loadPixmap( "mail/kmmsgunseen") ); |
19 | } else { | 19 | } else { |
20 | setPixmap( 0, Resource::loadPixmap( "mail/kmmsgnew") ); | 20 | setPixmap( 0, Resource::loadPixmap( "mail/kmmsgnew") ); |
21 | } | 21 | } |
22 | double s = mail_data.Msgsize(); | 22 | double s = mail_data->Msgsize(); |
23 | int w; | 23 | int w; |
24 | w=0; | 24 | w=0; |
25 | 25 | ||
26 | while (s>1024) { | 26 | while (s>1024) { |
27 | s/=1024; | 27 | s/=1024; |
28 | ++w; | 28 | ++w; |
29 | if (w>=2) break; | 29 | if (w>=2) break; |
30 | } | 30 | } |
31 | 31 | ||
32 | QString q=""; | 32 | QString q=""; |
33 | QString fsize=""; | 33 | QString fsize=""; |
34 | switch(w) { | 34 | switch(w) { |
35 | case 1: | 35 | case 1: |
36 | q="k"; | 36 | q="k"; |
37 | break; | 37 | break; |
38 | case 2: | 38 | case 2: |
39 | q="M"; | 39 | q="M"; |
40 | break; | 40 | break; |
41 | default: | 41 | default: |
42 | break; | 42 | break; |
43 | } | 43 | } |
44 | 44 | ||
45 | { | 45 | { |
46 | QTextOStream o(&fsize); | 46 | QTextOStream o(&fsize); |
47 | if (w>0) o.precision(2); else o.precision(0); | 47 | if (w>0) o.precision(2); else o.precision(0); |
48 | o.setf(QTextStream::fixed); | 48 | o.setf(QTextStream::fixed); |
49 | o << s << " " << q << "Byte"; | 49 | o << s << " " << q << "Byte"; |
50 | } | 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->getDate()); |
56 | } | 56 | } |
57 | 57 | ||
58 | void MailListViewItem::storeData(const RecMail&data) | 58 | void MailListViewItem::storeData(const RecMailP&data) |
59 | { | 59 | { |
60 | mail_data = data; | 60 | mail_data = data; |
61 | } | 61 | } |
62 | 62 | ||
63 | const RecMail& MailListViewItem::data()const | 63 | const RecMailP& MailListViewItem::data()const |
64 | { | 64 | { |
65 | return mail_data; | 65 | return mail_data; |
66 | } | 66 | } |
67 | 67 | ||
68 | MAILLIB::ATYPE MailListViewItem::wrapperType() | 68 | MAILLIB::ATYPE MailListViewItem::wrapperType() |
69 | { | 69 | { |
70 | if (!mail_data.Wrapper()) return MAILLIB::A_UNDEFINED; | 70 | if (!mail_data->Wrapper()) return MAILLIB::A_UNDEFINED; |
71 | return mail_data.Wrapper()->getType(); | 71 | return mail_data->Wrapper()->getType(); |
72 | } | 72 | } |