summaryrefslogtreecommitdiff
authoralwin <alwin>2004-01-02 01:10:54 (UTC)
committer alwin <alwin>2004-01-02 01:10:54 (UTC)
commitafca439e790b2a6261679fffa42c7eaa2b295824 (patch) (side-by-side diff)
tree3c22f4e3cd5d210f1c2f6554f3c8673450550fa1
parent6bde04710d84fe2c5369c895bd784e9d81754550 (diff)
downloadopie-afca439e790b2a6261679fffa42c7eaa2b295824.zip
opie-afca439e790b2a6261679fffa42c7eaa2b295824.tar.gz
opie-afca439e790b2a6261679fffa42c7eaa2b295824.tar.bz2
rfc822 messages are displayed as text, too.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/viewmail.cpp2
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
@@ -83,97 +83,97 @@ for (unsigned int i = 0; i < body.Parts().count();++i) {
if (it.key().lower()=="name") {
filename=it.data();
}
}
s = body.Parts()[i].Size();
w = 0;
while (s>1024) {
s/=1024;
++w;
if (w>=2) break;
}
switch(w) {
case 1:
q="k";
break;
case 2:
q="M";
break;
default:
q="";
break;
}
QTextOStream o(&fsize);
if (w>0) o.precision(2); else o.precision(0);
o.setf(QTextStream::fixed);
o << s << " " << q << "Byte";
desc = body.Parts()[i].Description();
curItem=new AttachItem(attachments,curItem,type,desc,filename,fsize,i);
}
}
void ViewMail::slotShowHtml( bool state ) {
m_showHtml = state;
setText();
}
void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int ) {
if (!item )
return;
if ( ( ( AttachItem* )item )->Partnumber() == -1 ) {
setText();
return;
}
QPopupMenu *menu = new QPopupMenu();
int ret=0;
- if ( item->text( 0 ).left( 5 ) == "text/" ) {
+ if ( item->text( 0 ).left( 5 ) == "text/" || item->text(0)=="message/rfc822" ) {
menu->insertItem( tr( "Show Text" ), 1 );
}
menu->insertItem( tr( "Save Attachment" ), 0 );
menu->insertSeparator(1);
ret = menu->exec( point, 0 );
switch(ret) {
case 0:
{ MimeTypes types;
types.insert( "all", "*" );
QString str = OFileDialog::getSaveFileName( 1,
"/", item->text( 2 ) , types, 0 );
if( !str.isEmpty() ) {
encodedString*content = m_recMail.Wrapper()->fetchDecodedPart( m_recMail, m_body.Parts()[ ( ( AttachItem* )item )->Partnumber() ] );
if (content) {
QFile output(str);
output.open(IO_WriteOnly);
output.writeBlock(content->Content(),content->Length());
output.close();
delete content;
}
}
}
break ;
case 1:
if ( ( ( AttachItem* )item )->Partnumber() == -1 ) {
setText();
} else {
if ( m_recMail.Wrapper() != 0l ) { // make sure that there is a wrapper , even after delete or simular actions
browser->setText( m_recMail.Wrapper()->fetchTextPart( m_recMail, m_body.Parts()[ ( ( AttachItem* )item )->Partnumber() ] ) );
}
}
break;
}
delete menu;
}
void ViewMail::setMail( RecMail mail ) {
m_recMail = mail;
m_mail[0] = mail.getFrom();
m_mail[1] = mail.getSubject();
m_mail[3] = mail.getDate();