Diffstat (limited to 'noncore/net/mail/viewmail.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/mail/viewmail.cpp | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/noncore/net/mail/viewmail.cpp b/noncore/net/mail/viewmail.cpp index 68d3c51..48b71eb 100644 --- a/noncore/net/mail/viewmail.cpp +++ b/noncore/net/mail/viewmail.cpp | |||
@@ -15,3 +15,4 @@ | |||
15 | 15 | ||
16 | AttachItem::AttachItem(QListView * parent,QListViewItem *after, const QString&mime,const QString&file,const QString&desc,int num) | 16 | AttachItem::AttachItem(QListView * parent,QListViewItem *after, const QString&mime,const QString&desc,const QString&file, |
17 | const QString&fsize,int num) | ||
17 | : QListViewItem(parent,after),_partNum(num) | 18 | : QListViewItem(parent,after),_partNum(num) |
@@ -19,4 +20,5 @@ AttachItem::AttachItem(QListView * parent,QListViewItem *after, const QString&mi | |||
19 | setText(0, mime); | 20 | setText(0, mime); |
20 | setText(1, file); | 21 | setText(1, desc); |
21 | setText(2, desc); | 22 | setText(2, file); |
23 | setText(3, fsize); | ||
22 | } | 24 | } |
@@ -34,3 +36,3 @@ AttachItem * curItem=0; | |||
34 | QString type=body.Description().Type()+"/"+body.Description().Subtype(); | 36 | QString type=body.Description().Type()+"/"+body.Description().Subtype(); |
35 | QString desc; | 37 | QString desc,fsize; |
36 | double s = body.Description().Size(); | 38 | double s = body.Description().Size(); |
@@ -63,3 +65,3 @@ default: | |||
63 | */ | 65 | */ |
64 | QTextOStream o(&desc); | 66 | QTextOStream o(&fsize); |
65 | if (w>0) o.precision(2); else o.precision(0); | 67 | if (w>0) o.precision(2); else o.precision(0); |
@@ -69,3 +71,3 @@ default: | |||
69 | 71 | ||
70 | curItem=new AttachItem(attachments,curItem,type,"Mailbody",desc,-1); | 72 | curItem=new AttachItem(attachments,curItem,type,"Mailbody","",fsize,-1); |
71 | QString filename = ""; | 73 | QString filename = ""; |
@@ -75,2 +77,3 @@ for (unsigned int i = 0; i < body.Parts().count();++i) { | |||
75 | for (;it!=body.Parts()[i].Parameters().end();++it) { | 77 | for (;it!=body.Parts()[i].Parameters().end();++it) { |
78 | qDebug(it.key()); | ||
76 | if (it.key().lower()=="name") { | 79 | if (it.key().lower()=="name") { |
@@ -97,3 +100,3 @@ for (unsigned int i = 0; i < body.Parts().count();++i) { | |||
97 | } | 100 | } |
98 | QTextOStream o(&desc); | 101 | QTextOStream o(&fsize); |
99 | if (w>0) o.precision(2); else o.precision(0); | 102 | if (w>0) o.precision(2); else o.precision(0); |
@@ -101,3 +104,4 @@ for (unsigned int i = 0; i < body.Parts().count();++i) { | |||
101 | o << s << " " << q << "Byte"; | 104 | o << s << " " << q << "Byte"; |
102 | curItem=new AttachItem(attachments,curItem,type,filename,desc,i); | 105 | desc = body.Parts()[i].Description(); |
106 | curItem=new AttachItem(attachments,curItem,type,desc,filename,fsize,i); | ||
103 | } | 107 | } |
@@ -105,3 +109,3 @@ for (unsigned int i = 0; i < body.Parts().count();++i) { | |||
105 | 109 | ||
106 | void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int c ) { | 110 | void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int ) { |
107 | if (!item ) | 111 | if (!item ) |
@@ -109,6 +113,10 @@ void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int | |||
109 | 113 | ||
110 | QPopupMenu *menu = new QPopupMenu(); | 114 | if ( ( ( AttachItem* )item )->Partnumber() == -1 ) { |
115 | setText(); | ||
116 | return; | ||
117 | } | ||
118 | QPopupMenu *menu = new QPopupMenu(); | ||
111 | int ret=0; | 119 | int ret=0; |
112 | 120 | ||
113 | if ( item->text( 0 ).left( 4 ) == "text" ) { | 121 | if ( item->text( 0 ).left( 5 ) == "text/" ) { |
114 | menu->insertItem( tr( "Show Text" ), 1 ); | 122 | menu->insertItem( tr( "Show Text" ), 1 ); |
@@ -125,3 +133,3 @@ void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int | |||
125 | QString str = OFileDialog::getSaveFileName( 1, | 133 | QString str = OFileDialog::getSaveFileName( 1, |
126 | "/", item->text( 1 ) , types, 0 ); | 134 | "/", item->text( 2 ) , types, 0 ); |
127 | 135 | ||