-rw-r--r-- | noncore/net/mail/viewmail.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/noncore/net/mail/viewmail.cpp b/noncore/net/mail/viewmail.cpp index 5206220..a89393c 100644 --- a/noncore/net/mail/viewmail.cpp +++ b/noncore/net/mail/viewmail.cpp | |||
@@ -175,48 +175,49 @@ void ViewMail::setBody(const RecBodyP&body ) | |||
175 | if (w>0) o.precision(2); else o.precision(0); | 175 | if (w>0) o.precision(2); else o.precision(0); |
176 | o.setf(QTextStream::fixed); | 176 | o.setf(QTextStream::fixed); |
177 | o << s << " " << q << "Byte"; | 177 | o << s << " " << q << "Byte"; |
178 | desc = body->Parts()[i]->Description(); | 178 | desc = body->Parts()[i]->Description(); |
179 | parentItem = searchParent(body->Parts()[i]->Positionlist()); | 179 | parentItem = searchParent(body->Parts()[i]->Positionlist()); |
180 | if (parentItem) | 180 | if (parentItem) |
181 | { | 181 | { |
182 | AttachItem*temp = lastChild(parentItem); | 182 | AttachItem*temp = lastChild(parentItem); |
183 | if (temp) curItem = temp; | 183 | if (temp) curItem = temp; |
184 | curItem=new AttachItem(parentItem,curItem,type,desc,filename,fsize,i,body->Parts()[i]->Positionlist()); | 184 | curItem=new AttachItem(parentItem,curItem,type,desc,filename,fsize,i,body->Parts()[i]->Positionlist()); |
185 | attachments->setRootIsDecorated(true); | 185 | attachments->setRootIsDecorated(true); |
186 | curItem = parentItem; | 186 | curItem = parentItem; |
187 | } | 187 | } |
188 | else | 188 | else |
189 | { | 189 | { |
190 | curItem=new AttachItem(attachments,curItem,type,desc,filename,fsize,i,body->Parts()[i]->Positionlist()); | 190 | curItem=new AttachItem(attachments,curItem,type,desc,filename,fsize,i,body->Parts()[i]->Positionlist()); |
191 | } | 191 | } |
192 | } | 192 | } |
193 | } | 193 | } |
194 | 194 | ||
195 | 195 | ||
196 | void ViewMail::slotShowHtml( bool state ) | 196 | void ViewMail::slotShowHtml( bool state ) |
197 | { | 197 | { |
198 | m_showHtml = state; | 198 | m_showHtml = state; |
199 | m_lasttextpart=-2; | ||
199 | setMainText(); | 200 | setMainText(); |
200 | } | 201 | } |
201 | 202 | ||
202 | void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int ) | 203 | void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int ) |
203 | { | 204 | { |
204 | if (!item ) | 205 | if (!item ) |
205 | return; | 206 | return; |
206 | 207 | ||
207 | if ( ( ( AttachItem* )item )->Partnumber() == -1 ) | 208 | if ( ( ( AttachItem* )item )->Partnumber() == -1 ) |
208 | { | 209 | { |
209 | setMainText(); | 210 | setMainText(); |
210 | return; | 211 | return; |
211 | } | 212 | } |
212 | QPopupMenu *menu = new QPopupMenu(); | 213 | QPopupMenu *menu = new QPopupMenu(); |
213 | int ret=0; | 214 | int ret=0; |
214 | 215 | ||
215 | if ( item->text( 0 ).left( 5 ) == "text/" || item->text(0)=="message/rfc822" ) | 216 | if ( item->text( 0 ).left( 5 ) == "text/" || item->text(0)=="message/rfc822" ) |
216 | { | 217 | { |
217 | menu->insertItem( tr( "Show Text" ), 1 ); | 218 | menu->insertItem( tr( "Show Text" ), 1 ); |
218 | } | 219 | } |
219 | if (item->text(0).left(6)=="image/") { | 220 | if (item->text(0).left(6)=="image/") { |
220 | menu->insertItem(tr("Display image preview"),2); | 221 | menu->insertItem(tr("Display image preview"),2); |
221 | } | 222 | } |
222 | menu->insertItem( tr( "Save Attachment" ), 0 ); | 223 | menu->insertItem( tr( "Save Attachment" ), 0 ); |
@@ -310,48 +311,49 @@ void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int | |||
310 | browser->setText(s); | 311 | browser->setText(s); |
311 | } | 312 | } |
312 | } | 313 | } |
313 | break; | 314 | break; |
314 | } | 315 | } |
315 | delete menu; | 316 | delete menu; |
316 | } | 317 | } |
317 | 318 | ||
318 | 319 | ||
319 | void ViewMail::setMail(const RecMailP&mail ) | 320 | void ViewMail::setMail(const RecMailP&mail ) |
320 | { | 321 | { |
321 | 322 | ||
322 | m_recMail = mail; | 323 | m_recMail = mail; |
323 | 324 | ||
324 | m_mail[0] = mail->getFrom(); | 325 | m_mail[0] = mail->getFrom(); |
325 | m_mail[1] = mail->getSubject(); | 326 | m_mail[1] = mail->getSubject(); |
326 | m_mail[3] = mail->getStringDate(); | 327 | m_mail[3] = mail->getStringDate(); |
327 | m_mail[4] = mail->Msgid(); | 328 | m_mail[4] = mail->Msgid(); |
328 | 329 | ||
329 | m_mail2[0] = mail->To(); | 330 | m_mail2[0] = mail->To(); |
330 | m_mail2[1] = mail->CC(); | 331 | m_mail2[1] = mail->CC(); |
331 | m_mail2[2] = mail->Bcc(); | 332 | m_mail2[2] = mail->Bcc(); |
332 | 333 | ||
333 | setCaption(tr("E-Mail by %1").arg( m_mail[0] ) ); | 334 | setCaption(tr("E-Mail by %1").arg( m_mail[0] ) ); |
335 | m_lasttextpart=-2; | ||
334 | setMainText(); | 336 | setMainText(); |
335 | } | 337 | } |
336 | 338 | ||
337 | 339 | ||
338 | 340 | ||
339 | ViewMail::ViewMail( QWidget *parent, const char *name, WFlags fl) | 341 | ViewMail::ViewMail( QWidget *parent, const char *name, WFlags fl) |
340 | : ViewMailBase(parent, name, fl), _inLoop(false) | 342 | : ViewMailBase(parent, name, fl), _inLoop(false) |
341 | { | 343 | { |
342 | m_gotBody = false; | 344 | m_gotBody = false; |
343 | deleted = false; | 345 | deleted = false; |
344 | 346 | ||
345 | connect( reply, SIGNAL(activated()), SLOT(slotReply())); | 347 | connect( reply, SIGNAL(activated()), SLOT(slotReply())); |
346 | connect( forward, SIGNAL(activated()), SLOT(slotForward())); | 348 | connect( forward, SIGNAL(activated()), SLOT(slotForward())); |
347 | connect( deleteMail, SIGNAL( activated() ), SLOT( slotDeleteMail() ) ); | 349 | connect( deleteMail, SIGNAL( activated() ), SLOT( slotDeleteMail() ) ); |
348 | connect( showHtml, SIGNAL( toggled(bool) ), SLOT( slotShowHtml(bool) ) ); | 350 | connect( showHtml, SIGNAL( toggled(bool) ), SLOT( slotShowHtml(bool) ) ); |
349 | connect( showPicsInline, SIGNAL( toggled(bool) ), SLOT( slotImageInline(bool) ) ); | 351 | connect( showPicsInline, SIGNAL( toggled(bool) ), SLOT( slotImageInline(bool) ) ); |
350 | 352 | ||
351 | attachments->setEnabled(m_gotBody); | 353 | attachments->setEnabled(m_gotBody); |
352 | connect( attachments, SIGNAL( clicked(QListViewItem*,const QPoint&, int) ), SLOT( slotItemClicked(QListViewItem*,const QPoint&, int) ) ); | 354 | connect( attachments, SIGNAL( clicked(QListViewItem*,const QPoint&, int) ), SLOT( slotItemClicked(QListViewItem*,const QPoint&, int) ) ); |
353 | m_lastdlg = 0; | 355 | m_lastdlg = 0; |
354 | _icounter = 0; | 356 | _icounter = 0; |
355 | m_lastimagepart = -1; | 357 | m_lastimagepart = -1; |
356 | m_lasttextpart = -2; | 358 | m_lasttextpart = -2; |
357 | 359 | ||