summaryrefslogtreecommitdiff
path: root/noncore/net/mail/viewmail.cpp
authoralwin <alwin>2004-01-03 13:04:52 (UTC)
committer alwin <alwin>2004-01-03 13:04:52 (UTC)
commit22564b62e15c1ea3feada5b2f9b6ec4d98b40c6b (patch) (side-by-side diff)
tree85847776be6743270b18f5e1df9fa6451288f7a6 /noncore/net/mail/viewmail.cpp
parent452aac36b77ed1f7e6db3a7952028bf6027e54b6 (diff)
downloadopie-22564b62e15c1ea3feada5b2f9b6ec4d98b40c6b.zip
opie-22564b62e15c1ea3feada5b2f9b6ec4d98b40c6b.tar.gz
opie-22564b62e15c1ea3feada5b2f9b6ec4d98b40c6b.tar.bz2
some more display beauty
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
@@ -59,12 +59,24 @@ AttachItem* ViewMail::searchParent(const QValueList<int>&path)
AttachItem*ati = (AttachItem*)it.current();
if (ati->isParentof(path)) return ati;
}
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;
m_mail[2] = body.Bodytext();
attachbutton->setEnabled(body.Parts().count()>0);
attachments->setEnabled(body.Parts().count()>0);
@@ -143,12 +155,14 @@ for (unsigned int i = 0; i < body.Parts().count();++i) {
if (w>0) o.precision(2); else o.precision(0);
o.setf(QTextStream::fixed);
o << s << " " << q << "Byte";
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;
} else {
curItem=new AttachItem(attachments,curItem,type,desc,filename,fsize,i,body.Parts()[i].Positionlist());
}