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) (unidiff)
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) (ignore 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)
59 AttachItem*ati = (AttachItem*)it.current(); 59 AttachItem*ati = (AttachItem*)it.current();
60 if (ati->isParentof(path)) return ati; 60 if (ati->isParentof(path)) return ati;
61 } 61 }
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;
68m_mail[2] = body.Bodytext(); 80m_mail[2] = body.Bodytext();
69attachbutton->setEnabled(body.Parts().count()>0); 81attachbutton->setEnabled(body.Parts().count()>0);
70attachments->setEnabled(body.Parts().count()>0); 82attachments->setEnabled(body.Parts().count()>0);
@@ -143,12 +155,14 @@ for (unsigned int i = 0; i < body.Parts().count();++i) {
143 if (w>0) o.precision(2); else o.precision(0); 155 if (w>0) o.precision(2); else o.precision(0);
144 o.setf(QTextStream::fixed); 156 o.setf(QTextStream::fixed);
145 o << s << " " << q << "Byte"; 157 o << s << " " << q << "Byte";
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;
152 } else { 166 } else {
153 curItem=new AttachItem(attachments,curItem,type,desc,filename,fsize,i,body.Parts()[i].Positionlist()); 167 curItem=new AttachItem(attachments,curItem,type,desc,filename,fsize,i,body.Parts()[i].Positionlist());
154 } 168 }