-rw-r--r-- | kmicromail/libmailwrapper/genericwrapper.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/kmicromail/libmailwrapper/genericwrapper.cpp b/kmicromail/libmailwrapper/genericwrapper.cpp index eac05e5..1ed9f34 100644 --- a/kmicromail/libmailwrapper/genericwrapper.cpp +++ b/kmicromail/libmailwrapper/genericwrapper.cpp | |||
@@ -204,59 +204,61 @@ void Genericwrapper::traverseBody(RecBodyP&target,mailmessage*message,mailmime*m | |||
204 | countlist.append(current_count); | 204 | countlist.append(current_count); |
205 | r = mailmessage_fetch_section(message,mime,&data,&len); | 205 | r = mailmessage_fetch_section(message,mime,&data,&len); |
206 | part->setSize(len); | 206 | part->setSize(len); |
207 | part->setPositionlist(countlist); | 207 | part->setPositionlist(countlist); |
208 | b = gen_attachment_id(); | 208 | b = gen_attachment_id(); |
209 | part->setIdentifier(b); | 209 | part->setIdentifier(b); |
210 | fillSingleBody(part,message,mime); | 210 | fillSingleBody(part,message,mime); |
211 | if (part->Type()=="text" && target->Bodytext().isNull()) { | 211 | if (part->Type()=="text" && target->Bodytext().isNull()) { |
212 | encodedString*rs = new encodedString(); | 212 | encodedString*rs = new encodedString(); |
213 | rs->setContent(data,len); | 213 | rs->setContent(data,len); |
214 | encodedString*res = decode_String(rs,part->Encoding()); | 214 | encodedString*res = decode_String(rs,part->Encoding()); |
215 | if (countlist.count()>2) { | 215 | if (countlist.count()>2) { |
216 | bodyCache[b]=rs; | 216 | bodyCache[b]=rs; |
217 | target->addPart(part); | 217 | target->addPart(part); |
218 | } else { | 218 | } else { |
219 | delete rs; | 219 | delete rs; |
220 | } | 220 | } |
221 | b = QString(res->Content()); | 221 | b = QString(res->Content()); |
222 | delete res; | 222 | delete res; |
223 | size_t index = 0; | 223 | size_t index = 0; |
224 | char*resu = 0; | 224 | char*resu = 0; |
225 | int err = MAILIMF_NO_ERROR; | 225 | int err = MAILIMF_NO_ERROR; |
226 | QString charset = part->searchParamter( "charset"); | 226 | QString charset = part->searchParamter( "charset"); |
227 | qDebug("CHARSET %s ",charset.latin1() ); | 227 | qDebug("CHARSET %s ",charset.latin1() ); |
228 | #if 0 | ||
228 | if (false ) { | 229 | if (false ) { |
229 | //if ( !charset.isEmpty() ) { | 230 | //if ( !charset.isEmpty() ) { |
230 | target->setCharset( charset ); | 231 | target->setCharset( charset ); |
231 | err = mailmime_encoded_phrase_parse(charset.latin1(), | 232 | err = mailmime_encoded_phrase_parse(charset.latin1(), |
232 | b.latin1(), b.length(),&index, "utf-8",&resu); | 233 | b.latin1(), b.length(),&index, "utf-8",&resu); |
233 | if (err == MAILIMF_NO_ERROR && resu && strlen(resu)) { | 234 | if (err == MAILIMF_NO_ERROR && resu && strlen(resu)) { |
234 | //qDebug("res %d %s ", index, resu); | 235 | //qDebug("res %d %s ", index, resu); |
235 | b = QString::fromUtf8(resu); | 236 | b = QString::fromUtf8(resu); |
236 | } | 237 | } |
237 | if (resu) free(resu); | 238 | if (resu) free(resu); |
238 | } | 239 | } |
240 | #endif | ||
239 | target->setBodytext(b); | 241 | target->setBodytext(b); |
240 | target->setDescription(part); | 242 | target->setDescription(part); |
241 | } else { | 243 | } else { |
242 | bodyCache[b]=new encodedString(data,len); | 244 | bodyCache[b]=new encodedString(data,len); |
243 | target->addPart(part); | 245 | target->addPart(part); |
244 | } | 246 | } |
245 | } | 247 | } |
246 | break; | 248 | break; |
247 | case MAILMIME_MULTIPLE: | 249 | case MAILMIME_MULTIPLE: |
248 | { | 250 | { |
249 | unsigned int ccount = 1; | 251 | unsigned int ccount = 1; |
250 | mailmime*cbody=0; | 252 | mailmime*cbody=0; |
251 | QValueList<int>countlist = recList; | 253 | QValueList<int>countlist = recList; |
252 | for (cur = clist_begin(mime->mm_data.mm_multipart.mm_mp_list) ; cur != NULL ; cur = clist_next(cur)) { | 254 | for (cur = clist_begin(mime->mm_data.mm_multipart.mm_mp_list) ; cur != NULL ; cur = clist_next(cur)) { |
253 | cbody = (mailmime*)clist_content(cur); | 255 | cbody = (mailmime*)clist_content(cur); |
254 | if (cbody->mm_type==MAILMIME_MULTIPLE) { | 256 | if (cbody->mm_type==MAILMIME_MULTIPLE) { |
255 | RecPartP targetPart = new RecPart(); | 257 | RecPartP targetPart = new RecPart(); |
256 | targetPart->setType("multipart"); | 258 | targetPart->setType("multipart"); |
257 | countlist.append(current_count); | 259 | countlist.append(current_count); |
258 | targetPart->setPositionlist(countlist); | 260 | targetPart->setPositionlist(countlist); |
259 | target->addPart(targetPart); | 261 | target->addPart(targetPart); |
260 | } | 262 | } |
261 | traverseBody(target,message, cbody,countlist,current_rec+1,ccount); | 263 | traverseBody(target,message, cbody,countlist,current_rec+1,ccount); |
262 | if (cbody->mm_type==MAILMIME_MULTIPLE) { | 264 | if (cbody->mm_type==MAILMIME_MULTIPLE) { |