summaryrefslogtreecommitdiff
path: root/noncore/net/mail/viewmail.cpp
authoralwin <alwin>2004-03-18 18:00:18 (UTC)
committer alwin <alwin>2004-03-18 18:00:18 (UTC)
commitfef9cec046fcf21a4f762c36454b8f253dd3e25e (patch) (unidiff)
treeb87ee38164e1e9ce635dde34c13677f09388c058 /noncore/net/mail/viewmail.cpp
parent69fa0e7b5cab5f4cdfdac736e31ff0fd0fbf4312 (diff)
downloadopie-fef9cec046fcf21a4f762c36454b8f253dd3e25e.zip
opie-fef9cec046fcf21a4f762c36454b8f253dd3e25e.tar.gz
opie-fef9cec046fcf21a4f762c36454b8f253dd3e25e.tar.bz2
some (hopeful) improvements
Diffstat (limited to 'noncore/net/mail/viewmail.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/viewmail.cpp40
1 files changed, 20 insertions, 20 deletions
diff --git a/noncore/net/mail/viewmail.cpp b/noncore/net/mail/viewmail.cpp
index f00d2cb..156e11d 100644
--- a/noncore/net/mail/viewmail.cpp
+++ b/noncore/net/mail/viewmail.cpp
@@ -79,12 +79,12 @@ AttachItem* ViewMail::lastChild(AttachItem*parent)
79} 79}
80 80
81void ViewMail::setBody( RecBody body ) 81void ViewMail::setBody(const RecBodyP&body )
82{ 82{
83 83
84 m_body = body; 84 m_body = body;
85 m_mail[2] = body.Bodytext(); 85 m_mail[2] = body->Bodytext();
86 attachbutton->setEnabled(body.Parts().count()>0); 86 attachbutton->setEnabled(body->Parts().count()>0);
87 attachments->setEnabled(body.Parts().count()>0); 87 attachments->setEnabled(body->Parts().count()>0);
88 if (body.Parts().count()==0) 88 if (body->Parts().count()==0)
89 { 89 {
90 return; 90 return;
@@ -92,7 +92,7 @@ void ViewMail::setBody( RecBody body )
92 AttachItem * curItem=0; 92 AttachItem * curItem=0;
93 AttachItem * parentItem = 0; 93 AttachItem * parentItem = 0;
94 QString type=body.Description().Type()+"/"+body.Description().Subtype(); 94 QString type=body->Description()->Type()+"/"+body->Description()->Subtype();
95 QString desc,fsize; 95 QString desc,fsize;
96 double s = body.Description().Size(); 96 double s = body->Description()->Size();
97 int w; 97 int w;
98 w=0; 98 w=0;
@@ -130,13 +130,13 @@ void ViewMail::setBody( RecBody body )
130 } 130 }
131 131
132 curItem=new AttachItem(attachments,curItem,type,"Mailbody","",fsize,-1,body.Description().Positionlist()); 132 curItem=new AttachItem(attachments,curItem,type,"Mailbody","",fsize,-1,body->Description()->Positionlist());
133 QString filename = ""; 133 QString filename = "";
134 134
135 for (unsigned int i = 0; i < body.Parts().count();++i) 135 for (unsigned int i = 0; i < body->Parts().count();++i)
136 { 136 {
137 filename = ""; 137 filename = "";
138 type = body.Parts()[i].Type()+"/"+body.Parts()[i].Subtype(); 138 type = body->Parts()[i]->Type()+"/"+body->Parts()[i]->Subtype();
139 part_plist_t::ConstIterator it = body.Parts()[i].Parameters().begin(); 139 part_plist_t::ConstIterator it = body->Parts()[i]->Parameters().begin();
140 for (;it!=body.Parts()[i].Parameters().end();++it) 140 for (;it!=body->Parts()[i]->Parameters().end();++it)
141 { 141 {
142 qDebug(it.key()); 142 qDebug(it.key());
@@ -146,5 +146,5 @@ void ViewMail::setBody( RecBody body )
146 } 146 }
147 } 147 }
148 s = body.Parts()[i].Size(); 148 s = body->Parts()[i]->Size();
149 w = 0; 149 w = 0;
150 while (s>1024) 150 while (s>1024)
@@ -170,11 +170,11 @@ void ViewMail::setBody( RecBody body )
170 o.setf(QTextStream::fixed); 170 o.setf(QTextStream::fixed);
171 o << s << " " << q << "Byte"; 171 o << s << " " << q << "Byte";
172 desc = body.Parts()[i].Description(); 172 desc = body->Parts()[i]->Description();
173 parentItem = searchParent(body.Parts()[i].Positionlist()); 173 parentItem = searchParent(body->Parts()[i]->Positionlist());
174 if (parentItem) 174 if (parentItem)
175 { 175 {
176 AttachItem*temp = lastChild(parentItem); 176 AttachItem*temp = lastChild(parentItem);
177 if (temp) curItem = temp; 177 if (temp) curItem = temp;
178 curItem=new AttachItem(parentItem,curItem,type,desc,filename,fsize,i,body.Parts()[i].Positionlist()); 178 curItem=new AttachItem(parentItem,curItem,type,desc,filename,fsize,i,body->Parts()[i]->Positionlist());
179 attachments->setRootIsDecorated(true); 179 attachments->setRootIsDecorated(true);
180 curItem = parentItem; 180 curItem = parentItem;
@@ -182,5 +182,5 @@ void ViewMail::setBody( RecBody body )
182 else 182 else
183 { 183 {
184 curItem=new AttachItem(attachments,curItem,type,desc,filename,fsize,i,body.Parts()[i].Positionlist()); 184 curItem=new AttachItem(attachments,curItem,type,desc,filename,fsize,i,body->Parts()[i]->Positionlist());
185 } 185 }
186 } 186 }
@@ -227,5 +227,5 @@ void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int
227 if( !str.isEmpty() ) 227 if( !str.isEmpty() )
228 { 228 {
229 encodedString*content = m_recMail->Wrapper()->fetchDecodedPart( m_recMail, m_body.Parts()[ ( ( AttachItem* )item )->Partnumber() ] ); 229 encodedString*content = m_recMail->Wrapper()->fetchDecodedPart( m_recMail, m_body->Parts()[ ( ( AttachItem* )item )->Partnumber() ] );
230 if (content) 230 if (content)
231 { 231 {
@@ -249,5 +249,5 @@ void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int
249 if ( m_recMail->Wrapper() != 0l ) 249 if ( m_recMail->Wrapper() != 0l )
250 { // make sure that there is a wrapper , even after delete or simular actions 250 { // make sure that there is a wrapper , even after delete or simular actions
251 browser->setText( m_recMail->Wrapper()->fetchTextPart( m_recMail, m_body.Parts()[ ( ( AttachItem* )item )->Partnumber() ] ) ); 251 browser->setText( m_recMail->Wrapper()->fetchTextPart( m_recMail, m_body->Parts()[ ( ( AttachItem* )item )->Partnumber() ] ) );
252 } 252 }
253 } 253 }
@@ -258,5 +258,5 @@ void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int
258 258
259 259
260void ViewMail::setMail( RecMailP mail ) 260void ViewMail::setMail(const RecMailP&mail )
261{ 261{
262 262