summaryrefslogtreecommitdiffabout
path: root/kmicromail/libmailwrapper/abstractmail.cpp
authorzautrix <zautrix>2004-09-10 19:57:55 (UTC)
committer zautrix <zautrix>2004-09-10 19:57:55 (UTC)
commitcebdd6de7481514ad5ea0517f7a2e8f4db422be5 (patch) (side-by-side diff)
tree0b29859b5bbfdcb702724c3b0c721f22b0d0e666 /kmicromail/libmailwrapper/abstractmail.cpp
parent157120031b77a3d9f10d780a66b6441dac1399fa (diff)
downloadkdepimpi-cebdd6de7481514ad5ea0517f7a2e8f4db422be5.zip
kdepimpi-cebdd6de7481514ad5ea0517f7a2e8f4db422be5.tar.gz
kdepimpi-cebdd6de7481514ad5ea0517f7a2e8f4db422be5.tar.bz2
Added status info when deleting mails
Diffstat (limited to 'kmicromail/libmailwrapper/abstractmail.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kmicromail/libmailwrapper/abstractmail.cpp53
1 files changed, 13 insertions, 40 deletions
diff --git a/kmicromail/libmailwrapper/abstractmail.cpp b/kmicromail/libmailwrapper/abstractmail.cpp
index cef4e97..f876235 100644
--- a/kmicromail/libmailwrapper/abstractmail.cpp
+++ b/kmicromail/libmailwrapper/abstractmail.cpp
@@ -5,6 +5,7 @@
#include "nntpwrapper.h"
#include "mhwrapper.h"
#include "mailtypes.h"
+#include <qpe/global.h>
#include <qprogressbar.h>
@@ -146,24 +147,11 @@ void AbstractMail::deleteMailList(const QValueList<RecMailP>&target)
// this is currently re-implemented in pop3wrapper and imapwrapper
int iii = 0;
int count = target.count();
- QProgressBar bar( count,0 );
- bar.setCaption (("Removing mails - close to abort!") );
- int w = 300;
- if ( QApplication::desktop()->width() < 320 )
- w = 220;
- int h = bar.sizeHint().height() ;
- int dw = QApplication::desktop()->width();
- int dh = QApplication::desktop()->height();
- bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
- bar.show();
- int modulo = (count/10)+1;
- int incCounter = 0;
- while (iii < count ) {
- if ( ! bar.isVisible() )
- return ;
- if ( incCounter % modulo == 0 )
- bar.setProgress( incCounter );
- ++incCounter;
+ QWidget wid;
+ wid.show();
+ while (iii < count ) {
+ Global::statusMessage(tr("Delete message %1 of %2").arg(iii).arg(count));
+ wid.raise();
qApp->processEvents();
RecMailP mail = (*target.at( iii ));
deleteMail(mail);
@@ -186,28 +174,14 @@ void AbstractMail::mvcpMailList(const QValueList<RecMailP>& t,
int count = t.count();
if ( count == 0 )
return;
-
- QProgressBar bar( count,0 );
- bar.setCaption (("Copying mails - close to abort!") );
- int w = 300;
- if ( QApplication::desktop()->width() < 320 )
- w = 220;
- int h = bar.sizeHint().height() ;
- int dw = QApplication::desktop()->width();
- int dh = QApplication::desktop()->height();
- bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
- bar.show();
- int modulo = (count/10)+1;
- int incCounter = 0;
- while (iii < count ) {
- if ( ! bar.isVisible() )
- return ;
- if ( incCounter % modulo == 0 )
- bar.setProgress( incCounter );
- ++incCounter;
- bar.raise();
+ // wel, processevents is qite strange, we need a widget for getting
+ // Global::statusMessage(tr("Copy2 message %1").arg(iii)); displayed
+ QWidget wid;
+ wid.show();
+ while (iii < count ) {
+ Global::statusMessage(tr("Copy message %1 of %2").arg(iii).arg(count));
+ wid.raise();
qApp->processEvents();
- //qDebug("copy ");
RecMailP r = (*t.at( iii ));
st = fetchRawBody(r);
if (st) {
@@ -216,7 +190,6 @@ void AbstractMail::mvcpMailList(const QValueList<RecMailP>& t,
}
++iii;
}
- bar.hide();
if (moveit) {
deleteMailList( t );
//deleteAllMail(fromFolder);