summaryrefslogtreecommitdiff
path: root/noncore/net/mail/viewmail.cpp
Side-by-side diff
Diffstat (limited to 'noncore/net/mail/viewmail.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/viewmail.cpp32
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 @@
-AttachItem::AttachItem(QListView * parent,QListViewItem *after, const QString&mime,const QString&file,const QString&desc,int num)
+AttachItem::AttachItem(QListView * parent,QListViewItem *after, const QString&mime,const QString&desc,const QString&file,
+ const QString&fsize,int num)
: QListViewItem(parent,after),_partNum(num)
@@ -19,4 +20,5 @@ AttachItem::AttachItem(QListView * parent,QListViewItem *after, const QString&mi
setText(0, mime);
- setText(1, file);
- setText(2, desc);
+ setText(1, desc);
+ setText(2, file);
+ setText(3, fsize);
}
@@ -34,3 +36,3 @@ AttachItem * curItem=0;
QString type=body.Description().Type()+"/"+body.Description().Subtype();
-QString desc;
+QString desc,fsize;
double s = body.Description().Size();
@@ -63,3 +65,3 @@ default:
*/
- QTextOStream o(&desc);
+ QTextOStream o(&fsize);
if (w>0) o.precision(2); else o.precision(0);
@@ -69,3 +71,3 @@ default:
-curItem=new AttachItem(attachments,curItem,type,"Mailbody",desc,-1);
+curItem=new AttachItem(attachments,curItem,type,"Mailbody","",fsize,-1);
QString filename = "";
@@ -75,2 +77,3 @@ for (unsigned int i = 0; i < body.Parts().count();++i) {
for (;it!=body.Parts()[i].Parameters().end();++it) {
+ qDebug(it.key());
if (it.key().lower()=="name") {
@@ -97,3 +100,3 @@ for (unsigned int i = 0; i < body.Parts().count();++i) {
}
- QTextOStream o(&desc);
+ QTextOStream o(&fsize);
if (w>0) o.precision(2); else o.precision(0);
@@ -101,3 +104,4 @@ for (unsigned int i = 0; i < body.Parts().count();++i) {
o << s << " " << q << "Byte";
- curItem=new AttachItem(attachments,curItem,type,filename,desc,i);
+ desc = body.Parts()[i].Description();
+ curItem=new AttachItem(attachments,curItem,type,desc,filename,fsize,i);
}
@@ -105,3 +109,3 @@ for (unsigned int i = 0; i < body.Parts().count();++i) {
-void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int c ) {
+void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int ) {
if (!item )
@@ -109,6 +113,10 @@ void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int
- QPopupMenu *menu = new QPopupMenu();
+ if ( ( ( AttachItem* )item )->Partnumber() == -1 ) {
+ setText();
+ return;
+ }
+ QPopupMenu *menu = new QPopupMenu();
int ret=0;
- if ( item->text( 0 ).left( 4 ) == "text" ) {
+ if ( item->text( 0 ).left( 5 ) == "text/" ) {
menu->insertItem( tr( "Show Text" ), 1 );
@@ -125,3 +133,3 @@ void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int
QString str = OFileDialog::getSaveFileName( 1,
- "/", item->text( 1 ) , types, 0 );
+ "/", item->text( 2 ) , types, 0 );