summaryrefslogtreecommitdiff
path: root/noncore/net/mail/viewmail.cpp
Unidiff
Diffstat (limited to 'noncore/net/mail/viewmail.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/viewmail.cpp39
1 files changed, 27 insertions, 12 deletions
diff --git a/noncore/net/mail/viewmail.cpp b/noncore/net/mail/viewmail.cpp
index b648b34..cba9948 100644
--- a/noncore/net/mail/viewmail.cpp
+++ b/noncore/net/mail/viewmail.cpp
@@ -20,20 +20,21 @@ AttachItem::AttachItem(QListViewItem *parent, AttachItemStore &attachItemStore)
20{ 20{
21 setText(0, _attachItemStore.mimeType()); 21 setText(0, _attachItemStore.mimeType());
22 setText(1, _attachItemStore.fileName()); 22 setText(1, _attachItemStore.fileName());
23 setText(2, _attachItemStore.description()); 23 setText(2, _attachItemStore.description());
24} 24}
25 25
26void ViewMail::setMailInfo( const QString & from, const QString & to, const QString & subject, const QString & cc, const QString & bcc, const QString & bodytext ) { 26void ViewMail::setMailInfo( const QString & from, const QStringList & to, const QString & subject, const QStringList & cc, const QStringList & bcc, const QString & date, const QString & bodytext ) {
27 27
28m_mail[0] = from; 28m_mail[0] = from;
29m_mail[1] = to; 29m_mail2[0] = to;
30m_mail[2] = subject; 30m_mail[1] = subject;
31m_mail[3] = cc; 31m_mail2[1] = cc;
32m_mail[4] = bcc; 32m_mail2[2] = bcc;
33m_mail[5] = bodytext; 33m_mail[2] = bodytext;
34m_mail[3] = date;
34 35
35setText(); 36setText();
36 37
37} 38}
38 39
39 40
@@ -51,31 +52,45 @@ ViewMail::ViewMail( QWidget *parent, const char *name, WFlags fl)
51 //connect(_handler, SIGNAL(gotResponse(IMAPResponse &)), SLOT(slotIMAPUid(IMAPResponse &))); 52 //connect(_handler, SIGNAL(gotResponse(IMAPResponse &)), SLOT(slotIMAPUid(IMAPResponse &)));
52} 53}
53 54
54void ViewMail::setText() 55void ViewMail::setText()
55{ 56{
56 57
58 QString toString;
59 QString ccString;
60 QString bccString;
61
62 for ( QStringList::Iterator it = ( m_mail2[0] ).begin(); it != ( m_mail2[0] ).end(); ++it ) {
63 toString += (*it);
64 }
65 for ( QStringList::Iterator it = ( m_mail2[1] ).begin(); it != ( m_mail2[1] ).end(); ++it ) {
66 ccString += (*it);
67 }
68 for ( QStringList::Iterator it = ( m_mail2[2] ).begin(); it != ( m_mail2[2] ).end(); ++it ) {
69 bccString += (*it);
70 }
71
57 setCaption( caption().arg( m_mail[0] ) ); 72 setCaption( caption().arg( m_mail[0] ) );
58 73
59 _mailHtml = tr( 74 _mailHtml = tr(
60 "<html><body>" 75 "<html><body>"
61 "<div align=center><b>%1</b></div>" 76 "<div align=center><b>%1</b></div>"
62 "<b>From:</b> %2<br>" 77 "<b>From:</b> %2<br>"
63 "<b>To:</b> %3<br>" 78 "<b>To:</b> %3<br>"
64 "%4" 79 "%4"
65 "%5" 80 "%5"
66 "<b>Date:</b> %6<hr>" 81 "<b>Date:</b> %6<hr>"
67 "<font face=fixed>%7</font>") 82 "<font face=fixed>%7</font>")
68 .arg( deHtml( m_mail[2] ) )
69 .arg( deHtml( m_mail[0] ) )
70 .arg( deHtml( m_mail[1] ) ) 83 .arg( deHtml( m_mail[1] ) )
71 .arg( tr("<b>Cc:</b> %1<br>").arg( deHtml( m_mail[3] ) ) ) 84 .arg( deHtml( m_mail[0] ) )
72 .arg( tr("<b>Bcc:</b> %1<br>").arg( deHtml( m_mail[4] ) ) ) 85 .arg( deHtml( toString ) )
73 .arg( tr("(no date)" ) ) 86 .arg( tr("<b>Cc:</b> %1<br>").arg( deHtml( ccString ) ) )
87 .arg( tr("<b>Bcc:</b> %1<br>").arg( deHtml( bccString ) ) )
88 .arg( m_mail[3] )
74 .arg("%1"); 89 .arg("%1");
75 browser->setText( QString(_mailHtml) + deHtml( m_mail[5] ) ); 90 browser->setText( QString(_mailHtml) + deHtml( m_mail[2] ) );
76} 91}
77 92
78 93
79 94
80ViewMail::~ViewMail() 95ViewMail::~ViewMail()
81{ 96{