summaryrefslogtreecommitdiffabout
path: root/kmicromail/libmailwrapper
Side-by-side diff
Diffstat (limited to 'kmicromail/libmailwrapper') (more/less context) (show whitespace changes)
-rw-r--r--kmicromail/libmailwrapper/abstractmail.cpp11
-rw-r--r--kmicromail/libmailwrapper/imapwrapper.cpp5
-rw-r--r--kmicromail/libmailwrapper/pop3wrapper.cpp12
3 files changed, 22 insertions, 6 deletions
diff --git a/kmicromail/libmailwrapper/abstractmail.cpp b/kmicromail/libmailwrapper/abstractmail.cpp
index 44878e0..8f67566 100644
--- a/kmicromail/libmailwrapper/abstractmail.cpp
+++ b/kmicromail/libmailwrapper/abstractmail.cpp
@@ -139,28 +139,30 @@ QString AbstractMail::draftFolder()
}
/* temporary - will be removed when implemented in all classes */
void AbstractMail::deleteMails(const QString &,const QValueList<Opie::Core::OSmartPointer<RecMail> > &)
{
}
void AbstractMail::deleteMailList(const QValueList<RecMailP>&target)
{
//qDebug("AbstractMail::deleteMailList:: Please reimplement! ");
// this is currently re-implemented in pop3wrapper and imapwrapper
int iii = 0;
int count = target.count();
- QWidget wid;
+ QProgressBar wid ( count );
+ wid.setCaption( tr("Deleting ..."));
wid.show();
while (iii < count ) {
Global::statusMessage(tr("Delete message %1 of %2").arg(iii).arg(count));
+ wid.setProgress( iii );
wid.raise();
qApp->processEvents();
RecMailP mail = (*target.at( iii ));
deleteMail(mail);
++iii;
}
}
void AbstractMail::downloadNewMails(const FolderP&fromFolder, AbstractMail*targetMail )
{
//qDebug("AbstractMail::downloadNewMails %s ", fromFolder->getName().latin1());
// get local folder
@@ -228,29 +230,32 @@ void AbstractMail::mvcpAllMails(const FolderP&fromFolder,
mvcpMailList( t,targetFolder,targetWrapper,moveit);
}
void AbstractMail::mvcpMailList(const QValueList<RecMailP>& t,
const QString&targetFolder,AbstractMail*targetWrapper,bool moveit)
{
encodedString*st = 0;
int iii = 0;
int count = t.count();
if ( count == 0 )
return;
// wel, processevents is qite strange, we need a widget for getting
- // Global::statusMessage(tr("Copy2 message %1").arg(iii)); displayed
- QWidget wid;
+ // Global::statusMessage(tr("Copy2 message %1").arg(iii)); displaye
+
+ QProgressBar wid ( count );
+ wid.setCaption( tr("Copying ..."));
wid.show();
while (iii < count ) {
Global::statusMessage(tr("Copy message %1 of %2").arg(iii).arg(count));
+ wid.setProgress( iii );
wid.raise();
qApp->processEvents();
RecMailP r = (*t.at( iii ));
st = fetchRawBody(r);
if (st) {
targetWrapper->storeMessage(st->Content(),st->Length(),targetFolder);
delete st;
}
++iii;
}
if (moveit) {
deleteMailList( t );
diff --git a/kmicromail/libmailwrapper/imapwrapper.cpp b/kmicromail/libmailwrapper/imapwrapper.cpp
index 91332c3..d79df4f 100644
--- a/kmicromail/libmailwrapper/imapwrapper.cpp
+++ b/kmicromail/libmailwrapper/imapwrapper.cpp
@@ -935,28 +935,31 @@ void IMAPwrapper::deleteMailList(const QValueList<RecMailP>&target)
login();
//#endif
if (!m_imap) {
return;
}
int iii = 0;
int count = target.count();
// qDebug("imap remove count %d ", count);
mMax = count;
//progress( tr("Delete"));
- QWidget wid;
+
+ QProgressBar wid ( count );
+ wid.setCaption( tr("Deleting ..."));
wid.show();
while (iii < count ) {
Global::statusMessage(tr("Delete message %1 of %2").arg(iii).arg(count));
+ wid.setProgress( iii );
wid.raise();
qApp->processEvents();
RecMailP mail = (*target.at( iii ));
//#if 0
//qDebug("IMAP remove %d %d ", iii, mail->getNumber() );
err = selectMbox(mail->getMbox());
if ( err != MAILIMAP_NO_ERROR ) {
return;
}
flist = mailimap_flag_list_new_empty();
mailimap_flag_list_add(flist,mailimap_flag_new_deleted());
store_flags = mailimap_store_att_flags_new_set_flags(flist);
diff --git a/kmicromail/libmailwrapper/pop3wrapper.cpp b/kmicromail/libmailwrapper/pop3wrapper.cpp
index 1edec9e..9d52f52 100644
--- a/kmicromail/libmailwrapper/pop3wrapper.cpp
+++ b/kmicromail/libmailwrapper/pop3wrapper.cpp
@@ -191,28 +191,31 @@ QValueList<Opie::Core::OSmartPointer<Folder> >* POP3wrapper::listFolders() {
FolderP inb=new Folder("INBOX","/");
folders->append(inb);
return folders;
}
void POP3wrapper::deleteMailList(const QValueList<RecMailP>&target)
{
login();
if (!m_pop3)
return;
int iii = 0;
int count = target.count();
- QWidget wid;
+
+ QProgressBar wid ( count );
+ wid.setCaption( tr("Deleting ..."));
wid.show();
while (iii < count ) {
Global::statusMessage(tr("Delete message %1 of %2").arg(iii).arg(count));
+ wid.setProgress( iii );
wid.raise();
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"));
}
++iii;
}
}
void POP3wrapper::deleteMail(const RecMailP&mail) {
@@ -230,28 +233,33 @@ void POP3wrapper::answeredMail(const RecMailP&) {}
int POP3wrapper::deleteAllMail(const FolderP&) {
login();
if (!m_pop3)
return 0;
int res = 1;
uint32_t result = 0;
int err = mailsession_messages_number(m_pop3->sto_session,NULL,&result);
if (err != MAIL_NO_ERROR) {
Global::statusMessage(tr("Error getting folder info"));
return 0;
}
- QWidget wid;
+
+
+
+ QProgressBar wid ( result );
+ wid.setCaption( tr("Deleting ..."));
wid.show();
for (unsigned int i = 0; i < result; ++i) {
Global::statusMessage(tr("Delete message %1 of %2").arg(i).arg(result));
+ wid.setProgress( i );
wid.raise();
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));
res=0;
}
break;
}
return res;
}