summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--bin/kdepim/WhatsNew.txt3
-rw-r--r--kmicromail/viewmail.cpp23
-rw-r--r--kmicromail/viewmail.h2
3 files changed, 25 insertions, 3 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt
index 0596511..86ac9b5 100644
--- a/bin/kdepim/WhatsNew.txt
+++ b/bin/kdepim/WhatsNew.txt
@@ -6,12 +6,15 @@ KO/Pi:
Fixed a bug in todo start/due date handling for non recurring todos with a start and due date.
Fixed some layout problems in the KO/Pi agenda view when there were many conflicting itmes.
Fixed several problems of the keyboard focus in the desktop versions when opening the search dialog/event viewer.
Fixed problem in pi-sync mode when wrong password was sent.
+OM/Pi:
+Fixed a crash when displaying mails with "Show mail as html" was checked in the config.
+Added a check before displaying the mail if the mail is in html format, if "Show mail as html" is enabled.
********** VERSION 2.0.11 ************
Fixed some problems in pi-sync mode
(e.g. details of events were not synced properly)
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)
void ViewMail::setBody(const RecBodyP&body )
{
m_body = body;
m_mail[2] = body->Bodytext();
+ m_showHtml = KOPrefs::instance()->mViewAsHtml;
+ if ( m_showHtml ) {
+ if ( m_mail[2].find ("<html>",0,false ) > -1 ) {
+ qDebug("html mail ");
+ } else {
+ qDebug("no html mail ");
+ m_showHtml = false;
+ }
+ }
+ showHtml->blockSignals( true );
+ showHtml->setOn( m_showHtml );
+ showHtml->blockSignals( false );
// qDebug("********text %s ",m_mail[2].latin1() );
attachbutton->setEnabled(body->Parts().count()>0);
attachments->setEnabled(body->Parts().count()>0);
if (body->Parts().count()==0)
{
return;
@@ -328,33 +340,40 @@ void ViewMail::setMail(const RecMailP&mail )
m_mail2[1] = mail->CC();
m_mail2[2] = mail->Bcc();
setText();
}
-
+void ViewMail::slotNextMail()
+{
+ nextMail->blockSignals( true );
+ setCaption(i18n("Displaying next mail...please wait!"));
+ qApp->processEvents();
+ emit showNextMail(this);
+ nextMail->blockSignals( false );
+}
ViewMail::ViewMail( QWidget *parent, const char *name, WFlags fl)
: ViewMailBase(parent, name, fl), _inLoop(false)
{
m_gotBody = false;
deleted = false;
sourceOn = false;
+ readConfig();
connect( reply, SIGNAL(activated()), SLOT(slotReply()));
connect( forward, SIGNAL(activated()), SLOT(slotForward()));
connect( deleteMail, SIGNAL( activated() ), SLOT( slotDeleteMail() ) );
connect( showHtml, SIGNAL( toggled(bool) ), SLOT( slotShowHtml(bool) ) );
connect( closeMail, SIGNAL( activated() ), SLOT( close() ) );
connect( nextMail, SIGNAL( activated() ), SLOT( slotNextMail() ) );
connect( viewSource, SIGNAL( activated() ), SLOT( slotViewSource() ) );
connect( downloadMail, SIGNAL( activated() ), SIGNAL( signalDownloadMail() ) );
attachments->setEnabled(m_gotBody);
connect( attachments, SIGNAL( clicked(QListViewItem*,const QPoint&, int) ), SLOT( slotItemClicked(QListViewItem*,const QPoint&, int) ) );
- readConfig();
attachments->setSorting(-1);
}
void ViewMail::readConfig()
{
diff --git a/kmicromail/viewmail.h b/kmicromail/viewmail.h
index fc5edcf..bb5b685 100644
--- a/kmicromail/viewmail.h
+++ b/kmicromail/viewmail.h
@@ -51,13 +51,13 @@ public:
protected:
QString deHtml(const QString &string);
AttachItem* searchParent(const QValueList<int>&path);
AttachItem* lastChild(AttachItem*parent);
protected slots:
- void slotNextMail() { setCaption(i18n("Displaying next mail...please wait!")); qApp->processEvents();emit showNextMail(this); };
+ void slotNextMail();
void slotReply();
void slotForward();
void setText();
void slotItemClicked( QListViewItem * item , const QPoint & point, int c );
void slotDeleteMail( );
void slotShowHtml( bool );