summaryrefslogtreecommitdiffabout
path: root/kmicromail/viewmail.cpp
Unidiff
Diffstat (limited to 'kmicromail/viewmail.cpp') (more/less context) (show whitespace changes)
-rw-r--r--kmicromail/viewmail.cpp23
1 files changed, 21 insertions, 2 deletions
diff --git a/kmicromail/viewmail.cpp b/kmicromail/viewmail.cpp
index 726f540..685b4e4 100644
--- a/kmicromail/viewmail.cpp
+++ b/kmicromail/viewmail.cpp
@@ -96,12 +96,24 @@ AttachItem* ViewMail::lastChild(AttachItem*parent)
96 96
97void ViewMail::setBody(const RecBodyP&body ) 97void ViewMail::setBody(const RecBodyP&body )
98{ 98{
99 99
100 m_body = body; 100 m_body = body;
101 m_mail[2] = body->Bodytext(); 101 m_mail[2] = body->Bodytext();
102 m_showHtml = KOPrefs::instance()->mViewAsHtml;
103 if ( m_showHtml ) {
104 if ( m_mail[2].find ("<html>",0,false ) > -1 ) {
105 qDebug("html mail ");
106 } else {
107 qDebug("no html mail ");
108 m_showHtml = false;
109 }
110 }
111 showHtml->blockSignals( true );
112 showHtml->setOn( m_showHtml );
113 showHtml->blockSignals( false );
102 // qDebug("********text %s ",m_mail[2].latin1() ); 114 // qDebug("********text %s ",m_mail[2].latin1() );
103 attachbutton->setEnabled(body->Parts().count()>0); 115 attachbutton->setEnabled(body->Parts().count()>0);
104 attachments->setEnabled(body->Parts().count()>0); 116 attachments->setEnabled(body->Parts().count()>0);
105 if (body->Parts().count()==0) 117 if (body->Parts().count()==0)
106 { 118 {
107 return; 119 return;
@@ -328,33 +340,40 @@ void ViewMail::setMail(const RecMailP&mail )
328 m_mail2[1] = mail->CC(); 340 m_mail2[1] = mail->CC();
329 m_mail2[2] = mail->Bcc(); 341 m_mail2[2] = mail->Bcc();
330 342
331 setText(); 343 setText();
332} 344}
333 345
334 346void ViewMail::slotNextMail()
347{
348 nextMail->blockSignals( true );
349 setCaption(i18n("Displaying next mail...please wait!"));
350 qApp->processEvents();
351 emit showNextMail(this);
352 nextMail->blockSignals( false );
353}
335 354
336ViewMail::ViewMail( QWidget *parent, const char *name, WFlags fl) 355ViewMail::ViewMail( QWidget *parent, const char *name, WFlags fl)
337 : ViewMailBase(parent, name, fl), _inLoop(false) 356 : ViewMailBase(parent, name, fl), _inLoop(false)
338{ 357{
339 m_gotBody = false; 358 m_gotBody = false;
340 deleted = false; 359 deleted = false;
341 sourceOn = false; 360 sourceOn = false;
361 readConfig();
342 connect( reply, SIGNAL(activated()), SLOT(slotReply())); 362 connect( reply, SIGNAL(activated()), SLOT(slotReply()));
343 connect( forward, SIGNAL(activated()), SLOT(slotForward())); 363 connect( forward, SIGNAL(activated()), SLOT(slotForward()));
344 connect( deleteMail, SIGNAL( activated() ), SLOT( slotDeleteMail() ) ); 364 connect( deleteMail, SIGNAL( activated() ), SLOT( slotDeleteMail() ) );
345 connect( showHtml, SIGNAL( toggled(bool) ), SLOT( slotShowHtml(bool) ) ); 365 connect( showHtml, SIGNAL( toggled(bool) ), SLOT( slotShowHtml(bool) ) );
346 connect( closeMail, SIGNAL( activated() ), SLOT( close() ) ); 366 connect( closeMail, SIGNAL( activated() ), SLOT( close() ) );
347 connect( nextMail, SIGNAL( activated() ), SLOT( slotNextMail() ) ); 367 connect( nextMail, SIGNAL( activated() ), SLOT( slotNextMail() ) );
348 connect( viewSource, SIGNAL( activated() ), SLOT( slotViewSource() ) ); 368 connect( viewSource, SIGNAL( activated() ), SLOT( slotViewSource() ) );
349 connect( downloadMail, SIGNAL( activated() ), SIGNAL( signalDownloadMail() ) ); 369 connect( downloadMail, SIGNAL( activated() ), SIGNAL( signalDownloadMail() ) );
350 370
351 attachments->setEnabled(m_gotBody); 371 attachments->setEnabled(m_gotBody);
352 connect( attachments, SIGNAL( clicked(QListViewItem*,const QPoint&, int) ), SLOT( slotItemClicked(QListViewItem*,const QPoint&, int) ) ); 372 connect( attachments, SIGNAL( clicked(QListViewItem*,const QPoint&, int) ), SLOT( slotItemClicked(QListViewItem*,const QPoint&, int) ) );
353 373
354 readConfig();
355 attachments->setSorting(-1); 374 attachments->setSorting(-1);
356} 375}
357 376
358void ViewMail::readConfig() 377void ViewMail::readConfig()
359{ 378{
360 379