summaryrefslogtreecommitdiffabout
path: root/kmicromail/libmailwrapper/pop3wrapper.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/libmailwrapper/pop3wrapper.cpp
parentb9257cb225cd29bab5d96fcdaf557926603ee587 (diff)
downloadkdepimpi-6cefbdc9c8f3f3001373f10715361e2740c45395.zip
kdepimpi-6cefbdc9c8f3f3001373f10715361e2740c45395.tar.gz
kdepimpi-6cefbdc9c8f3f3001373f10715361e2740c45395.tar.bz2
Mail fixes and libetpan updated
Diffstat (limited to 'kmicromail/libmailwrapper/pop3wrapper.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kmicromail/libmailwrapper/pop3wrapper.cpp47
1 files changed, 43 insertions, 4 deletions
diff --git a/kmicromail/libmailwrapper/pop3wrapper.cpp b/kmicromail/libmailwrapper/pop3wrapper.cpp
index 7a84b30..0e6612c 100644
--- a/kmicromail/libmailwrapper/pop3wrapper.cpp
+++ b/kmicromail/libmailwrapper/pop3wrapper.cpp
@@ -8,6 +8,8 @@
#include <qpe/global.h>
#include <qfile.h>
+#include <qprogressbar.h>
+#include <qapplication.h>
/* we don't fetch messages larger than 5 MB */
#define HARD_MSG_SIZE_LIMIT 5242880
@@ -193,18 +195,37 @@ QValueList<Opie::Core::OSmartPointer<Folder> >* POP3wrapper::listFolders() {
return folders;
}
-void POP3wrapper::deleteMailList(QValueList<RecMailP>&target)
+void POP3wrapper::deleteMailList(const QValueList<RecMailP>&target)
{
login();
if (!m_pop3)
return;
int iii = 0;
- int count = target.count();
- while (iii < count ) {
+ 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();
+ //qDebug("delete ");
RecMailP mail = (*target.at( iii ));
int err = mailsession_remove_message(m_pop3->sto_session,mail->getNumber());
if (err != MAIL_NO_ERROR) {
- Global::statusMessage(tr("error deleting mail"));
+ Global::statusMessage(tr("Error deleting mail"));
}
++iii;
}
@@ -233,7 +254,25 @@ int POP3wrapper::deleteAllMail(const FolderP&) {
Global::statusMessage(tr("Error getting folder info"));
return 0;
}
+ QProgressBar bar( result,0 );
+ bar.setCaption (("Deleting 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 = (result/10)+1;
+ int incCounter = 0;
for (unsigned int i = 0; i < result; ++i) {
+ if ( ! bar.isVisible() )
+ return 0;
+ if ( incCounter % modulo == 0 )
+ bar.setProgress( incCounter );
+ ++incCounter;
+ qApp->processEvents();
err = mailsession_remove_message(m_pop3->sto_session,i+1);
if (err != MAIL_NO_ERROR) {
Global::statusMessage(tr("Error deleting mail %1").arg(i+1));