summaryrefslogtreecommitdiffabout
path: root/kmicromail/viewmail.cpp
Side-by-side diff
Diffstat (limited to 'kmicromail/viewmail.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kmicromail/viewmail.cpp35
1 files changed, 15 insertions, 20 deletions
diff --git a/kmicromail/viewmail.cpp b/kmicromail/viewmail.cpp
index f1e0225..2093678 100644
--- a/kmicromail/viewmail.cpp
+++ b/kmicromail/viewmail.cpp
@@ -89,25 +89,26 @@ AttachItem* ViewMail::lastChild(AttachItem*parent)
AttachItem*temp=0;
while( (temp=(AttachItem*)item->nextSibling()))
{
item = temp;
}
return item;
}
void ViewMail::setBody(const RecBodyP&body )
{
m_body = body;
- m_mail[2] = body->Bodytext();
+ m_mail[2] = QString::fromUtf8( body->Bodytext().latin1() );
+ // 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;
}
AttachItem * curItem=0;
AttachItem * parentItem = 0;
QString type=body->Description()->Type()+"/"+body->Description()->Subtype();
QString desc,fsize;
double s = body->Description()->Size();
int w;
@@ -291,28 +292,28 @@ void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int
}
break;
}
delete menu;
}
void ViewMail::setMail(const RecMailP&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_mail[0] = QString::fromUtf8( mail->getFrom().latin1() );
+ m_mail[1] = QString::fromUtf8( mail->getSubject().latin1() );
+ m_mail[3] = QString::fromUtf8( mail->getDate().latin1() );
+ m_mail[4] = QString::fromUtf8( mail->Msgid().latin1() );
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)
@@ -339,36 +340,29 @@ void ViewMail::readConfig()
setFont ( KOPrefs::instance()->mReadFont );
m_showHtml = KOPrefs::instance()->mViewAsHtml;
showHtml->setOn( m_showHtml );
}
void ViewMail::setText()
{
QString toString;
QString ccString;
QString bccString;
- for ( QStringList::Iterator it = ( m_mail2[0] ).begin(); it != ( m_mail2[0] ).end(); ++it )
- {
- toString += (*it);
- }
- for ( QStringList::Iterator it = ( m_mail2[1] ).begin(); it != ( m_mail2[1] ).end(); ++it )
- {
- ccString += (*it);
- }
- for ( QStringList::Iterator it = ( m_mail2[2] ).begin(); it != ( m_mail2[2] ).end(); ++it )
- {
- bccString += (*it);
- }
+
+ toString = QString::fromUtf8(m_mail2[0].join(",").latin1());
+ ccString = QString::fromUtf8(m_mail2[1].join(",").latin1());
+ bccString = QString::fromUtf8(m_mail2[2].join(",").latin1());
+
setCaption( i18n("E-Mail by %1").arg( m_mail[0] ) );
m_mailHtml = "<html><body>"
"<table width=\"100%\" border=\"0\"><tr bgcolor=\"#FFDD76\"><td>"
"<div align=left><b>" + deHtml( m_mail[1] ) + "</b></div>"
"</td></tr><tr bgcolor=\"#EEEEE6\"><td>"
"<b>" + i18n( "From" ) + ": </b><font color=#6C86C0>" + deHtml( m_mail[0] ) + "</font><br>"
"<b>" + i18n( "To" ) + ": </b><font color=#6C86C0>" + deHtml( toString ) + "</font><br><b>" +
i18n( "Cc" ) + ": </b>" + deHtml( ccString ) + "<br>"
"<b>" + i18n( "Date" ) + ": </b> " + m_mail[3] +
"</td></tr></table><font>";
@@ -447,38 +441,39 @@ void ViewMail::slotReply()
{
rtext += "> " + *it + "\n";
}
rtext += "\n";
QString prefix;
if ( m_mail[1].find(QRegExp("^Re: .*$")) != -1) prefix = "";
else prefix = "Re: "; // no i18n on purpose
Settings *settings = new Settings();
ComposeMail composer( settings ,this, 0, true);
if (m_recMail->Replyto().isEmpty()) {
- composer.setTo( m_recMail->getFrom());
+ composer.setTo( QString::fromUtf8( m_recMail->getFrom().latin1()));
} else {
- composer.setTo( m_recMail->Replyto());
+ composer.setTo( QString::fromUtf8( m_recMail->Replyto().latin1()));
}
composer.setSubject( prefix + m_mail[1] );
composer.setMessage( rtext );
composer.setInReplyTo(m_recMail->Msgid());
if ( QDialog::Accepted == KApplication::execDialog( &composer ) )
{
m_recMail->Wrapper()->answeredMail(m_recMail);
}
+ delete settings;
}
-
+
void ViewMail::slotForward()
{
if (!m_gotBody)
{
QMessageBox::information(this, i18n("Error"), i18n("<p>The mail body is not yet downloaded, so you cannot forward yet."), i18n("Ok"));
return;
}
QString ftext;
ftext += QString("\n----- Forwarded message from %1 -----\n\n")
.arg( m_mail[0] );
if (!m_mail[3].isNull())