summaryrefslogtreecommitdiff
path: root/noncore/net
Unidiff
Diffstat (limited to 'noncore/net') (more/less context) (show whitespace changes)
-rw-r--r--noncore/net/mail/viewmail.cpp14
-rw-r--r--noncore/net/mail/viewmail.h1
2 files changed, 15 insertions, 0 deletions
diff --git a/noncore/net/mail/viewmail.cpp b/noncore/net/mail/viewmail.cpp
index d4c5150..ed77eb5 100644
--- a/noncore/net/mail/viewmail.cpp
+++ b/noncore/net/mail/viewmail.cpp
@@ -62,6 +62,18 @@ AttachItem* ViewMail::searchParent(const QValueList<int>&path)
62 return 0; 62 return 0;
63} 63}
64 64
65AttachItem* ViewMail::lastChild(AttachItem*parent)
66{
67 if (!parent) return 0;
68 AttachItem* item = (AttachItem*)parent->firstChild();
69 if (!item) return item;
70 AttachItem*temp=0;
71 while( (temp=(AttachItem*)item->nextSibling())) {
72 item = temp;
73 }
74 return item;
75}
76
65void ViewMail::setBody( RecBody body ) { 77void ViewMail::setBody( RecBody body ) {
66 78
67m_body = body; 79m_body = body;
@@ -146,6 +158,8 @@ for (unsigned int i = 0; i < body.Parts().count();++i) {
146 desc = body.Parts()[i].Description(); 158 desc = body.Parts()[i].Description();
147 parentItem = searchParent(body.Parts()[i].Positionlist()); 159 parentItem = searchParent(body.Parts()[i].Positionlist());
148 if (parentItem) { 160 if (parentItem) {
161 AttachItem*temp = lastChild(parentItem);
162 if (temp) curItem = temp;
149 curItem=new AttachItem(parentItem,curItem,type,desc,filename,fsize,i,body.Parts()[i].Positionlist()); 163 curItem=new AttachItem(parentItem,curItem,type,desc,filename,fsize,i,body.Parts()[i].Positionlist());
150 attachments->setRootIsDecorated(true); 164 attachments->setRootIsDecorated(true);
151 curItem = parentItem; 165 curItem = parentItem;
diff --git a/noncore/net/mail/viewmail.h b/noncore/net/mail/viewmail.h
index b3d3b4e..29681cc 100644
--- a/noncore/net/mail/viewmail.h
+++ b/noncore/net/mail/viewmail.h
@@ -42,6 +42,7 @@ public:
42protected: 42protected:
43 QString deHtml(const QString &string); 43 QString deHtml(const QString &string);
44 AttachItem* searchParent(const QValueList<int>&path); 44 AttachItem* searchParent(const QValueList<int>&path);
45 AttachItem* lastChild(AttachItem*parent);
45 46
46protected slots: 47protected slots:
47 void slotReply(); 48 void slotReply();