summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/genericwrapper.cpp26
-rw-r--r--noncore/net/mail/genericwrapper.h2
-rw-r--r--noncore/net/mail/libmailwrapper/genericwrapper.cpp26
-rw-r--r--noncore/net/mail/libmailwrapper/genericwrapper.h2
4 files changed, 44 insertions, 12 deletions
diff --git a/noncore/net/mail/genericwrapper.cpp b/noncore/net/mail/genericwrapper.cpp
index 62116ba..714396b 100644
--- a/noncore/net/mail/genericwrapper.cpp
+++ b/noncore/net/mail/genericwrapper.cpp
@@ -140,4 +140,2 @@ void Genericwrapper::traverseBody(RecBody&target,mailmessage*message,mailmime*mi
- //current_count;
-
switch (mime->mm_type) {
@@ -157,4 +155,9 @@ void Genericwrapper::traverseBody(RecBody&target,mailmessage*message,mailmime*mi
encodedString*res = decode_String(r,part.Encoding());
+ if (countlist.count()>2) {
+ bodyCache[b]=r;
+ target.addPart(part);
+ } else {
+ delete r;
+ }
b = QString(res->Content());
- delete r;
delete res;
@@ -170,5 +173,18 @@ void Genericwrapper::traverseBody(RecBody&target,mailmessage*message,mailmime*mi
{
- unsigned int ccount = current_count;
+ unsigned int ccount = 1;
+ mailmime*cbody=0;
+ QValueList<int>countlist = recList;
for (cur = clist_begin(mime->mm_data.mm_multipart.mm_mp_list) ; cur != NULL ; cur = clist_next(cur)) {
- traverseBody(target,message, (mailmime*)clist_content(cur),recList,current_rec+1,ccount);
+ cbody = (mailmime*)clist_content(cur);
+ if (cbody->mm_type==MAILMIME_MULTIPLE) {
+ RecPart targetPart;
+ targetPart.setType("multipart");
+ countlist.append(current_count);
+ targetPart.setPositionlist(countlist);
+ target.addPart(targetPart);
+ }
+ traverseBody(target,message, cbody,countlist,current_rec+1,ccount);
+ if (cbody->mm_type==MAILMIME_MULTIPLE) {
+ countlist = recList;
+ }
++ccount;
diff --git a/noncore/net/mail/genericwrapper.h b/noncore/net/mail/genericwrapper.h
index c00d864..32b75c8 100644
--- a/noncore/net/mail/genericwrapper.h
+++ b/noncore/net/mail/genericwrapper.h
@@ -47,3 +47,3 @@ protected:
- void traverseBody(RecBody&target,mailmessage*message,mailmime*mime,QValueList<int>recList,unsigned int current_rek=0,int current_count=0);
+ void traverseBody(RecBody&target,mailmessage*message,mailmime*mime,QValueList<int>recList,unsigned int current_rek=0,int current_count=1);
static void fillSingleBody(RecPart&target,mailmessage*message,mailmime*mime);
diff --git a/noncore/net/mail/libmailwrapper/genericwrapper.cpp b/noncore/net/mail/libmailwrapper/genericwrapper.cpp
index 62116ba..714396b 100644
--- a/noncore/net/mail/libmailwrapper/genericwrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/genericwrapper.cpp
@@ -140,4 +140,2 @@ void Genericwrapper::traverseBody(RecBody&target,mailmessage*message,mailmime*mi
- //current_count;
-
switch (mime->mm_type) {
@@ -157,4 +155,9 @@ void Genericwrapper::traverseBody(RecBody&target,mailmessage*message,mailmime*mi
encodedString*res = decode_String(r,part.Encoding());
+ if (countlist.count()>2) {
+ bodyCache[b]=r;
+ target.addPart(part);
+ } else {
+ delete r;
+ }
b = QString(res->Content());
- delete r;
delete res;
@@ -170,5 +173,18 @@ void Genericwrapper::traverseBody(RecBody&target,mailmessage*message,mailmime*mi
{
- unsigned int ccount = current_count;
+ unsigned int ccount = 1;
+ mailmime*cbody=0;
+ QValueList<int>countlist = recList;
for (cur = clist_begin(mime->mm_data.mm_multipart.mm_mp_list) ; cur != NULL ; cur = clist_next(cur)) {
- traverseBody(target,message, (mailmime*)clist_content(cur),recList,current_rec+1,ccount);
+ cbody = (mailmime*)clist_content(cur);
+ if (cbody->mm_type==MAILMIME_MULTIPLE) {
+ RecPart targetPart;
+ targetPart.setType("multipart");
+ countlist.append(current_count);
+ targetPart.setPositionlist(countlist);
+ target.addPart(targetPart);
+ }
+ traverseBody(target,message, cbody,countlist,current_rec+1,ccount);
+ if (cbody->mm_type==MAILMIME_MULTIPLE) {
+ countlist = recList;
+ }
++ccount;
diff --git a/noncore/net/mail/libmailwrapper/genericwrapper.h b/noncore/net/mail/libmailwrapper/genericwrapper.h
index c00d864..32b75c8 100644
--- a/noncore/net/mail/libmailwrapper/genericwrapper.h
+++ b/noncore/net/mail/libmailwrapper/genericwrapper.h
@@ -47,3 +47,3 @@ protected:
- void traverseBody(RecBody&target,mailmessage*message,mailmime*mime,QValueList<int>recList,unsigned int current_rek=0,int current_count=0);
+ void traverseBody(RecBody&target,mailmessage*message,mailmime*mime,QValueList<int>recList,unsigned int current_rek=0,int current_count=1);
static void fillSingleBody(RecPart&target,mailmessage*message,mailmime*mime);