-rw-r--r-- | kmicromail/opiemail.cpp | 35 |
1 files changed, 24 insertions, 11 deletions
diff --git a/kmicromail/opiemail.cpp b/kmicromail/opiemail.cpp index 3fbdcec..251f15a 100644 --- a/kmicromail/opiemail.cpp +++ b/kmicromail/opiemail.cpp @@ -19,5 +19,5 @@ /* OPIE */ //#include <qpe/resource.h> -#include <qpe/qpeapplication.h> +//#include <qpe/qpeapplication.h> /* QT */ @@ -238,6 +238,6 @@ void OpieMail::slotDeleteMail() void OpieMail::slotDeleteAllMail() { - if (!mailView->currentItem()) return; - RecMailP mail = ((MailListViewItem*)mailView->currentItem() )->data(); + + QValueList<RecMailP> t; if ( QMessageBox::warning(this, tr("Delete All Mails"), tr("Do you really want to delete\nall selected mails?" ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) { @@ -245,11 +245,18 @@ void OpieMail::slotDeleteAllMail() while ( item ) { if ( item->isSelected() ) { - RecMailP mail = item->data(); - mail->Wrapper()->deleteMail( mail ); + t.append( item->data() ); } item = (MailListViewItem*)item->nextSibling(); } - folderView->refreshCurrent(); } + else + return; + if ( t.count() == 0 ) + return; + RecMailP mail = t.first(); + mail->Wrapper()->deleteMailList(t); + folderView->refreshCurrent(); + + } void OpieMail::clearSelection() @@ -277,8 +284,8 @@ void OpieMail::mailHold(int button, QListViewItem *item,const QPoint&,int ) } m->insertItem(tr("Read this mail"),this,SLOT(displayMail())); - m->insertItem(tr("Copy/Move this mail"),this,SLOT(slotMoveCopyMail())); + m->insertItem(tr("Move/Copy this mail"),this,SLOT(slotMoveCopyMail())); m->insertItem(tr("Delete this mail"),this,SLOT(slotDeleteMail())); m->insertSeparator(); - m->insertItem(tr("Copy/Move all selected mail"),this,SLOT(slotMoveCopyAllMail())); + m->insertItem(tr("Move/Copy all selected mail"),this,SLOT(slotMoveCopyAllMail())); m->insertItem(tr("Delete all selected mails"),this,SLOT(slotDeleteAllMail())); m->insertItem(tr("Clear selection"),this,SLOT(clearSelection())); @@ -351,4 +358,7 @@ void OpieMail::slotMoveCopyMail() return; } + sels.hide(); + qApp->processEvents(); + // qDebug("hiding sels "); mail->Wrapper()->mvcpMail(mail,targetFolder,targetMail,sels.moveMails()); folderView->refreshCurrent(); @@ -360,5 +370,5 @@ void OpieMail::slotMoveCopyAllMail() if (!mailView->currentItem()) return; QValueList<RecMailP> t; - if ( QMessageBox::warning(this, tr("Copy/Move all selected mails"), tr("Do you really want to copy/move\nall selected mails?" ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) + // if ( QMessageBox::warning(this, tr("Move/Copy all selected mails"), tr("Do you really want to copy/move\nall selected mails?" ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) { MailListViewItem* item = (MailListViewItem*)mailView->firstChild (); @@ -370,6 +380,6 @@ void OpieMail::slotMoveCopyAllMail() } } - else - return; + // else + // return; if ( t.count() == 0 ) return; @@ -393,4 +403,7 @@ void OpieMail::slotMoveCopyAllMail() return; } + sels.hide(); + qApp->processEvents(); + //qDebug("hiding sels "); mail->Wrapper()->mvcpMailList(t,targetFolder,targetMail,sels.moveMails()); folderView->refreshCurrent(); |