-rw-r--r-- | noncore/net/mail/abstractmail.cpp | 7 | ||||
-rw-r--r-- | noncore/net/mail/imapwrapper.cpp | 6 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/abstractmail.cpp | 7 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/imapwrapper.cpp | 6 |
4 files changed, 12 insertions, 14 deletions
diff --git a/noncore/net/mail/abstractmail.cpp b/noncore/net/mail/abstractmail.cpp index b7e5eaa..3d76c96 100644 --- a/noncore/net/mail/abstractmail.cpp +++ b/noncore/net/mail/abstractmail.cpp @@ -44,28 +44,25 @@ encodedString* AbstractMail::decode_String(const encodedString*text,const QStrin result->setContent(result_text,target_length); } qDebug("Decode string finished"); return result; } QString AbstractMail::convert_String(const char*text) { -#if 0 size_t index = 0; char*res = 0; - qDebug("encode start %s",text); /* attention - doesn't work with arm systems! */ int err = mailmime_encoded_phrase_parse("iso-8859-1", text, strlen(text),&index, "iso-8859-1",&res); - qDebug("encode end"); if (err != MAILIMF_NO_ERROR) { if (res) free(res); return QString(text); } + if (res) { QString result(res); free(res); return result; -#else + } return QString(text); -#endif } diff --git a/noncore/net/mail/imapwrapper.cpp b/noncore/net/mail/imapwrapper.cpp index 8a86c95..838300a 100644 --- a/noncore/net/mail/imapwrapper.cpp +++ b/noncore/net/mail/imapwrapper.cpp @@ -273,17 +273,18 @@ RecMail*IMAPwrapper::parse_list_result(mailimap_msg_att* m_att) mFlags.setBit(FLAG_RECENT); } } continue; } if (item->att_data.att_static->att_type==MAILIMAP_MSG_ATT_ENVELOPE) { mailimap_envelope * head = item->att_data.att_static->att_data.att_env; m->setDate(head->env_date); - m->setSubject(head->env_subject); + m->setSubject(convert_String((const char*)head->env_subject)); + //m->setSubject(head->env_subject); if (head->env_from!=NULL) { addresslist = address_list_to_stringlist(head->env_from->frm_list); if (addresslist.count()) { m->setFrom(addresslist.first()); } } if (head->env_to!=NULL) { addresslist = address_list_to_stringlist(head->env_to->to_list); @@ -429,17 +430,18 @@ QStringList IMAPwrapper::address_list_to_stringlist(clist*list) return l; } unsigned int count = 0; for (current=clist_begin(list);current!= NULL;current=clist_next(current)) { from = ""; named_from = false; current_address=(mailimap_address*)current->data; if (current_address->ad_personal_name){ - from+=QString(current_address->ad_personal_name); + from+=convert_String((const char*)current_address->ad_personal_name); + //from+=QString(current_address->ad_personal_name); from+=" "; named_from = true; } if (named_from && (current_address->ad_mailbox_name || current_address->ad_host_name)) { from+="<"; } if (current_address->ad_mailbox_name) { from+=QString(current_address->ad_mailbox_name); diff --git a/noncore/net/mail/libmailwrapper/abstractmail.cpp b/noncore/net/mail/libmailwrapper/abstractmail.cpp index b7e5eaa..3d76c96 100644 --- a/noncore/net/mail/libmailwrapper/abstractmail.cpp +++ b/noncore/net/mail/libmailwrapper/abstractmail.cpp @@ -44,28 +44,25 @@ encodedString* AbstractMail::decode_String(const encodedString*text,const QStrin result->setContent(result_text,target_length); } qDebug("Decode string finished"); return result; } QString AbstractMail::convert_String(const char*text) { -#if 0 size_t index = 0; char*res = 0; - qDebug("encode start %s",text); /* attention - doesn't work with arm systems! */ int err = mailmime_encoded_phrase_parse("iso-8859-1", text, strlen(text),&index, "iso-8859-1",&res); - qDebug("encode end"); if (err != MAILIMF_NO_ERROR) { if (res) free(res); return QString(text); } + if (res) { QString result(res); free(res); return result; -#else + } return QString(text); -#endif } diff --git a/noncore/net/mail/libmailwrapper/imapwrapper.cpp b/noncore/net/mail/libmailwrapper/imapwrapper.cpp index 8a86c95..838300a 100644 --- a/noncore/net/mail/libmailwrapper/imapwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/imapwrapper.cpp @@ -273,17 +273,18 @@ RecMail*IMAPwrapper::parse_list_result(mailimap_msg_att* m_att) mFlags.setBit(FLAG_RECENT); } } continue; } if (item->att_data.att_static->att_type==MAILIMAP_MSG_ATT_ENVELOPE) { mailimap_envelope * head = item->att_data.att_static->att_data.att_env; m->setDate(head->env_date); - m->setSubject(head->env_subject); + m->setSubject(convert_String((const char*)head->env_subject)); + //m->setSubject(head->env_subject); if (head->env_from!=NULL) { addresslist = address_list_to_stringlist(head->env_from->frm_list); if (addresslist.count()) { m->setFrom(addresslist.first()); } } if (head->env_to!=NULL) { addresslist = address_list_to_stringlist(head->env_to->to_list); @@ -429,17 +430,18 @@ QStringList IMAPwrapper::address_list_to_stringlist(clist*list) return l; } unsigned int count = 0; for (current=clist_begin(list);current!= NULL;current=clist_next(current)) { from = ""; named_from = false; current_address=(mailimap_address*)current->data; if (current_address->ad_personal_name){ - from+=QString(current_address->ad_personal_name); + from+=convert_String((const char*)current_address->ad_personal_name); + //from+=QString(current_address->ad_personal_name); from+=" "; named_from = true; } if (named_from && (current_address->ad_mailbox_name || current_address->ad_host_name)) { from+="<"; } if (current_address->ad_mailbox_name) { from+=QString(current_address->ad_mailbox_name); |