-rw-r--r-- | kmicromail/opiemail.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/kmicromail/opiemail.cpp b/kmicromail/opiemail.cpp index ec192ea..915b3e8 100644 --- a/kmicromail/opiemail.cpp +++ b/kmicromail/opiemail.cpp @@ -294,20 +294,45 @@ void OpieMail::replyMail() composer.setCharset( body->getCharset() ); if ( QDialog::Accepted == KApplication::execDialog( &composer ) ) { mail->Wrapper()->answeredMail(mail); } delete settings; } +void OpieMail::closeViewMail(ViewMail * vm) +{ + vm->hide(); +} +void OpieMail::deleteAndDisplayNextMail(ViewMail * vm) +{ + QListViewItem*item = mailView->currentItem(); + if (!item ) { + closeViewMail(vm); + return; + } + RecMailP mail = ((MailListViewItem*)item)->data(); + mail->Wrapper()->deleteMail( mail ); + item = item->itemBelow(); + if (!item ) { + closeViewMail(vm); + return; + } + mailView->setCurrentItem(item); + mail = ((MailListViewItem*)item)->data(); + RecBodyP body = folderView->fetchBody(mail); + vm->setBody( body ); + vm->setMail( mail ); +} void OpieMail::displayNextMail(ViewMail * vm) { QListViewItem*item = mailView->currentItem(); if (!item) return; + ( (MailListViewItem*)item )->setPixmap( 0, QPixmap() ); item = item->itemBelow(); if (!item) { vm->setCaption(i18n("End of List" )); return; } mailView->setCurrentItem(item); RecMailP mail = ((MailListViewItem*)item)->data(); RecBodyP body = folderView->fetchBody(mail); @@ -324,16 +349,18 @@ void OpieMail::displayMail() readMail.setBody( body ); readMail.setMail( mail ); #ifndef DESKTOP_VERSION readMail.showMaximized(); #else readMail.resize( 640, 480); #endif connect( &readMail,SIGNAL( showNextMail(ViewMail *) ), this, SLOT( displayNextMail(ViewMail *) ) ); + connect( &readMail,SIGNAL( deleteAndDisplayNextMail(ViewMail *) ), this, SLOT(deleteAndDisplayNextMail(ViewMail *) ) ); + readMail.exec(); if ( readMail.deleted ) { folderView->refreshCurrent(); } else { |