author | zautrix <zautrix> | 2004-11-07 10:11:25 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-11-07 10:11:25 (UTC) |
commit | b6ef669713ee1d52adcfc9754dd039a4ff6675da (patch) (side-by-side diff) | |
tree | eac59d1b135cbf87e0b9aca21213115331995203 /kmicromail/composemail.cpp | |
parent | dcb3a171bca38934185de67e378956e6fd044f17 (diff) | |
download | kdepimpi-b6ef669713ee1d52adcfc9754dd039a4ff6675da.zip kdepimpi-b6ef669713ee1d52adcfc9754dd039a4ff6675da.tar.gz kdepimpi-b6ef669713ee1d52adcfc9754dd039a4ff6675da.tar.bz2 |
encoding fixes
-rw-r--r-- | kmicromail/composemail.cpp | 58 |
1 files changed, 35 insertions, 23 deletions
diff --git a/kmicromail/composemail.cpp b/kmicromail/composemail.cpp index f44100b..49fd14f 100644 --- a/kmicromail/composemail.cpp +++ b/kmicromail/composemail.cpp @@ -2,5 +2,3 @@ -#include <kabc/addresseedialog.h> -#include <kabc/stdaddressbook.h> -#include <kabc/addressee.h> + #ifdef DESKTOP_VERSION @@ -8,2 +6,4 @@ #include <kabc/addresseedialog.h> +#include <kabc/stdaddressbook.h> +#include <kabc/addressee.h> #endif //DESKTOP_VERSION @@ -50,3 +50,5 @@ ComposeMail::ComposeMail( Settings *sett, QWidget *parent, const char *name, boo { + mPickLineEdit = 0; + mEncoding = KOPrefs::instance()->mCurrentCodeName; connect(ExternalAppHandler::instance(), SIGNAL(receivedNameEmailUidListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&)), @@ -167,9 +169,9 @@ void ComposeMail::saveAsDraft() Opie::Core::OSmartPointer<Mail> mail= new Mail(); - mail->setMail(fromBox->currentText().utf8 ()); - mail->setTo( toLine->text().utf8 () ); - mail->setName(senderNameEdit->text().utf8 ()); - mail->setCC( ccLine->text().utf8 () ); - mail->setBCC( bccLine->text().utf8 () ); - mail->setReply( replyLine->text().utf8 () ); - mail->setSubject( subjectLine->text().utf8 () ); + mail->setMail(fromBox->currentText()); + mail->setTo( toLine->text() ); + mail->setName(senderNameEdit->text()); + mail->setCC( ccLine->text() ); + mail->setBCC( bccLine->text() ); + mail->setReply( replyLine->text() ); + mail->setSubject( subjectLine->text() ); if (!m_replyid.isEmpty()) { @@ -179,3 +181,3 @@ void ComposeMail::saveAsDraft() } - QString txt = message->text().utf8 (); + QString txt = message->text(); if ( !sigMultiLine->text().isEmpty() ) { @@ -185,3 +187,3 @@ void ComposeMail::saveAsDraft() mail->setMessage( txt ); - + mail->setCharset (mEncoding); /* only use the default drafts folder name! */ @@ -410,6 +412,6 @@ void ComposeMail::accept() SMTPaccount *smtp = smtpAccounts.at( smtpAccountBox->currentItem() ); - mail->setMail(fromBox->currentText().utf8 ()); + mail->setMail(fromBox->currentText()); if ( !toLine->text().isEmpty() ) { - mail->setTo( toLine->text().utf8 () ); + mail->setTo( toLine->text() ); } else { @@ -420,18 +422,19 @@ void ComposeMail::accept() - mail->setName(senderNameEdit->text().utf8 ()); - mail->setCC( ccLine->text().utf8 () ); - mail->setBCC( bccLine->text().utf8 () ); - mail->setReply( replyLine->text().utf8 () ); - mail->setSubject( subjectLine->text().utf8 () ); + mail->setName(senderNameEdit->text()); + mail->setCC( ccLine->text() ); + mail->setBCC( bccLine->text() ); + mail->setReply( replyLine->text() ); + mail->setSubject( subjectLine->text() ); if (!m_replyid.isEmpty()) { QStringList ids; - ids.append(m_replyid.utf8 ()); + ids.append(m_replyid); mail->setInreply(ids); } - QString txt = message->text().utf8 (); + QString txt = message->text(); if ( !sigMultiLine->text().isEmpty() ) { txt.append( "\n--\n" ); - txt.append( sigMultiLine->text().utf8 () ); + txt.append( sigMultiLine->text() ); } mail->setMessage( txt ); + mail->setCharset (mEncoding); AttachViewItem *it = (AttachViewItem *) attList->firstChild(); @@ -478,2 +481,8 @@ void ComposeMail::reject() +void ComposeMail::setCharset(const QString& charset) +{ + if ( !charset.isEmpty() ) + mEncoding = charset; + qDebug("ComposeMail::setCharset %s ", mEncoding.latin1()); +} ComposeMail::~ComposeMail() @@ -485,3 +494,5 @@ void ComposeMail::reEditMail(const RecMailP¤t) RecMailP data = current; - message->setText(data->Wrapper()->fetchBody(current)->Bodytext()); + RecBodyP body = data->Wrapper()->fetchBody(current); + + message->setText(body->Bodytext()); subjectLine->setText( data->getSubject()); @@ -491,2 +502,3 @@ void ComposeMail::reEditMail(const RecMailP¤t) replyLine->setText(data->Replyto()); + setCharset(body->getCharset()); } |