-rw-r--r-- | noncore/net/mail/imapwrapper.cpp | 5 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/imapwrapper.cpp | 5 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/mailtypes.cpp | 12 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/mailtypes.h | 4 | ||||
-rw-r--r-- | noncore/net/mail/mailtypes.cpp | 12 | ||||
-rw-r--r-- | noncore/net/mail/mailtypes.h | 4 | ||||
-rw-r--r-- | noncore/net/mail/mainwindow.cpp | 4 | ||||
-rw-r--r-- | noncore/net/mail/viewmail.cpp | 32 | ||||
-rw-r--r-- | noncore/net/mail/viewmail.h | 3 | ||||
-rw-r--r-- | noncore/net/mail/viewmailbase.cpp | 5 |
10 files changed, 64 insertions, 22 deletions
diff --git a/noncore/net/mail/imapwrapper.cpp b/noncore/net/mail/imapwrapper.cpp index 0ce2c6c..ad95384 100644 --- a/noncore/net/mail/imapwrapper.cpp +++ b/noncore/net/mail/imapwrapper.cpp | |||
@@ -697,4 +697,7 @@ void IMAPwrapper::fillBodyFields(RecPart&target_part,mailimap_body_fields*which) | |||
697 | } | 697 | } |
698 | } | 698 | } |
699 | if (which->bd_description) { | ||
700 | target_part.setDescription(QString(which->bd_description)); | ||
701 | } | ||
699 | target_part.setEncoding(encoding); | 702 | target_part.setEncoding(encoding); |
700 | target_part.setSize(which->bd_size); | 703 | target_part.setSize(which->bd_size); |
@@ -761,5 +764,5 @@ void IMAPwrapper::answeredMail(const RecMail&mail) | |||
761 | flist = mailimap_flag_list_new_empty(); | 764 | flist = mailimap_flag_list_new_empty(); |
762 | mailimap_flag_list_add(flist,mailimap_flag_new_answered()); | 765 | mailimap_flag_list_add(flist,mailimap_flag_new_answered()); |
763 | store_flags = mailimap_store_att_flags_new_set_flags(flist); | 766 | store_flags = mailimap_store_att_flags_new_add_flags(flist); |
764 | set = mailimap_set_new_single(mail.getNumber()); | 767 | set = mailimap_set_new_single(mail.getNumber()); |
765 | err = mailimap_store(m_imap,set,store_flags); | 768 | err = mailimap_store(m_imap,set,store_flags); |
diff --git a/noncore/net/mail/libmailwrapper/imapwrapper.cpp b/noncore/net/mail/libmailwrapper/imapwrapper.cpp index 0ce2c6c..ad95384 100644 --- a/noncore/net/mail/libmailwrapper/imapwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/imapwrapper.cpp | |||
@@ -697,4 +697,7 @@ void IMAPwrapper::fillBodyFields(RecPart&target_part,mailimap_body_fields*which) | |||
697 | } | 697 | } |
698 | } | 698 | } |
699 | if (which->bd_description) { | ||
700 | target_part.setDescription(QString(which->bd_description)); | ||
701 | } | ||
699 | target_part.setEncoding(encoding); | 702 | target_part.setEncoding(encoding); |
700 | target_part.setSize(which->bd_size); | 703 | target_part.setSize(which->bd_size); |
@@ -761,5 +764,5 @@ void IMAPwrapper::answeredMail(const RecMail&mail) | |||
761 | flist = mailimap_flag_list_new_empty(); | 764 | flist = mailimap_flag_list_new_empty(); |
762 | mailimap_flag_list_add(flist,mailimap_flag_new_answered()); | 765 | mailimap_flag_list_add(flist,mailimap_flag_new_answered()); |
763 | store_flags = mailimap_store_att_flags_new_set_flags(flist); | 766 | store_flags = mailimap_store_att_flags_new_add_flags(flist); |
764 | set = mailimap_set_new_single(mail.getNumber()); | 767 | set = mailimap_set_new_single(mail.getNumber()); |
765 | err = mailimap_store(m_imap,set,store_flags); | 768 | err = mailimap_store(m_imap,set,store_flags); |
diff --git a/noncore/net/mail/libmailwrapper/mailtypes.cpp b/noncore/net/mail/libmailwrapper/mailtypes.cpp index 94f5d6f..8d9b247 100644 --- a/noncore/net/mail/libmailwrapper/mailtypes.cpp +++ b/noncore/net/mail/libmailwrapper/mailtypes.cpp | |||
@@ -86,5 +86,5 @@ const QStringList& RecMail::Bcc()const | |||
86 | 86 | ||
87 | RecPart::RecPart() | 87 | RecPart::RecPart() |
88 | : m_type(""),m_subtype(""),m_identifier(""),m_encoding(""),m_lines(0),m_size(0) | 88 | : m_type(""),m_subtype(""),m_identifier(""),m_encoding(""),m_description(""),m_lines(0),m_size(0) |
89 | { | 89 | { |
90 | m_Parameters.clear(); | 90 | m_Parameters.clear(); |
@@ -156,4 +156,14 @@ void RecPart::setEncoding(const QString&encoding) | |||
156 | } | 156 | } |
157 | 157 | ||
158 | const QString& RecPart::Description()const | ||
159 | { | ||
160 | return m_description; | ||
161 | } | ||
162 | |||
163 | void RecPart::setDescription(const QString&desc) | ||
164 | { | ||
165 | m_description = desc; | ||
166 | } | ||
167 | |||
158 | void RecPart::setParameters(const part_plist_t&list) | 168 | void RecPart::setParameters(const part_plist_t&list) |
159 | { | 169 | { |
diff --git a/noncore/net/mail/libmailwrapper/mailtypes.h b/noncore/net/mail/libmailwrapper/mailtypes.h index 9ef762d..7d7bebc 100644 --- a/noncore/net/mail/libmailwrapper/mailtypes.h +++ b/noncore/net/mail/libmailwrapper/mailtypes.h | |||
@@ -81,5 +81,5 @@ class RecPart | |||
81 | { | 81 | { |
82 | protected: | 82 | protected: |
83 | QString m_type,m_subtype,m_identifier,m_encoding; | 83 | QString m_type,m_subtype,m_identifier,m_encoding,m_description; |
84 | unsigned int m_lines,m_size; | 84 | unsigned int m_lines,m_size; |
85 | part_plist_t m_Parameters; | 85 | part_plist_t m_Parameters; |
@@ -99,4 +99,6 @@ public: | |||
99 | const QString&Encoding()const; | 99 | const QString&Encoding()const; |
100 | void setEncoding(const QString&encoding); | 100 | void setEncoding(const QString&encoding); |
101 | const QString&Description()const; | ||
102 | void setDescription(const QString&desc); | ||
101 | void setLines(unsigned int lines); | 103 | void setLines(unsigned int lines); |
102 | const unsigned int Lines()const; | 104 | const unsigned int Lines()const; |
diff --git a/noncore/net/mail/mailtypes.cpp b/noncore/net/mail/mailtypes.cpp index 94f5d6f..8d9b247 100644 --- a/noncore/net/mail/mailtypes.cpp +++ b/noncore/net/mail/mailtypes.cpp | |||
@@ -86,5 +86,5 @@ const QStringList& RecMail::Bcc()const | |||
86 | 86 | ||
87 | RecPart::RecPart() | 87 | RecPart::RecPart() |
88 | : m_type(""),m_subtype(""),m_identifier(""),m_encoding(""),m_lines(0),m_size(0) | 88 | : m_type(""),m_subtype(""),m_identifier(""),m_encoding(""),m_description(""),m_lines(0),m_size(0) |
89 | { | 89 | { |
90 | m_Parameters.clear(); | 90 | m_Parameters.clear(); |
@@ -156,4 +156,14 @@ void RecPart::setEncoding(const QString&encoding) | |||
156 | } | 156 | } |
157 | 157 | ||
158 | const QString& RecPart::Description()const | ||
159 | { | ||
160 | return m_description; | ||
161 | } | ||
162 | |||
163 | void RecPart::setDescription(const QString&desc) | ||
164 | { | ||
165 | m_description = desc; | ||
166 | } | ||
167 | |||
158 | void RecPart::setParameters(const part_plist_t&list) | 168 | void RecPart::setParameters(const part_plist_t&list) |
159 | { | 169 | { |
diff --git a/noncore/net/mail/mailtypes.h b/noncore/net/mail/mailtypes.h index 9ef762d..7d7bebc 100644 --- a/noncore/net/mail/mailtypes.h +++ b/noncore/net/mail/mailtypes.h | |||
@@ -81,5 +81,5 @@ class RecPart | |||
81 | { | 81 | { |
82 | protected: | 82 | protected: |
83 | QString m_type,m_subtype,m_identifier,m_encoding; | 83 | QString m_type,m_subtype,m_identifier,m_encoding,m_description; |
84 | unsigned int m_lines,m_size; | 84 | unsigned int m_lines,m_size; |
85 | part_plist_t m_Parameters; | 85 | part_plist_t m_Parameters; |
@@ -99,4 +99,6 @@ public: | |||
99 | const QString&Encoding()const; | 99 | const QString&Encoding()const; |
100 | void setEncoding(const QString&encoding); | 100 | void setEncoding(const QString&encoding); |
101 | const QString&Description()const; | ||
102 | void setDescription(const QString&desc); | ||
101 | void setLines(unsigned int lines); | 103 | void setLines(unsigned int lines); |
102 | const unsigned int Lines()const; | 104 | const unsigned int Lines()const; |
diff --git a/noncore/net/mail/mainwindow.cpp b/noncore/net/mail/mainwindow.cpp index fae3e97..8e2132e 100644 --- a/noncore/net/mail/mainwindow.cpp +++ b/noncore/net/mail/mainwindow.cpp | |||
@@ -200,5 +200,7 @@ MailListViewItem::MailListViewItem(QListView * parent, MailListViewItem * item ) | |||
200 | void MailListViewItem::showEntry() | 200 | void MailListViewItem::showEntry() |
201 | { | 201 | { |
202 | if ( mail_data.getFlags().testBit( FLAG_SEEN ) == true ) { | 202 | if ( mail_data.getFlags().testBit( FLAG_ANSWERED ) == true) { |
203 | setPixmap( 0, Resource::loadPixmap( "opiemail/kmmsgreplied") ); | ||
204 | } else if ( mail_data.getFlags().testBit( FLAG_SEEN ) == true ) { | ||
203 | setPixmap( 0, Resource::loadPixmap( "opiemail/kmmsgunseen") ); | 205 | setPixmap( 0, Resource::loadPixmap( "opiemail/kmmsgunseen") ); |
204 | } else { | 206 | } else { |
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 | |||
@@ -14,10 +14,12 @@ | |||
14 | #include "accountview.h" | 14 | #include "accountview.h" |
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) |
18 | { | 19 | { |
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 | } |
23 | 25 | ||
@@ -33,5 +35,5 @@ if (body.Parts().count()==0) { | |||
33 | AttachItem * curItem=0; | 35 | 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(); |
37 | int w; | 39 | int w; |
@@ -62,5 +64,5 @@ default: | |||
62 | code is it will be destructed after finishing its small job. | 64 | code is it will be destructed after finishing its small job. |
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); |
66 | o.setf(QTextStream::fixed); | 68 | o.setf(QTextStream::fixed); |
@@ -68,5 +70,5 @@ default: | |||
68 | } | 70 | } |
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 = ""; |
72 | for (unsigned int i = 0; i < body.Parts().count();++i) { | 74 | for (unsigned int i = 0; i < body.Parts().count();++i) { |
@@ -74,4 +76,5 @@ for (unsigned int i = 0; i < body.Parts().count();++i) { | |||
74 | part_plist_t::ConstIterator it = body.Parts()[i].Parameters().begin(); | 76 | part_plist_t::ConstIterator it = body.Parts()[i].Parameters().begin(); |
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") { |
77 | filename=it.data(); | 80 | filename=it.data(); |
@@ -96,20 +99,25 @@ for (unsigned int i = 0; i < body.Parts().count();++i) { | |||
96 | break; | 99 | break; |
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); |
100 | o.setf(QTextStream::fixed); | 103 | o.setf(QTextStream::fixed); |
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 | } |
104 | } | 108 | } |
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 ) |
108 | return; | 112 | return; |
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 ); |
115 | } | 123 | } |
@@ -124,5 +132,5 @@ void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int | |||
124 | types.insert( "all", "*" ); | 132 | types.insert( "all", "*" ); |
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 | ||
128 | if( !str.isEmpty() ) { | 136 | if( !str.isEmpty() ) { |
diff --git a/noncore/net/mail/viewmail.h b/noncore/net/mail/viewmail.h index 765464c..dd7f854 100644 --- a/noncore/net/mail/viewmail.h +++ b/noncore/net/mail/viewmail.h | |||
@@ -12,5 +12,6 @@ class AttachItem : public QListViewItem | |||
12 | { | 12 | { |
13 | public: | 13 | public: |
14 | AttachItem(QListView * parent,QListViewItem *after, const QString&mime,const QString&file,const QString&desc,int num); | 14 | AttachItem(QListView * parent,QListViewItem *after, const QString&mime,const QString&desc,const QString&file, |
15 | const QString&fsize,int num); | ||
15 | int Partnumber() { return _partNum; } | 16 | int Partnumber() { return _partNum; } |
16 | 17 | ||
diff --git a/noncore/net/mail/viewmailbase.cpp b/noncore/net/mail/viewmailbase.cpp index 38f92b4..0c7f671 100644 --- a/noncore/net/mail/viewmailbase.cpp +++ b/noncore/net/mail/viewmailbase.cpp | |||
@@ -56,6 +56,7 @@ ViewMailBase::ViewMailBase(QWidget *parent, const char *name, WFlags fl) | |||
56 | attachments->setAllColumnsShowFocus(true); | 56 | attachments->setAllColumnsShowFocus(true); |
57 | attachments->addColumn("Mime Type", 60); | 57 | attachments->addColumn("Mime Type", 60); |
58 | attachments->addColumn(tr("Filename"), 100); | 58 | attachments->addColumn(tr("Description"), 100); |
59 | attachments->addColumn(tr("Size"), 80); | 59 | attachments->addColumn(tr("Filename"), 80); |
60 | attachments->addColumn(tr("Size"), 80); | ||
60 | attachments->setSorting(-1); | 61 | attachments->setSorting(-1); |
61 | attachments->hide(); | 62 | attachments->hide(); |