From 6cefbdc9c8f3f3001373f10715361e2740c45395 Mon Sep 17 00:00:00 2001 From: zautrix Date: Wed, 01 Sep 2004 10:23:29 +0000 Subject: Mail fixes and libetpan updated --- (limited to 'kmicromail/libmailwrapper/abstractmail.cpp') 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 @@ -7,6 +7,8 @@ #include "mailtypes.h" +#include +#include #include #include @@ -140,8 +142,33 @@ void AbstractMail::deleteMails(const QString &,const QValueList&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; + } } void AbstractMail::mvcpAllMails(const FolderP&fromFolder, const QString&targetFolder,AbstractMail*targetWrapper,bool moveit, int maxSizeInKb) @@ -154,11 +181,33 @@ void AbstractMail::mvcpAllMails(const FolderP&fromFolder, void AbstractMail::mvcpMailList(const QValueList& t, const QString&targetFolder,AbstractMail*targetWrapper,bool moveit) { - encodedString*st = 0; int iii = 0; 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 )); st = fetchRawBody(r); if (st) { @@ -166,7 +215,8 @@ void AbstractMail::mvcpMailList(const QValueList& t, delete st; } ++iii; - } + } + bar.hide(); if (moveit) { deleteMailList( t ); //deleteAllMail(fromFolder); -- cgit v0.9.0.2