summaryrefslogtreecommitdiffabout
path: root/kmicromail/viewmail.cpp
Unidiff
Diffstat (limited to 'kmicromail/viewmail.cpp') (more/less context) (show whitespace changes)
-rw-r--r--kmicromail/viewmail.cpp25
1 files changed, 24 insertions, 1 deletions
diff --git a/kmicromail/viewmail.cpp b/kmicromail/viewmail.cpp
index 6d88cad..767a369 100644
--- a/kmicromail/viewmail.cpp
+++ b/kmicromail/viewmail.cpp
@@ -204,4 +204,22 @@ void ViewMail::setBody(const RecBodyP&body )
204 204
205 205
206void ViewMail::slotViewSource()
207{
208
209 if ( !sourceOn ) {
210 sourceOn = true;
211 viewSource->setText(i18n("View Body Text"));
212 encodedString*st = 0;
213 st = m_recMail->Wrapper()->fetchRawBody(m_recMail);
214 if ( st ) {
215 QString source = QString::fromUtf8( st->Content(), st->Length());
216 browser->setText( source );
217 delete st;
218 }
219 } else
220 setText();
221
222
223}
206void ViewMail::slotShowHtml( bool state ) 224void ViewMail::slotShowHtml( bool state )
207{ 225{
@@ -321,5 +339,5 @@ ViewMail::ViewMail( QWidget *parent, const char *name, WFlags fl)
321 m_gotBody = false; 339 m_gotBody = false;
322 deleted = false; 340 deleted = false;
323 341 sourceOn = false;
324 connect( reply, SIGNAL(activated()), SLOT(slotReply())); 342 connect( reply, SIGNAL(activated()), SLOT(slotReply()));
325 connect( forward, SIGNAL(activated()), SLOT(slotForward())); 343 connect( forward, SIGNAL(activated()), SLOT(slotForward()));
@@ -328,4 +346,6 @@ ViewMail::ViewMail( QWidget *parent, const char *name, WFlags fl)
328 connect( closeMail, SIGNAL( activated() ), SLOT( close() ) ); 346 connect( closeMail, SIGNAL( activated() ), SLOT( close() ) );
329 connect( nextMail, SIGNAL( activated() ), SLOT( slotNextMail() ) ); 347 connect( nextMail, SIGNAL( activated() ), SLOT( slotNextMail() ) );
348 connect( viewSource, SIGNAL( activated() ), SLOT( slotViewSource() ) );
349 connect( downloadMail, SIGNAL( activated() ), SIGNAL( signalDownloadMail() ) );
330 350
331 attachments->setEnabled(m_gotBody); 351 attachments->setEnabled(m_gotBody);
@@ -347,4 +367,6 @@ void ViewMail::setText()
347{ 367{
348 368
369 viewSource->setText(i18n("View Source"));
370 sourceOn = false;
349 QString toString; 371 QString toString;
350 QString ccString; 372 QString ccString;
@@ -533,2 +555,3 @@ void MailImageDlg::setName(const QString&fname)
533 // m_imageview->setImage(fname); 555 // m_imageview->setImage(fname);
534} 556}
557