-rw-r--r-- | noncore/net/mail/viewmail.cpp | 6 | ||||
-rw-r--r-- | noncore/net/mail/viewmail.h | 1 |
2 files changed, 5 insertions, 2 deletions
diff --git a/noncore/net/mail/viewmail.cpp b/noncore/net/mail/viewmail.cpp index c24d5d3..a73dac5 100644 --- a/noncore/net/mail/viewmail.cpp +++ b/noncore/net/mail/viewmail.cpp @@ -1,28 +1,29 @@ #include <qtextbrowser.h> #include <qmessagebox.h> #include <qtextstream.h> #include <qaction.h> #include <qpopupmenu.h> #include <qapplication.h> #include <opie/ofiledialog.h> #include "settings.h" #include "composemail.h" #include "viewmail.h" +#include "abstractmail.h" AttachItem::AttachItem(QListView * parent,QListViewItem *after, const QString&mime,const QString&file,const QString&desc,int num) : QListViewItem(parent,after),_partNum(num) { setText(0, mime); setText(1, file); setText(2, desc); } void ViewMail::setBody( RecBody body ) { m_body = body; m_mail[2] = body.Bodytext(); attachbutton->setEnabled(body.Parts().count()>0); attachments->setEnabled(body.Parts().count()>0); if (body.Parts().count()==0) { @@ -117,47 +118,48 @@ void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int ret = menu->exec( point, 0 ); switch(ret) { case 0: { MimeTypes types; types.insert( "all", "*" ); QString str = OFileDialog::getSaveFileName( 1, "/", item->text( 1 ) , types, 0 ); if( !str.isEmpty() ) { qDebug( " first we will need a MIME wrapper" ); } } break ; case 1: - qDebug( QString( "Test selected" ).arg( ( ( AttachItem* )item )->Partnumber() ) ); if ( ( ( AttachItem* )item )->Partnumber() == -1 ) { setText(); } else { - browser->setText( ( m_body.Parts()[( ( AttachItem* )item )->Partnumber() ] ).Identifier() ); + browser->setText( m_recMail.Wrapper()->fetchPart( 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(); m_mail[4] = mail.Msgid(); m_mail2[0] = mail.To(); m_mail2[1] = mail.CC(); m_mail2[2] = mail.Bcc(); setText(); } ViewMail::ViewMail( QWidget *parent, const char *name, WFlags fl) : ViewMailBase(parent, name, fl), _inLoop(false) diff --git a/noncore/net/mail/viewmail.h b/noncore/net/mail/viewmail.h index 0e85839..bc12da1 100644 --- a/noncore/net/mail/viewmail.h +++ b/noncore/net/mail/viewmail.h @@ -32,25 +32,26 @@ public: void setBody( RecBody body ); protected: QString deHtml(const QString &string); protected slots: void slotReply(); void slotForward(); void setText(); void slotItemClicked( QListViewItem * item , const QPoint & point, int c ); private: bool _inLoop; QString m_mailHtml; bool m_gotBody; RecBody m_body; + RecMail m_recMail; // 0 from 1 subject 2 bodytext 3 date QMap <int,QString> m_mail; // 0 to 1 cc 2 bcc QMap <int,QStringList> m_mail2; }; #endif |