author | alwin <alwin> | 2004-01-02 01:10:54 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-01-02 01:10:54 (UTC) |
commit | afca439e790b2a6261679fffa42c7eaa2b295824 (patch) (unidiff) | |
tree | 3c22f4e3cd5d210f1c2f6554f3c8673450550fa1 | |
parent | 6bde04710d84fe2c5369c895bd784e9d81754550 (diff) | |
download | opie-afca439e790b2a6261679fffa42c7eaa2b295824.zip opie-afca439e790b2a6261679fffa42c7eaa2b295824.tar.gz opie-afca439e790b2a6261679fffa42c7eaa2b295824.tar.bz2 |
rfc822 messages are displayed as text, too.
-rw-r--r-- | noncore/net/mail/viewmail.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/net/mail/viewmail.cpp b/noncore/net/mail/viewmail.cpp index 0ad7359..d2e5e29 100644 --- a/noncore/net/mail/viewmail.cpp +++ b/noncore/net/mail/viewmail.cpp | |||
@@ -107,49 +107,49 @@ for (unsigned int i = 0; i < body.Parts().count();++i) { | |||
107 | o.setf(QTextStream::fixed); | 107 | o.setf(QTextStream::fixed); |
108 | o << s << " " << q << "Byte"; | 108 | o << s << " " << q << "Byte"; |
109 | desc = body.Parts()[i].Description(); | 109 | desc = body.Parts()[i].Description(); |
110 | curItem=new AttachItem(attachments,curItem,type,desc,filename,fsize,i); | 110 | curItem=new AttachItem(attachments,curItem,type,desc,filename,fsize,i); |
111 | } | 111 | } |
112 | } | 112 | } |
113 | 113 | ||
114 | 114 | ||
115 | void ViewMail::slotShowHtml( bool state ) { | 115 | void ViewMail::slotShowHtml( bool state ) { |
116 | m_showHtml = state; | 116 | m_showHtml = state; |
117 | setText(); | 117 | setText(); |
118 | } | 118 | } |
119 | 119 | ||
120 | void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int ) { | 120 | void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int ) { |
121 | if (!item ) | 121 | if (!item ) |
122 | return; | 122 | return; |
123 | 123 | ||
124 | if ( ( ( AttachItem* )item )->Partnumber() == -1 ) { | 124 | if ( ( ( AttachItem* )item )->Partnumber() == -1 ) { |
125 | setText(); | 125 | setText(); |
126 | return; | 126 | return; |
127 | } | 127 | } |
128 | QPopupMenu *menu = new QPopupMenu(); | 128 | QPopupMenu *menu = new QPopupMenu(); |
129 | int ret=0; | 129 | int ret=0; |
130 | 130 | ||
131 | if ( item->text( 0 ).left( 5 ) == "text/" ) { | 131 | if ( item->text( 0 ).left( 5 ) == "text/" || item->text(0)=="message/rfc822" ) { |
132 | menu->insertItem( tr( "Show Text" ), 1 ); | 132 | menu->insertItem( tr( "Show Text" ), 1 ); |
133 | } | 133 | } |
134 | menu->insertItem( tr( "Save Attachment" ), 0 ); | 134 | menu->insertItem( tr( "Save Attachment" ), 0 ); |
135 | menu->insertSeparator(1); | 135 | menu->insertSeparator(1); |
136 | 136 | ||
137 | ret = menu->exec( point, 0 ); | 137 | ret = menu->exec( point, 0 ); |
138 | 138 | ||
139 | switch(ret) { | 139 | switch(ret) { |
140 | case 0: | 140 | case 0: |
141 | { MimeTypes types; | 141 | { MimeTypes types; |
142 | types.insert( "all", "*" ); | 142 | types.insert( "all", "*" ); |
143 | QString str = OFileDialog::getSaveFileName( 1, | 143 | QString str = OFileDialog::getSaveFileName( 1, |
144 | "/", item->text( 2 ) , types, 0 ); | 144 | "/", item->text( 2 ) , types, 0 ); |
145 | 145 | ||
146 | if( !str.isEmpty() ) { | 146 | if( !str.isEmpty() ) { |
147 | encodedString*content = m_recMail.Wrapper()->fetchDecodedPart( m_recMail, m_body.Parts()[ ( ( AttachItem* )item )->Partnumber() ] ); | 147 | encodedString*content = m_recMail.Wrapper()->fetchDecodedPart( m_recMail, m_body.Parts()[ ( ( AttachItem* )item )->Partnumber() ] ); |
148 | if (content) { | 148 | if (content) { |
149 | QFile output(str); | 149 | QFile output(str); |
150 | output.open(IO_WriteOnly); | 150 | output.open(IO_WriteOnly); |
151 | output.writeBlock(content->Content(),content->Length()); | 151 | output.writeBlock(content->Content(),content->Length()); |
152 | output.close(); | 152 | output.close(); |
153 | delete content; | 153 | delete content; |
154 | } | 154 | } |
155 | } | 155 | } |