author | zautrix <zautrix> | 2004-10-16 10:18:46 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-16 10:18:46 (UTC) |
commit | 023b3c542a6dd4d1c4b53dba6bb2c68f605a7917 (patch) (unidiff) | |
tree | 96929f98d9de314dc48f0a89efa5d93a78644a3d | |
parent | 2897677d61fd8d33355611b5b951e2bee1136b9c (diff) | |
download | kdepimpi-023b3c542a6dd4d1c4b53dba6bb2c68f605a7917.zip kdepimpi-023b3c542a6dd4d1c4b53dba6bb2c68f605a7917.tar.gz kdepimpi-023b3c542a6dd4d1c4b53dba6bb2c68f605a7917.tar.bz2 |
umlaut fix for ompi
-rw-r--r-- | kmicromail/libmailwrapper/abstractmail.cpp | 12 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/genericwrapper.cpp | 4 |
2 files changed, 7 insertions, 9 deletions
diff --git a/kmicromail/libmailwrapper/abstractmail.cpp b/kmicromail/libmailwrapper/abstractmail.cpp index 673f288..2d7533c 100644 --- a/kmicromail/libmailwrapper/abstractmail.cpp +++ b/kmicromail/libmailwrapper/abstractmail.cpp | |||
@@ -69,62 +69,60 @@ encodedString* AbstractMail::decode_String(const encodedString*text,const QStrin | |||
69 | int mimetype = MAILMIME_MECHANISM_7BIT; | 69 | int mimetype = MAILMIME_MECHANISM_7BIT; |
70 | if (enc.lower()=="quoted-printable") { | 70 | if (enc.lower()=="quoted-printable") { |
71 | mimetype = MAILMIME_MECHANISM_QUOTED_PRINTABLE; | 71 | mimetype = MAILMIME_MECHANISM_QUOTED_PRINTABLE; |
72 | } else if (enc.lower()=="base64") { | 72 | } else if (enc.lower()=="base64") { |
73 | mimetype = MAILMIME_MECHANISM_BASE64; | 73 | mimetype = MAILMIME_MECHANISM_BASE64; |
74 | } else if (enc.lower()=="8bit") { | 74 | } else if (enc.lower()=="8bit") { |
75 | mimetype = MAILMIME_MECHANISM_8BIT; | 75 | mimetype = MAILMIME_MECHANISM_8BIT; |
76 | } else if (enc.lower()=="binary") { | 76 | } else if (enc.lower()=="binary") { |
77 | mimetype = MAILMIME_MECHANISM_BINARY; | 77 | mimetype = MAILMIME_MECHANISM_BINARY; |
78 | } | 78 | } |
79 | 79 | ||
80 | int err = mailmime_part_parse(text->Content(),text->Length(),&index,mimetype, | 80 | int err = mailmime_part_parse(text->Content(),text->Length(),&index,mimetype, |
81 | &result_text,&target_length); | 81 | &result_text,&target_length); |
82 | 82 | ||
83 | encodedString* result = new encodedString(); | 83 | encodedString* result = new encodedString(); |
84 | if (err == MAILIMF_NO_ERROR) { | 84 | if (err == MAILIMF_NO_ERROR) { |
85 | result->setContent(result_text,target_length); | 85 | result->setContent(result_text,target_length); |
86 | } | 86 | } |
87 | //odebug << "Decode string finished" << oendl; | 87 | //odebug << "Decode string finished" << oendl; |
88 | return result; | 88 | return result; |
89 | } | 89 | } |
90 | 90 | ||
91 | QString AbstractMail::convert_String(const char*text) | 91 | QString AbstractMail::convert_String(const char*text) |
92 | { | 92 | { |
93 | //size_t index = 0; | 93 | size_t index = 0; |
94 | char*res = 0; | 94 | char*res = 0; |
95 | int err = MAILIMF_NO_ERROR; | 95 | int err = MAILIMF_NO_ERROR; |
96 | 96 | ||
97 | QString result(text); | 97 | QString result(text); |
98 | 98 | ||
99 | /* due a bug in libetpan it isn't usable this moment */ | 99 | err = mailmime_encoded_phrase_parse("iso-8859-1", |
100 | /* int err = mailmime_encoded_phrase_parse("iso-8859-1", | 100 | text, strlen(text),&index, "iso-8859-1",&res); |
101 | text, strlen(text),&index, "iso-8859-1",&res);*/ | ||
102 | //odebug << "Input: " << text << "" << oendl; | ||
103 | if (err == MAILIMF_NO_ERROR && res && strlen(res)) { | 101 | if (err == MAILIMF_NO_ERROR && res && strlen(res)) { |
104 | // result = QString(res); | 102 | result = QString(res); |
105 | // odebug << "Res: " << res << ", length: " << strlen(res) << "" << oendl; | ||
106 | } | 103 | } |
104 | //qDebug("convert_String:%s ",result.latin1() ); | ||
107 | if (res) free(res); | 105 | if (res) free(res); |
108 | return result; | 106 | return result; |
109 | } | 107 | } |
110 | 108 | ||
111 | /* cp & paste from launcher */ | 109 | /* cp & paste from launcher */ |
112 | QString AbstractMail::gen_attachment_id() | 110 | QString AbstractMail::gen_attachment_id() |
113 | { | 111 | { |
114 | QFile file( "/proc/sys/kernel/random/uuid" ); | 112 | QFile file( "/proc/sys/kernel/random/uuid" ); |
115 | if (!file.open(IO_ReadOnly ) ) | 113 | if (!file.open(IO_ReadOnly ) ) |
116 | return QString::null; | 114 | return QString::null; |
117 | 115 | ||
118 | QTextStream stream(&file); | 116 | QTextStream stream(&file); |
119 | 117 | ||
120 | return "{" + stream.read().stripWhiteSpace() + "}"; | 118 | return "{" + stream.read().stripWhiteSpace() + "}"; |
121 | } | 119 | } |
122 | 120 | ||
123 | int AbstractMail::createMbox(const QString&,const FolderP&,const QString& ,bool) | 121 | int AbstractMail::createMbox(const QString&,const FolderP&,const QString& ,bool) |
124 | { | 122 | { |
125 | return 0; | 123 | return 0; |
126 | } | 124 | } |
127 | 125 | ||
128 | QString AbstractMail::defaultLocalfolder() | 126 | QString AbstractMail::defaultLocalfolder() |
129 | { | 127 | { |
130 | // QString f = getenv( "HOME" ); | 128 | // QString f = getenv( "HOME" ); |
diff --git a/kmicromail/libmailwrapper/genericwrapper.cpp b/kmicromail/libmailwrapper/genericwrapper.cpp index e691082..d89a5f9 100644 --- a/kmicromail/libmailwrapper/genericwrapper.cpp +++ b/kmicromail/libmailwrapper/genericwrapper.cpp | |||
@@ -257,53 +257,53 @@ void Genericwrapper::traverseBody(RecBodyP&target,mailmessage*message,mailmime*m | |||
257 | /* the own header is always at recursion 0 - we don't need that */ | 257 | /* the own header is always at recursion 0 - we don't need that */ |
258 | if (current_rec > 0) { | 258 | if (current_rec > 0) { |
259 | part->setPositionlist(countlist); | 259 | part->setPositionlist(countlist); |
260 | r = mailmessage_fetch_section(message,mime,&data,&len); | 260 | r = mailmessage_fetch_section(message,mime,&data,&len); |
261 | part->setSize(len); | 261 | part->setSize(len); |
262 | part->setPositionlist(countlist); | 262 | part->setPositionlist(countlist); |
263 | b = gen_attachment_id(); | 263 | b = gen_attachment_id(); |
264 | part->setIdentifier(b); | 264 | part->setIdentifier(b); |
265 | part->setType("message"); | 265 | part->setType("message"); |
266 | part->setSubtype("rfc822"); | 266 | part->setSubtype("rfc822"); |
267 | bodyCache[b]=new encodedString(data,len); | 267 | bodyCache[b]=new encodedString(data,len); |
268 | target->addPart(part); | 268 | target->addPart(part); |
269 | } | 269 | } |
270 | if (mime->mm_data.mm_message.mm_msg_mime != NULL) { | 270 | if (mime->mm_data.mm_message.mm_msg_mime != NULL) { |
271 | traverseBody(target,message,mime->mm_data.mm_message.mm_msg_mime,countlist,current_rec+1); | 271 | traverseBody(target,message,mime->mm_data.mm_message.mm_msg_mime,countlist,current_rec+1); |
272 | } | 272 | } |
273 | } | 273 | } |
274 | break; | 274 | break; |
275 | } | 275 | } |
276 | } | 276 | } |
277 | 277 | ||
278 | RecBodyP Genericwrapper::parseMail( mailmessage * msg ) | 278 | RecBodyP Genericwrapper::parseMail( mailmessage * msg ) |
279 | { | 279 | { |
280 | int err = MAILIMF_NO_ERROR; | 280 | int err = MAILIMF_NO_ERROR; |
281 | mailmime_single_fields fields; | 281 | //mailmime_single_fields fields; |
282 | /* is bound to msg and will be freed there */ | 282 | /* is bound to msg and will be freed there */ |
283 | mailmime * mime=0; | 283 | mailmime * mime=0; |
284 | RecBodyP body = new RecBody(); | 284 | RecBodyP body = new RecBody(); |
285 | memset(&fields, 0, sizeof(struct mailmime_single_fields)); | 285 | //memset(&fields, 0, sizeof(struct mailmime_single_fields)); |
286 | err = mailmessage_get_bodystructure(msg,&mime); | 286 | err = mailmessage_get_bodystructure(msg,&mime); |
287 | QValueList<int>recList; | 287 | QValueList<int>recList; |
288 | traverseBody(body,msg,mime,recList); | 288 | traverseBody(body,msg,mime,recList); |
289 | return body; | 289 | return body; |
290 | } | 290 | } |
291 | 291 | ||
292 | 292 | ||
293 | QString Genericwrapper::parseAddressList( mailimf_address_list *list ) | 293 | QString Genericwrapper::parseAddressList( mailimf_address_list *list ) |
294 | { | 294 | { |
295 | QString result( "" ); | 295 | QString result( "" ); |
296 | 296 | ||
297 | bool first = true; | 297 | bool first = true; |
298 | if (list == 0) return result; | 298 | if (list == 0) return result; |
299 | for ( clistiter *current = clist_begin( list->ad_list ); current != NULL; current = current->next ) { | 299 | for ( clistiter *current = clist_begin( list->ad_list ); current != NULL; current = current->next ) { |
300 | mailimf_address *addr = (mailimf_address *) current->data; | 300 | mailimf_address *addr = (mailimf_address *) current->data; |
301 | 301 | ||
302 | if ( !first ) { | 302 | if ( !first ) { |
303 | result.append( "," ); | 303 | result.append( "," ); |
304 | } else { | 304 | } else { |
305 | first = false; | 305 | first = false; |
306 | } | 306 | } |
307 | 307 | ||
308 | switch ( addr->ad_type ) { | 308 | switch ( addr->ad_type ) { |
309 | case MAILIMF_ADDRESS_MAILBOX: | 309 | case MAILIMF_ADDRESS_MAILBOX: |