-rw-r--r-- | kmicromail/composemail.cpp | 58 | ||||
-rw-r--r-- | kmicromail/composemail.h | 2 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/genericwrapper.cpp | 1 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/imapwrapper.cpp | 11 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/mailtypes.cpp | 11 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/mailtypes.h | 3 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/mailwrapper.h | 5 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/storemail.cpp | 12 | ||||
-rw-r--r-- | kmicromail/opiemail.cpp | 2 | ||||
-rw-r--r-- | kmicromail/viewmail.cpp | 1 |
10 files changed, 74 insertions, 32 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 @@ | |||
2 | 2 | ||
3 | #include <kabc/addresseedialog.h> | 3 | |
4 | #include <kabc/stdaddressbook.h> | ||
5 | #include <kabc/addressee.h> | ||
6 | #ifdef DESKTOP_VERSION | 4 | #ifdef DESKTOP_VERSION |
@@ -8,2 +6,4 @@ | |||
8 | #include <kabc/addresseedialog.h> | 6 | #include <kabc/addresseedialog.h> |
7 | #include <kabc/stdaddressbook.h> | ||
8 | #include <kabc/addressee.h> | ||
9 | #endif //DESKTOP_VERSION | 9 | #endif //DESKTOP_VERSION |
@@ -50,3 +50,5 @@ ComposeMail::ComposeMail( Settings *sett, QWidget *parent, const char *name, boo | |||
50 | { | 50 | { |
51 | |||
51 | mPickLineEdit = 0; | 52 | mPickLineEdit = 0; |
53 | mEncoding = KOPrefs::instance()->mCurrentCodeName; | ||
52 | connect(ExternalAppHandler::instance(), SIGNAL(receivedNameEmailUidListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&)), | 54 | connect(ExternalAppHandler::instance(), SIGNAL(receivedNameEmailUidListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&)), |
@@ -167,9 +169,9 @@ void ComposeMail::saveAsDraft() | |||
167 | Opie::Core::OSmartPointer<Mail> mail= new Mail(); | 169 | Opie::Core::OSmartPointer<Mail> mail= new Mail(); |
168 | mail->setMail(fromBox->currentText().utf8 ()); | 170 | mail->setMail(fromBox->currentText()); |
169 | mail->setTo( toLine->text().utf8 () ); | 171 | mail->setTo( toLine->text() ); |
170 | mail->setName(senderNameEdit->text().utf8 ()); | 172 | mail->setName(senderNameEdit->text()); |
171 | mail->setCC( ccLine->text().utf8 () ); | 173 | mail->setCC( ccLine->text() ); |
172 | mail->setBCC( bccLine->text().utf8 () ); | 174 | mail->setBCC( bccLine->text() ); |
173 | mail->setReply( replyLine->text().utf8 () ); | 175 | mail->setReply( replyLine->text() ); |
174 | mail->setSubject( subjectLine->text().utf8 () ); | 176 | mail->setSubject( subjectLine->text() ); |
175 | if (!m_replyid.isEmpty()) { | 177 | if (!m_replyid.isEmpty()) { |
@@ -179,3 +181,3 @@ void ComposeMail::saveAsDraft() | |||
179 | } | 181 | } |
180 | QString txt = message->text().utf8 (); | 182 | QString txt = message->text(); |
181 | if ( !sigMultiLine->text().isEmpty() ) { | 183 | if ( !sigMultiLine->text().isEmpty() ) { |
@@ -185,3 +187,3 @@ void ComposeMail::saveAsDraft() | |||
185 | mail->setMessage( txt ); | 187 | mail->setMessage( txt ); |
186 | 188 | mail->setCharset (mEncoding); | |
187 | /* only use the default drafts folder name! */ | 189 | /* only use the default drafts folder name! */ |
@@ -410,6 +412,6 @@ void ComposeMail::accept() | |||
410 | SMTPaccount *smtp = smtpAccounts.at( smtpAccountBox->currentItem() ); | 412 | SMTPaccount *smtp = smtpAccounts.at( smtpAccountBox->currentItem() ); |
411 | mail->setMail(fromBox->currentText().utf8 ()); | 413 | mail->setMail(fromBox->currentText()); |
412 | 414 | ||
413 | if ( !toLine->text().isEmpty() ) { | 415 | if ( !toLine->text().isEmpty() ) { |
414 | mail->setTo( toLine->text().utf8 () ); | 416 | mail->setTo( toLine->text() ); |
415 | } else { | 417 | } else { |
@@ -420,18 +422,19 @@ void ComposeMail::accept() | |||
420 | 422 | ||
421 | mail->setName(senderNameEdit->text().utf8 ()); | 423 | mail->setName(senderNameEdit->text()); |
422 | mail->setCC( ccLine->text().utf8 () ); | 424 | mail->setCC( ccLine->text() ); |
423 | mail->setBCC( bccLine->text().utf8 () ); | 425 | mail->setBCC( bccLine->text() ); |
424 | mail->setReply( replyLine->text().utf8 () ); | 426 | mail->setReply( replyLine->text() ); |
425 | mail->setSubject( subjectLine->text().utf8 () ); | 427 | mail->setSubject( subjectLine->text() ); |
426 | if (!m_replyid.isEmpty()) { | 428 | if (!m_replyid.isEmpty()) { |
427 | QStringList ids; | 429 | QStringList ids; |
428 | ids.append(m_replyid.utf8 ()); | 430 | ids.append(m_replyid); |
429 | mail->setInreply(ids); | 431 | mail->setInreply(ids); |
430 | } | 432 | } |
431 | QString txt = message->text().utf8 (); | 433 | QString txt = message->text(); |
432 | if ( !sigMultiLine->text().isEmpty() ) { | 434 | if ( !sigMultiLine->text().isEmpty() ) { |
433 | txt.append( "\n--\n" ); | 435 | txt.append( "\n--\n" ); |
434 | txt.append( sigMultiLine->text().utf8 () ); | 436 | txt.append( sigMultiLine->text() ); |
435 | } | 437 | } |
436 | mail->setMessage( txt ); | 438 | mail->setMessage( txt ); |
439 | mail->setCharset (mEncoding); | ||
437 | AttachViewItem *it = (AttachViewItem *) attList->firstChild(); | 440 | AttachViewItem *it = (AttachViewItem *) attList->firstChild(); |
@@ -478,2 +481,8 @@ void ComposeMail::reject() | |||
478 | 481 | ||
482 | void ComposeMail::setCharset(const QString& charset) | ||
483 | { | ||
484 | if ( !charset.isEmpty() ) | ||
485 | mEncoding = charset; | ||
486 | qDebug("ComposeMail::setCharset %s ", mEncoding.latin1()); | ||
487 | } | ||
479 | ComposeMail::~ComposeMail() | 488 | ComposeMail::~ComposeMail() |
@@ -485,3 +494,5 @@ void ComposeMail::reEditMail(const RecMailP¤t) | |||
485 | RecMailP data = current; | 494 | RecMailP data = current; |
486 | message->setText(data->Wrapper()->fetchBody(current)->Bodytext()); | 495 | RecBodyP body = data->Wrapper()->fetchBody(current); |
496 | |||
497 | message->setText(body->Bodytext()); | ||
487 | subjectLine->setText( data->getSubject()); | 498 | subjectLine->setText( data->getSubject()); |
@@ -491,2 +502,3 @@ void ComposeMail::reEditMail(const RecMailP¤t) | |||
491 | replyLine->setText(data->Replyto()); | 502 | replyLine->setText(data->Replyto()); |
503 | setCharset(body->getCharset()); | ||
492 | } | 504 | } |
diff --git a/kmicromail/composemail.h b/kmicromail/composemail.h index 0fc41fb..a7fa41c 100644 --- a/kmicromail/composemail.h +++ b/kmicromail/composemail.h | |||
@@ -50,2 +50,3 @@ public slots: | |||
50 | void insertAttendees(const QString&, const QStringList& namelist, const QStringList& emaillist, const QStringList& uidlist); | 50 | void insertAttendees(const QString&, const QStringList& namelist, const QStringList& emaillist, const QStringList& uidlist); |
51 | void setCharset(const QString&); | ||
51 | 52 | ||
@@ -76,2 +77,3 @@ protected: | |||
76 | QString m_replyid; | 77 | QString m_replyid; |
78 | QString mEncoding; | ||
77 | bool warnAttach; | 79 | bool warnAttach; |
diff --git a/kmicromail/libmailwrapper/genericwrapper.cpp b/kmicromail/libmailwrapper/genericwrapper.cpp index 49227dd..28d45ce 100644 --- a/kmicromail/libmailwrapper/genericwrapper.cpp +++ b/kmicromail/libmailwrapper/genericwrapper.cpp | |||
@@ -228,2 +228,3 @@ void Genericwrapper::traverseBody(RecBodyP&target,mailmessage*message,mailmime*m | |||
228 | if ( !charset.isEmpty() ) { | 228 | if ( !charset.isEmpty() ) { |
229 | target->setCharset( charset ); | ||
229 | err = mailmime_encoded_phrase_parse(charset.latin1(), | 230 | err = mailmime_encoded_phrase_parse(charset.latin1(), |
diff --git a/kmicromail/libmailwrapper/imapwrapper.cpp b/kmicromail/libmailwrapper/imapwrapper.cpp index eb2b47d..2a54381 100644 --- a/kmicromail/libmailwrapper/imapwrapper.cpp +++ b/kmicromail/libmailwrapper/imapwrapper.cpp | |||
@@ -52,3 +52,3 @@ void IMAPwrapper::imap_progress( size_t current, size_t maximum ) | |||
52 | //qApp->processEvents() | 52 | //qApp->processEvents() |
53 | static int last = 0; | 53 | static unsigned int last = 0; |
54 | if ( last != current ) | 54 | if ( last != current ) |
@@ -291,6 +291,6 @@ void IMAPwrapper::listMessages(const QString&mailbox,QValueList<Opie::Core::OSma | |||
291 | //qDebug("iii %d ",i); | 291 | //qDebug("iii %d ",i); |
292 | msg_att = (mailimap_msg_att*)current->data; | 292 | msg_att = (mailimap_msg_att*)current->data; |
293 | RecMail*m = parse_list_result(msg_att); | 293 | RecMail*m = parse_list_result(msg_att); |
294 | if (m) { | 294 | if (m) { |
295 | if ( maxSizeInKb == 0 || m->Msgsize()<=maxSizeInKb*1024 ) { | 295 | if ( maxSizeInKb == 0 || m->Msgsize()<=(unsigned int ) maxSizeInKb*1024 ) { |
296 | m->setNumber(i); | 296 | m->setNumber(i); |
@@ -417,3 +417,3 @@ RecMail*IMAPwrapper::parse_list_result(mailimap_msg_att* m_att) | |||
417 | mailimap_flag_fetch*cflag; | 417 | mailimap_flag_fetch*cflag; |
418 | int size; | 418 | int size = 0; |
419 | QBitArray mFlags(7); | 419 | QBitArray mFlags(7); |
@@ -763,2 +763,3 @@ void IMAPwrapper::traverseBody(const RecMailP&mail,mailimap_body*body,RecBodyP&t | |||
763 | if ( !charset.isEmpty() ) { | 763 | if ( !charset.isEmpty() ) { |
764 | target_body->setCharset( charset ); | ||
764 | //err = mailmime_encoded_phrase_parse("iso-8859-1", | 765 | //err = mailmime_encoded_phrase_parse("iso-8859-1", |
@@ -1184,3 +1185,3 @@ int IMAPwrapper::createMbox(const QString&folder,const FolderP&parentfolder,cons | |||
1184 | QString pre = account->getPrefix(); | 1185 | QString pre = account->getPrefix(); |
1185 | if (delemiter.length()>0 && pre.findRev(delemiter)!=pre.length()-1) { | 1186 | if (delemiter.length()>0 && pre.findRev(delemiter)!=((int)pre.length())-1) { |
1186 | pre+=delemiter; | 1187 | pre+=delemiter; |
diff --git a/kmicromail/libmailwrapper/mailtypes.cpp b/kmicromail/libmailwrapper/mailtypes.cpp index af3b9d0..89150ad 100644 --- a/kmicromail/libmailwrapper/mailtypes.cpp +++ b/kmicromail/libmailwrapper/mailtypes.cpp | |||
@@ -289,2 +289,3 @@ RecBody::RecBody(const RecBody&old) | |||
289 | m_description = old.m_description; | 289 | m_description = old.m_description; |
290 | mCharset = old.mCharset; | ||
290 | // odebug << "Recbody copy constructor" << oendl; | 291 | // odebug << "Recbody copy constructor" << oendl; |
@@ -332,2 +333,12 @@ const RecPartP& RecBody::Description()const | |||
332 | 333 | ||
334 | void RecBody::setCharset(const QString& str) | ||
335 | { | ||
336 | mCharset = str; | ||
337 | } | ||
338 | |||
339 | QString RecBody::getCharset()const | ||
340 | { | ||
341 | return mCharset; | ||
342 | } | ||
343 | |||
333 | /* handling encoded content */ | 344 | /* handling encoded content */ |
diff --git a/kmicromail/libmailwrapper/mailtypes.h b/kmicromail/libmailwrapper/mailtypes.h index c1c1a74..32d92c0 100644 --- a/kmicromail/libmailwrapper/mailtypes.h +++ b/kmicromail/libmailwrapper/mailtypes.h | |||
@@ -135,2 +135,3 @@ protected: | |||
135 | QString m_BodyText; | 135 | QString m_BodyText; |
136 | QString mCharset; | ||
136 | QValueList<RecPartP> m_PartsList; | 137 | QValueList<RecPartP> m_PartsList; |
@@ -144,2 +145,4 @@ public: | |||
144 | const QString& Bodytext()const; | 145 | const QString& Bodytext()const; |
146 | void setCharset(const QString&); | ||
147 | QString getCharset()const; | ||
145 | 148 | ||
diff --git a/kmicromail/libmailwrapper/mailwrapper.h b/kmicromail/libmailwrapper/mailwrapper.h index 88f10da..ea6bf36 100644 --- a/kmicromail/libmailwrapper/mailwrapper.h +++ b/kmicromail/libmailwrapper/mailwrapper.h | |||
@@ -84,5 +84,8 @@ public: | |||
84 | 84 | ||
85 | void setCharset( const QString&a ) { charset= a; } | ||
86 | const QString& getCharset() { return charset; } | ||
87 | |||
85 | private: | 88 | private: |
86 | QList<Attachment> attList; | 89 | QList<Attachment> attList; |
87 | QString name, mail, to, cc, bcc, reply, subject, message; | 90 | QString name, mail, to, cc, bcc, reply, subject, message, charset; |
88 | QStringList m_in_reply_to; | 91 | QStringList m_in_reply_to; |
diff --git a/kmicromail/libmailwrapper/storemail.cpp b/kmicromail/libmailwrapper/storemail.cpp index ed1d44a..9d1735f 100644 --- a/kmicromail/libmailwrapper/storemail.cpp +++ b/kmicromail/libmailwrapper/storemail.cpp | |||
@@ -9,2 +9,3 @@ | |||
9 | #include <stdlib.h> | 9 | #include <stdlib.h> |
10 | #include <kglobal.h> | ||
10 | 11 | ||
@@ -67,4 +68,11 @@ int Storemail::storeMail(const Opie::Core::OSmartPointer<Mail>&mail) | |||
67 | mailmessage * msg = 0; | 68 | mailmessage * msg = 0; |
68 | msg = mime_message_init(mimeMail); | 69 | msg = mime_message_init(mimeMail); |
69 | mime_message_set_tmpdir(msg,getenv( "HOME" )); | 70 | QString fileName; |
71 | #ifdef DESKTOP_VERSION | ||
72 | fileName = locateLocal("tmp", ""); | ||
73 | #else | ||
74 | fileName = "/tmp/"; | ||
75 | #endif | ||
76 | //mime_message_set_tmpdir(msg,getenv( "HOME" )); | ||
77 | mime_message_set_tmpdir(msg,(char*)fileName.latin1()); | ||
70 | int r = mailmessage_fetch(msg,&data,&size); | 78 | int r = mailmessage_fetch(msg,&data,&size); |
diff --git a/kmicromail/opiemail.cpp b/kmicromail/opiemail.cpp index 18a5600..c20c7ce 100644 --- a/kmicromail/opiemail.cpp +++ b/kmicromail/opiemail.cpp | |||
@@ -293,3 +293,3 @@ void OpieMail::replyMail() | |||
293 | composer.setInReplyTo( mail->Msgid()); | 293 | composer.setInReplyTo( mail->Msgid()); |
294 | 294 | composer.setCharset( body->getCharset() ); | |
295 | if ( QDialog::Accepted == KApplication::execDialog( &composer ) ) | 295 | if ( QDialog::Accepted == KApplication::execDialog( &composer ) ) |
diff --git a/kmicromail/viewmail.cpp b/kmicromail/viewmail.cpp index 4883231..3bd6f41 100644 --- a/kmicromail/viewmail.cpp +++ b/kmicromail/viewmail.cpp | |||
@@ -459,2 +459,3 @@ void ViewMail::slotReply() | |||
459 | composer.setInReplyTo(m_recMail->Msgid()); | 459 | composer.setInReplyTo(m_recMail->Msgid()); |
460 | composer.setCharset( m_body->getCharset() ); | ||
460 | 461 | ||