Diffstat (limited to 'noncore/net/mail/viewmail.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/mail/viewmail.cpp | 40 |
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 | |||
@@ -77,24 +77,24 @@ AttachItem* ViewMail::lastChild(AttachItem*parent) | |||
77 | } | 77 | } |
78 | return item; | 78 | return item; |
79 | } | 79 | } |
80 | 80 | ||
81 | void ViewMail::setBody( RecBody body ) | 81 | void 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; |
91 | } | 91 | } |
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; |
99 | 99 | ||
100 | while (s>1024) | 100 | while (s>1024) |
@@ -128,25 +128,25 @@ void ViewMail::setBody( RecBody body ) | |||
128 | o.setf(QTextStream::fixed); | 128 | o.setf(QTextStream::fixed); |
129 | o << s << " " << q << "Byte"; | 129 | o << s << " " << q << "Byte"; |
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()); |
143 | if (it.key().lower()=="name") | 143 | if (it.key().lower()=="name") |
144 | { | 144 | { |
145 | filename=it.data(); | 145 | filename=it.data(); |
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) |
151 | { | 151 | { |
152 | s/=1024; | 152 | s/=1024; |
@@ -168,21 +168,21 @@ void ViewMail::setBody( RecBody body ) | |||
168 | QTextOStream o(&fsize); | 168 | QTextOStream o(&fsize); |
169 | if (w>0) o.precision(2); else o.precision(0); | 169 | if (w>0) o.precision(2); else o.precision(0); |
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; |
181 | } | 181 | } |
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 | } |
187 | } | 187 | } |
188 | 188 | ||
@@ -225,9 +225,9 @@ void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int | |||
225 | "/", item->text( 2 ) , types, 0 ); | 225 | "/", item->text( 2 ) , types, 0 ); |
226 | 226 | ||
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 | { |
232 | QFile output(str); | 232 | QFile output(str); |
233 | output.open(IO_WriteOnly); | 233 | output.open(IO_WriteOnly); |
@@ -247,18 +247,18 @@ void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int | |||
247 | else | 247 | else |
248 | { | 248 | { |
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 | } |
254 | break; | 254 | break; |
255 | } | 255 | } |
256 | delete menu; | 256 | delete menu; |
257 | } | 257 | } |
258 | 258 | ||
259 | 259 | ||
260 | void ViewMail::setMail( RecMailP mail ) | 260 | void ViewMail::setMail(const RecMailP&mail ) |
261 | { | 261 | { |
262 | 262 | ||
263 | m_recMail = mail; | 263 | m_recMail = mail; |
264 | 264 | ||