summaryrefslogtreecommitdiffabout
path: root/kmicromail/opiemail.cpp
Unidiff
Diffstat (limited to 'kmicromail/opiemail.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kmicromail/opiemail.cpp47
1 files changed, 30 insertions, 17 deletions
diff --git a/kmicromail/opiemail.cpp b/kmicromail/opiemail.cpp
index 3fbdcec..251f15a 100644
--- a/kmicromail/opiemail.cpp
+++ b/kmicromail/opiemail.cpp
@@ -20,3 +20,3 @@
20//#include <qpe/resource.h> 20//#include <qpe/resource.h>
21#include <qpe/qpeapplication.h> 21//#include <qpe/qpeapplication.h>
22 22
@@ -239,16 +239,23 @@ void OpieMail::slotDeleteAllMail()
239{ 239{
240 if (!mailView->currentItem()) return; 240
241 RecMailP mail = ((MailListViewItem*)mailView->currentItem() )->data(); 241 QValueList<RecMailP> t;
242 if ( QMessageBox::warning(this, tr("Delete All Mails"), tr("Do you really want to delete\nall selected mails?" ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) 242 if ( QMessageBox::warning(this, tr("Delete All Mails"), tr("Do you really want to delete\nall selected mails?" ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes )
243 { 243 {
244 MailListViewItem* item = (MailListViewItem*)mailView->firstChild (); 244 MailListViewItem* item = (MailListViewItem*)mailView->firstChild ();
245 while ( item ) { 245 while ( item ) {
246 if ( item->isSelected() ) { 246 if ( item->isSelected() ) {
247 RecMailP mail = item->data(); 247 t.append( item->data() );
248 mail->Wrapper()->deleteMail( mail ); 248 }
249 item = (MailListViewItem*)item->nextSibling();
249 } 250 }
250 item = (MailListViewItem*)item->nextSibling();
251 } 251 }
252 folderView->refreshCurrent(); 252 else
253 } 253 return;
254 if ( t.count() == 0 )
255 return;
256 RecMailP mail = t.first();
257 mail->Wrapper()->deleteMailList(t);
258 folderView->refreshCurrent();
259
260
254} 261}
@@ -278,6 +285,6 @@ void OpieMail::mailHold(int button, QListViewItem *item,const QPoint&,int )
278 m->insertItem(tr("Read this mail"),this,SLOT(displayMail())); 285 m->insertItem(tr("Read this mail"),this,SLOT(displayMail()));
279 m->insertItem(tr("Copy/Move this mail"),this,SLOT(slotMoveCopyMail())); 286 m->insertItem(tr("Move/Copy this mail"),this,SLOT(slotMoveCopyMail()));
280 m->insertItem(tr("Delete this mail"),this,SLOT(slotDeleteMail())); 287 m->insertItem(tr("Delete this mail"),this,SLOT(slotDeleteMail()));
281 m->insertSeparator(); 288 m->insertSeparator();
282 m->insertItem(tr("Copy/Move all selected mail"),this,SLOT(slotMoveCopyAllMail())); 289 m->insertItem(tr("Move/Copy all selected mail"),this,SLOT(slotMoveCopyAllMail()));
283 m->insertItem(tr("Delete all selected mails"),this,SLOT(slotDeleteAllMail())); 290 m->insertItem(tr("Delete all selected mails"),this,SLOT(slotDeleteAllMail()));
@@ -352,2 +359,5 @@ void OpieMail::slotMoveCopyMail()
352 } 359 }
360 sels.hide();
361 qApp->processEvents();
362 // qDebug("hiding sels ");
353 mail->Wrapper()->mvcpMail(mail,targetFolder,targetMail,sels.moveMails()); 363 mail->Wrapper()->mvcpMail(mail,targetFolder,targetMail,sels.moveMails());
@@ -361,3 +371,3 @@ void OpieMail::slotMoveCopyAllMail()
361 QValueList<RecMailP> t; 371 QValueList<RecMailP> t;
362 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 ) 372 // 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 )
363 { 373 {
@@ -371,4 +381,4 @@ void OpieMail::slotMoveCopyAllMail()
371 } 381 }
372 else 382 // else
373 return; 383 // return;
374 if ( t.count() == 0 ) 384 if ( t.count() == 0 )
@@ -394,2 +404,5 @@ void OpieMail::slotMoveCopyAllMail()
394 } 404 }
405 sels.hide();
406 qApp->processEvents();
407 //qDebug("hiding sels ");
395 mail->Wrapper()->mvcpMailList(t,targetFolder,targetMail,sels.moveMails()); 408 mail->Wrapper()->mvcpMailList(t,targetFolder,targetMail,sels.moveMails());