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) (unidiff)
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) (show whitespace changes)
-rw-r--r--kmicromail/libmailwrapper/pop3wrapper.cpp43
1 files changed, 41 insertions, 2 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
@@ -10,2 +10,4 @@
10#include <qfile.h> 10#include <qfile.h>
11#include <qprogressbar.h>
12#include <qapplication.h>
11 13
@@ -195,3 +197,3 @@ QValueList<Opie::Core::OSmartPointer<Folder> >* POP3wrapper::listFolders() {
195 197
196void POP3wrapper::deleteMailList(QValueList<RecMailP>&target) 198void POP3wrapper::deleteMailList(const QValueList<RecMailP>&target)
197{ 199{
@@ -202,3 +204,22 @@ void POP3wrapper::deleteMailList(QValueList<RecMailP>&target)
202 int count = target.count(); 204 int count = target.count();
205 QProgressBar bar( count,0 );
206 bar.setCaption (("Removing mails - close to abort!") );
207 int w = 300;
208 if ( QApplication::desktop()->width() < 320 )
209 w = 220;
210 int h = bar.sizeHint().height() ;
211 int dw = QApplication::desktop()->width();
212 int dh = QApplication::desktop()->height();
213 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
214 bar.show();
215 int modulo = (count/10)+1;
216 int incCounter = 0;
203 while (iii < count ) { 217 while (iii < count ) {
218 if ( ! bar.isVisible() )
219 return ;
220 if ( incCounter % modulo == 0 )
221 bar.setProgress( incCounter );
222 ++incCounter;
223 qApp->processEvents();
224 //qDebug("delete ");
204 RecMailP mail = (*target.at( iii )); 225 RecMailP mail = (*target.at( iii ));
@@ -206,3 +227,3 @@ void POP3wrapper::deleteMailList(QValueList<RecMailP>&target)
206 if (err != MAIL_NO_ERROR) { 227 if (err != MAIL_NO_ERROR) {
207 Global::statusMessage(tr("error deleting mail")); 228 Global::statusMessage(tr("Error deleting mail"));
208 } 229 }
@@ -235,3 +256,21 @@ int POP3wrapper::deleteAllMail(const FolderP&) {
235 } 256 }
257 QProgressBar bar( result,0 );
258 bar.setCaption (("Deleting mails - close to abort!") );
259 int w = 300;
260 if ( QApplication::desktop()->width() < 320 )
261 w = 220;
262 int h = bar.sizeHint().height() ;
263 int dw = QApplication::desktop()->width();
264 int dh = QApplication::desktop()->height();
265 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
266 bar.show();
267 int modulo = (result/10)+1;
268 int incCounter = 0;
236 for (unsigned int i = 0; i < result; ++i) { 269 for (unsigned int i = 0; i < result; ++i) {
270 if ( ! bar.isVisible() )
271 return 0;
272 if ( incCounter % modulo == 0 )
273 bar.setProgress( incCounter );
274 ++incCounter;
275 qApp->processEvents();
237 err = mailsession_remove_message(m_pop3->sto_session,i+1); 276 err = mailsession_remove_message(m_pop3->sto_session,i+1);