summaryrefslogtreecommitdiffabout
path: root/kmicromail/libmailwrapper/abstractmail.cpp
Side-by-side diff
Diffstat (limited to 'kmicromail/libmailwrapper/abstractmail.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kmicromail/libmailwrapper/abstractmail.cpp58
1 files changed, 54 insertions, 4 deletions
diff --git a/kmicromail/libmailwrapper/abstractmail.cpp b/kmicromail/libmailwrapper/abstractmail.cpp
index 3998abd..3b0ca1f 100644
--- a/kmicromail/libmailwrapper/abstractmail.cpp
+++ b/kmicromail/libmailwrapper/abstractmail.cpp
@@ -9,2 +9,4 @@
+#include <qprogressbar.h>
+#include <qapplication.h>
@@ -142,4 +144,29 @@ void AbstractMail::deleteMailList(const QValueList<RecMailP>&target)
{
- qDebug("AbstractMail::deleteMailList:: Please reimplement! ");
-
+ //qDebug("AbstractMail::deleteMailList:: Please reimplement! ");
+ // 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;
+ qApp->processEvents();
+ RecMailP mail = (*target.at( iii ));
+ deleteMail(mail);
+ ++iii;
+ }
}
@@ -156,3 +183,2 @@ void AbstractMail::mvcpMailList(const QValueList<RecMailP>& t,
{
-
encodedString*st = 0;
@@ -160,3 +186,26 @@ 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();
+ qApp->processEvents();
+ //qDebug("copy ");
RecMailP r = (*t.at( iii ));
@@ -168,3 +217,4 @@ void AbstractMail::mvcpMailList(const QValueList<RecMailP>& t,
++iii;
- }
+ }
+ bar.hide();
if (moveit) {