summaryrefslogtreecommitdiffabout
path: root/kmicromail/opiemail.cpp
authorzautrix <zautrix>2004-09-01 10:23:29 (UTC)
committer zautrix <zautrix>2004-09-01 10:23:29 (UTC)
commit6cefbdc9c8f3f3001373f10715361e2740c45395 (patch) (side-by-side diff)
treecb2c36f57620e698913c27ca4ebe59e4a7c9d46e /kmicromail/opiemail.cpp
parentb9257cb225cd29bab5d96fcdaf557926603ee587 (diff)
downloadkdepimpi-6cefbdc9c8f3f3001373f10715361e2740c45395.zip
kdepimpi-6cefbdc9c8f3f3001373f10715361e2740c45395.tar.gz
kdepimpi-6cefbdc9c8f3f3001373f10715361e2740c45395.tar.bz2
Mail fixes and libetpan updated
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
@@ -18,7 +18,7 @@
#include <libmailwrapper/abstractmail.h>
/* OPIE */
//#include <qpe/resource.h>
-#include <qpe/qpeapplication.h>
+//#include <qpe/qpeapplication.h>
/* QT */
@@ -237,20 +237,27 @@ 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 )
- {
- MailListViewItem* item = (MailListViewItem*)mailView->firstChild ();
- while ( item ) {
- if ( item->isSelected() ) {
- RecMailP mail = item->data();
- mail->Wrapper()->deleteMail( mail );
+ {
+ MailListViewItem* item = (MailListViewItem*)mailView->firstChild ();
+ while ( item ) {
+ if ( item->isSelected() ) {
+ t.append( item->data() );
+ }
+ item = (MailListViewItem*)item->nextSibling();
}
- 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()
{
@@ -276,10 +283,10 @@ void OpieMail::mailHold(int button, QListViewItem *item,const QPoint&,int )
m->insertItem(tr("Edit this mail"),this,SLOT(reEditMail()));
}
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()));
}
@@ -350,6 +357,9 @@ void OpieMail::slotMoveCopyMail()
tr("<center>Error while creating<br>new folder - breaking.</center>"));
return;
}
+ sels.hide();
+ qApp->processEvents();
+ // qDebug("hiding sels ");
mail->Wrapper()->mvcpMail(mail,targetFolder,targetMail,sels.moveMails());
folderView->refreshCurrent();
}
@@ -359,7 +369,7 @@ 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 ();
while ( item ) {
@@ -369,8 +379,8 @@ void OpieMail::slotMoveCopyAllMail()
item = (MailListViewItem*)item->nextSibling();
}
}
- else
- return;
+ // else
+ // return;
if ( t.count() == 0 )
return;
RecMailP mail = t.first();
@@ -392,6 +402,9 @@ void OpieMail::slotMoveCopyAllMail()
tr("<center>Error while creating<br>new folder - breaking.</center>"));
return;
}
+ sels.hide();
+ qApp->processEvents();
+ //qDebug("hiding sels ");
mail->Wrapper()->mvcpMailList(t,targetFolder,targetMail,sels.moveMails());
folderView->refreshCurrent();
}