-rw-r--r-- | kmicromail/viewmail.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/kmicromail/viewmail.cpp b/kmicromail/viewmail.cpp index 4883231..3bd6f41 100644 --- a/kmicromail/viewmail.cpp +++ b/kmicromail/viewmail.cpp @@ -412,96 +412,97 @@ void ViewMail::exec() } QString ViewMail::deHtml(const QString &string) { QString string_ = string; string_.replace(QRegExp("&"), "&"); string_.replace(QRegExp("<"), "<"); string_.replace(QRegExp(">"), ">"); string_.replace(QRegExp("\\n"), "<br>"); return string_; } void ViewMail::slotReply() { if (!m_gotBody) { QMessageBox::information(this, i18n("Error"), i18n("<p>The mail body is not yet downloaded, so you cannot reply yet."), i18n("Ok")); return; } QString rtext; rtext += QString("* %1 wrote on %2:\n") // no i18n on purpose .arg( m_mail[0] ) .arg( m_mail[3] ); QString text = m_mail[2]; QStringList lines = QStringList::split(QRegExp("\\n"), text); QStringList::Iterator it; for (it = lines.begin(); it != lines.end(); it++) { 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()); } else { composer.setTo(m_recMail->Replyto()); } composer.setSubject( prefix + m_mail[1] ); composer.setMessage( rtext ); composer.setInReplyTo(m_recMail->Msgid()); + composer.setCharset( m_body->getCharset() ); 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()) ftext += QString("Date: %1\n") .arg( m_mail[3] ); if (!m_mail[0].isNull()) ftext += QString("From: %1\n") .arg( m_mail[0] ); if (!m_mail[1].isNull()) ftext += QString("Subject: %1\n") .arg( m_mail[1] ); ftext += QString("\n%1\n") .arg( m_mail[2]); ftext += QString("----- End forwarded message -----\n"); Settings *settings = new Settings(); ComposeMail composer( settings ,this, 0, true); composer.setSubject( "Fwd: " + m_mail[1] ); composer.setMessage( ftext ); if ( QDialog::Accepted == KApplication::execDialog( &composer )) { } } void ViewMail::slotDeleteMail( ) { if ( QMessageBox::warning(this, i18n("Delete Mail"), QString( i18n("<p>Do you really want to delete this mail? <br><br>" ) + m_mail[0] + " - " + m_mail[1] ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) { m_recMail->Wrapper()->deleteMail( m_recMail ); |