author | zautrix <zautrix> | 2005-01-24 18:27:06 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-01-24 18:27:06 (UTC) |
commit | bb33b559609356149ae51cb50c081b3e82aecafb (patch) (unidiff) | |
tree | 4878aa5887bf1c539845ce9c4e5470eea94d41cc /kmicromail/opiemail.cpp | |
parent | 77f93c632b66b5c8d92e4c63330362272ca1fc40 (diff) | |
download | kdepimpi-bb33b559609356149ae51cb50c081b3e82aecafb.zip kdepimpi-bb33b559609356149ae51cb50c081b3e82aecafb.tar.gz kdepimpi-bb33b559609356149ae51cb50c081b3e82aecafb.tar.bz2 |
pixmap update fix
-rw-r--r-- | kmicromail/opiemail.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/kmicromail/opiemail.cpp b/kmicromail/opiemail.cpp index 760e3b0..68f0eb3 100644 --- a/kmicromail/opiemail.cpp +++ b/kmicromail/opiemail.cpp | |||
@@ -354,129 +354,131 @@ void OpieMail::slotDownloadMail( ) | |||
354 | 354 | ||
355 | 355 | ||
356 | void OpieMail::deleteAndDisplayNextMail(ViewMail * vm) | 356 | void OpieMail::deleteAndDisplayNextMail(ViewMail * vm) |
357 | { | 357 | { |
358 | QListViewItem*item = mailView->currentItem(); | 358 | QListViewItem*item = mailView->currentItem(); |
359 | if (!item ) { | 359 | if (!item ) { |
360 | closeViewMail(vm); | 360 | closeViewMail(vm); |
361 | return; | 361 | return; |
362 | } | 362 | } |
363 | RecMailP mail = ((MailListViewItem*)item)->data(); | 363 | RecMailP mail = ((MailListViewItem*)item)->data(); |
364 | mail->Wrapper()->deleteMail( mail ); | 364 | mail->Wrapper()->deleteMail( mail ); |
365 | item = item->itemBelow(); | 365 | item = item->itemBelow(); |
366 | if (!item ) { | 366 | if (!item ) { |
367 | closeViewMail(vm); | 367 | closeViewMail(vm); |
368 | return; | 368 | return; |
369 | } | 369 | } |
370 | mailView->setCurrentItem(item); | 370 | mailView->setCurrentItem(item); |
371 | mail = ((MailListViewItem*)item)->data(); | 371 | mail = ((MailListViewItem*)item)->data(); |
372 | RecBodyP body = folderView->fetchBody(mail); | 372 | RecBodyP body = folderView->fetchBody(mail); |
373 | vm->setBody( body ); | 373 | vm->setBody( body ); |
374 | vm->setMail( mail ); | 374 | vm->setMail( mail ); |
375 | } | 375 | } |
376 | void OpieMail::displayNextMail(ViewMail * vm) | 376 | void OpieMail::displayNextMail(ViewMail * vm) |
377 | { | 377 | { |
378 | QListViewItem*item = mailView->currentItem(); | 378 | QListViewItem*item = mailView->currentItem(); |
379 | if (!item) return; | 379 | if (!item) return; |
380 | ( (MailListViewItem*)item )->setPixmap( 0, QPixmap() ); | 380 | ( (MailListViewItem*)item )->setPixmap( 0, QPixmap() ); |
381 | item = item->itemBelow(); | 381 | item = item->itemBelow(); |
382 | if (!item) { | 382 | if (!item) { |
383 | vm->setCaption(i18n("End of List" )); | 383 | vm->setCaption(i18n("End of List" )); |
384 | return; | 384 | return; |
385 | } | 385 | } |
386 | mailView->setCurrentItem(item); | 386 | mailView->setCurrentItem(item); |
387 | RecMailP mail = ((MailListViewItem*)item)->data(); | 387 | RecMailP mail = ((MailListViewItem*)item)->data(); |
388 | RecBodyP body = folderView->fetchBody(mail); | 388 | RecBodyP body = folderView->fetchBody(mail); |
389 | vm->setBody( body ); | 389 | vm->setBody( body ); |
390 | vm->setMail( mail ); | 390 | vm->setMail( mail ); |
391 | } | 391 | } |
392 | void OpieMail::displayMail() | 392 | void OpieMail::displayMail() |
393 | { | 393 | { |
394 | QListViewItem*item = mailView->currentItem(); | 394 | QListViewItem*item = mailView->currentItem(); |
395 | if (!item) return; | 395 | if (!item) return; |
396 | RecMailP mail = ((MailListViewItem*)item)->data(); | 396 | RecMailP mail = ((MailListViewItem*)item)->data(); |
397 | RecBodyP body = folderView->fetchBody(mail); | 397 | RecBodyP body = folderView->fetchBody(mail); |
398 | ViewMail readMail( this,"", Qt::WType_Modal ); | 398 | ViewMail readMail( this,"", Qt::WType_Modal ); |
399 | readMail.setBody( body ); | 399 | readMail.setBody( body ); |
400 | readMail.setMail( mail ); | 400 | readMail.setMail( mail ); |
401 | #ifndef DESKTOP_VERSION | 401 | #ifndef DESKTOP_VERSION |
402 | readMail.showMaximized(); | 402 | readMail.showMaximized(); |
403 | #else | 403 | #else |
404 | readMail.resize( 640, 480); | 404 | readMail.resize( 640, 480); |
405 | #endif | 405 | #endif |
406 | connect( &readMail,SIGNAL( showNextMail(ViewMail *) ), this, SLOT( displayNextMail(ViewMail *) ) ); | 406 | connect( &readMail,SIGNAL( showNextMail(ViewMail *) ), this, SLOT( displayNextMail(ViewMail *) ) ); |
407 | connect( &readMail,SIGNAL( deleteAndDisplayNextMail(ViewMail *) ), this, SLOT(deleteAndDisplayNextMail(ViewMail *) ) ); | 407 | connect( &readMail,SIGNAL( deleteAndDisplayNextMail(ViewMail *) ), this, SLOT(deleteAndDisplayNextMail(ViewMail *) ) ); |
408 | connect( &readMail,SIGNAL( signalDownloadMail() ), this, SLOT( slotDownloadMail() ) ); | 408 | connect( &readMail,SIGNAL( signalDownloadMail() ), this, SLOT( slotDownloadMail() ) ); |
409 | 409 | ||
410 | readMail.exec(); | 410 | readMail.exec(); |
411 | 411 | ||
412 | if ( readMail.deleted ) | 412 | if ( readMail.deleted ) |
413 | { | 413 | { |
414 | folderView->refreshCurrent(); | 414 | folderView->refreshCurrent(); |
415 | } | 415 | } |
416 | else | 416 | else |
417 | { | 417 | { |
418 | ( (MailListViewItem*)item )->setPixmap( 0, QPixmap() ); | 418 | QListViewItem*item = mailView->currentItem(); |
419 | if (item) | ||
420 | ( (MailListViewItem*)item )->setPixmap( 0, QPixmap() ); | ||
419 | } | 421 | } |
420 | } | 422 | } |
421 | void OpieMail::slotGetAllMail() | 423 | void OpieMail::slotGetAllMail() |
422 | { | 424 | { |
423 | QListViewItem * item = folderView->firstChild(); | 425 | QListViewItem * item = folderView->firstChild(); |
424 | while ( item ){ | 426 | while ( item ){ |
425 | ((AccountViewItem *)item)->contextMenuSelected( 101 ); | 427 | ((AccountViewItem *)item)->contextMenuSelected( 101 ); |
426 | item = item->nextSibling (); | 428 | item = item->nextSibling (); |
427 | } | 429 | } |
428 | } | 430 | } |
429 | void OpieMail::slotGetMail() | 431 | void OpieMail::slotGetMail() |
430 | { | 432 | { |
431 | QListViewItem * item = folderView->currentItem(); | 433 | QListViewItem * item = folderView->currentItem(); |
432 | if ( ! item ) return; | 434 | if ( ! item ) return; |
433 | ((AccountViewItem *)item)->contextMenuSelected( 101 ); | 435 | ((AccountViewItem *)item)->contextMenuSelected( 101 ); |
434 | } | 436 | } |
435 | void OpieMail::slotDeleteMail() | 437 | void OpieMail::slotDeleteMail() |
436 | { | 438 | { |
437 | if (!mailView->currentItem()) return; | 439 | if (!mailView->currentItem()) return; |
438 | RecMailP mail = ((MailListViewItem*)mailView->currentItem() )->data(); | 440 | RecMailP mail = ((MailListViewItem*)mailView->currentItem() )->data(); |
439 | if ( QMessageBox::warning(this, i18n("Delete Mail"), QString( i18n("<p>Do you really want to delete this mail? <br><br>" ) + mail->getFrom() + " - " + mail->getSubject() ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) | 441 | if ( QMessageBox::warning(this, i18n("Delete Mail"), QString( i18n("<p>Do you really want to delete this mail? <br><br>" ) + mail->getFrom() + " - " + mail->getSubject() ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) |
440 | { | 442 | { |
441 | mail->Wrapper()->deleteMail( mail ); | 443 | mail->Wrapper()->deleteMail( mail ); |
442 | folderView->refreshCurrent(); | 444 | folderView->refreshCurrent(); |
443 | } | 445 | } |
444 | } | 446 | } |
445 | void OpieMail::slotDeleteAllMail() | 447 | void OpieMail::slotDeleteAllMail() |
446 | { | 448 | { |
447 | 449 | ||
448 | QValueList<RecMailP> t; | 450 | QValueList<RecMailP> t; |
449 | if ( QMessageBox::warning(this, i18n("Delete All Mails"), i18n("Do you really want to delete\nall selected mails?" ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) | 451 | if ( QMessageBox::warning(this, i18n("Delete All Mails"), i18n("Do you really want to delete\nall selected mails?" ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) |
450 | { | 452 | { |
451 | MailListViewItem* item = (MailListViewItem*)mailView->firstChild (); | 453 | MailListViewItem* item = (MailListViewItem*)mailView->firstChild (); |
452 | while ( item ) { | 454 | while ( item ) { |
453 | if ( item->isSelected() ) { | 455 | if ( item->isSelected() ) { |
454 | t.append( item->data() ); | 456 | t.append( item->data() ); |
455 | } | 457 | } |
456 | item = (MailListViewItem*)item->nextSibling(); | 458 | item = (MailListViewItem*)item->nextSibling(); |
457 | } | 459 | } |
458 | } | 460 | } |
459 | else | 461 | else |
460 | return; | 462 | return; |
461 | if ( t.count() == 0 ) | 463 | if ( t.count() == 0 ) |
462 | return; | 464 | return; |
463 | RecMailP mail = t.first(); | 465 | RecMailP mail = t.first(); |
464 | mail->Wrapper()->deleteMailList(t); | 466 | mail->Wrapper()->deleteMailList(t); |
465 | folderView->refreshCurrent(); | 467 | folderView->refreshCurrent(); |
466 | 468 | ||
467 | 469 | ||
468 | } | 470 | } |
469 | void OpieMail::clearSelection() | 471 | void OpieMail::clearSelection() |
470 | { | 472 | { |
471 | mailView->clearSelection(); | 473 | mailView->clearSelection(); |
472 | 474 | ||
473 | } | 475 | } |
474 | 476 | ||
475 | void OpieMail::mailHold(int button, QListViewItem *item,const QPoint&,int ) | 477 | void OpieMail::mailHold(int button, QListViewItem *item,const QPoint&,int ) |
476 | { | 478 | { |
477 | if (!mailView->currentItem()) return; | 479 | if (!mailView->currentItem()) return; |
478 | MAILLIB::ATYPE mailtype = ((MailListViewItem*)mailView->currentItem() )->wrapperType(); | 480 | MAILLIB::ATYPE mailtype = ((MailListViewItem*)mailView->currentItem() )->wrapperType(); |
479 | /* just the RIGHT button - or hold on pda */ | 481 | /* just the RIGHT button - or hold on pda */ |
480 | if (button!=2) {return;} | 482 | if (button!=2) {return;} |
481 | if (!item) return; | 483 | if (!item) return; |
482 | QPopupMenu *m = new QPopupMenu(0); | 484 | QPopupMenu *m = new QPopupMenu(0); |