summaryrefslogtreecommitdiff
path: root/noncore/net/mail/viewmail.cpp
Side-by-side diff
Diffstat (limited to 'noncore/net/mail/viewmail.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/net/mail/viewmail.cpp14
1 files changed, 14 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
@@ -64,2 +64,14 @@ AttachItem* ViewMail::searchParent(const QValueList<int>&path)
+AttachItem* ViewMail::lastChild(AttachItem*parent)
+{
+ if (!parent) return 0;
+ AttachItem* item = (AttachItem*)parent->firstChild();
+ if (!item) return item;
+ AttachItem*temp=0;
+ while( (temp=(AttachItem*)item->nextSibling())) {
+ item = temp;
+ }
+ return item;
+}
+
void ViewMail::setBody( RecBody body ) {
@@ -148,2 +160,4 @@ for (unsigned int i = 0; i < body.Parts().count();++i) {
if (parentItem) {
+ AttachItem*temp = lastChild(parentItem);
+ if (temp) curItem = temp;
curItem=new AttachItem(parentItem,curItem,type,desc,filename,fsize,i,body.Parts()[i].Positionlist());