Diffstat (limited to 'kmicromail/libmailwrapper/imapwrapper.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kmicromail/libmailwrapper/imapwrapper.cpp | 46 |
1 files changed, 38 insertions, 8 deletions
diff --git a/kmicromail/libmailwrapper/imapwrapper.cpp b/kmicromail/libmailwrapper/imapwrapper.cpp index bb8bbfc..11d3343 100644 --- a/kmicromail/libmailwrapper/imapwrapper.cpp +++ b/kmicromail/libmailwrapper/imapwrapper.cpp @@ -8,2 +8,3 @@ #include "logindialog.h" +#include <qprogressbar.h> @@ -873,2 +874,3 @@ void IMAPwrapper::deleteMailList(const QValueList<RecMailP>&target) { + //#if 0 mailimap_flag_list*flist; @@ -878,2 +880,3 @@ void IMAPwrapper::deleteMailList(const QValueList<RecMailP>&target) login(); + //#endif if (!m_imap) { @@ -883,7 +886,27 @@ void IMAPwrapper::deleteMailList(const QValueList<RecMailP>&target) int count = target.count(); - qDebug("imap remove count %d ", count); + // qDebug("imap remove count %d ", 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 ) { - qDebug("IMAP remove %d ", iii); + if ( ! bar.isVisible() ) + return ; + if ( incCounter % modulo == 0 ) + bar.setProgress( incCounter ); + ++incCounter; + qApp->processEvents(); RecMailP mail = (*target.at( iii )); - + //#if 0 + //qDebug("IMAP remove %d %d ", iii, mail->getNumber() ); err = selectMbox(mail->getMbox()); @@ -907,8 +930,15 @@ void IMAPwrapper::deleteMailList(const QValueList<RecMailP>&target) + // err = mailimap_expunge(m_imap); + //if (err != MAILIMAP_NO_ERROR) { + // Global::statusMessage(tr("Error deleting mails: %s").arg(m_imap->imap_response)); + // } + //#endif + //deleteMail( mail); + ++iii; + } + //qDebug("Deleting imap mails... "); err = mailimap_expunge(m_imap); if (err != MAILIMAP_NO_ERROR) { - Global::statusMessage(tr("error deleting mail: %s").arg(m_imap->imap_response)); + Global::statusMessage(tr("Error deleting mails: %s").arg(m_imap->imap_response)); } - ++iii; - } } @@ -947,3 +977,3 @@ void IMAPwrapper::deleteMail(const RecMailP&mail) } - qDebug("IMAPwrapper::deleteMail "); + //qDebug("IMAPwrapper::deleteMail 2"); @@ -1191,3 +1221,3 @@ void IMAPwrapper::mvcpAllMails(const FolderP&fromFolder, if ( err != MAILIMAP_NO_ERROR ) { - QString error_msg = tr("error copy mails: %1").arg(m_imap->imap_response); + QString error_msg = tr("Error copy mails: %1").arg(m_imap->imap_response); Global::statusMessage(error_msg); |