From 22564b62e15c1ea3feada5b2f9b6ec4d98b40c6b Mon Sep 17 00:00:00 2001 From: alwin Date: Sat, 03 Jan 2004 13:04:52 +0000 Subject: some more display beauty --- 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&path) return 0; } +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 ) { m_body = body; @@ -146,6 +158,8 @@ for (unsigned int i = 0; i < body.Parts().count();++i) { desc = body.Parts()[i].Description(); parentItem = searchParent(body.Parts()[i].Positionlist()); if (parentItem) { + AttachItem*temp = lastChild(parentItem); + if (temp) curItem = temp; curItem=new AttachItem(parentItem,curItem,type,desc,filename,fsize,i,body.Parts()[i].Positionlist()); attachments->setRootIsDecorated(true); 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: protected: QString deHtml(const QString &string); AttachItem* searchParent(const QValueList&path); + AttachItem* lastChild(AttachItem*parent); protected slots: void slotReply(); -- cgit v0.9.0.2