-rw-r--r-- | kmicromail/opiemail.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/kmicromail/opiemail.cpp b/kmicromail/opiemail.cpp index af5376f..18a5600 100644 --- a/kmicromail/opiemail.cpp +++ b/kmicromail/opiemail.cpp @@ -20,32 +20,33 @@ #include "klocale.h" #include <qmessagebox.h> #include <qtimer.h> #include <qcursor.h> #include <qregexp.h> #include <qpe/global.h> #ifdef DESKTOP_VERSION #include <qapplication.h> #else #include <qpe/qpeapplication.h> #endif #include <libmailwrapper/smtpwrapper.h> #include <libmailwrapper/mailtypes.h> #include <libmailwrapper/abstractmail.h> +#include "koprefs.h" //using namespace Opie::Core; OpieMail::OpieMail( QWidget *parent, const char *name ) : MainWindow( parent, name) //, WStyle_ContextHelp ) { settings = new Settings(); setIcon(SmallIcon( "kmicromail" ) ); folderView->populate( settings->getAccounts() ); } OpieMail::~OpieMail() { if (settings) delete settings; @@ -224,84 +225,85 @@ void OpieMail::slotSendQueued() } void OpieMail::slotSearchMails() { qDebug("OpieMail::slotSearchMails():not implemented "); } void OpieMail::slotEditSettings() { KOPrefsDialog settingsDialog( this, "koprefs", true ); #ifndef DESKTOP_VERSION settingsDialog.showMaximized(); #endif settingsDialog.exec(); + slotSetCodec( KOPrefs::instance()->mCurrentCodec ); // KApplication::execDialog(settingsDialog); } void OpieMail::slotEditAccounts() { EditAccounts eaDialog( settings, this, 0, true ); eaDialog.slotAdjustColumns(); #ifndef DESKTOP_VERSION eaDialog.showMaximized(); #endif eaDialog.exec(); if ( settings ) delete settings; settings = new Settings(); folderView->populate( settings->getAccounts() ); } void OpieMail::replyMail() { QListViewItem*item = mailView->currentItem(); if (!item) return; RecMailP mail = ((MailListViewItem*)item)->data(); RecBodyP body = folderView->fetchBody(mail); QString rtext; rtext += QString("* %1 wrote on %2:\n") // no i18n on purpose - .arg( QString::fromUtf8( mail->getFrom().latin1())) - .arg( QString::fromUtf8( mail->getDate().latin1() )); + .arg( mail->getFrom()) + .arg( mail->getDate()); - QString text = QString::fromUtf8( body->Bodytext().latin1() ); + QString text = body->Bodytext(); 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 ( mail->getSubject().find(QRegExp("^Re: .*$")) != -1) prefix = ""; else prefix = "Re: "; // no i18n on purpose Settings *settings = new Settings(); ComposeMail composer( settings ,this, 0, true); if (mail->Replyto().isEmpty()) { - composer.setTo( QString::fromUtf8( mail->getFrom().latin1())); + composer.setTo( mail->getFrom()); } else { - composer.setTo( QString::fromUtf8(mail->Replyto().latin1())); + composer.setTo( mail->Replyto()); } - composer.setSubject( prefix + QString::fromUtf8( mail->getSubject().latin1() ) ); + composer.setSubject( prefix + mail->getSubject()); composer.setMessage( rtext ); - composer.setInReplyTo( QString::fromUtf8(mail->Msgid().latin1())); + composer.setInReplyTo( mail->Msgid()); if ( QDialog::Accepted == KApplication::execDialog( &composer ) ) { mail->Wrapper()->answeredMail(mail); } delete settings; } void OpieMail::displayMail() { QListViewItem*item = mailView->currentItem(); if (!item) return; RecMailP mail = ((MailListViewItem*)item)->data(); RecBodyP body = folderView->fetchBody(mail); ViewMail readMail( this,"", Qt::WType_Modal ); readMail.setBody( body ); |