author | zautrix <zautrix> | 2004-09-11 18:10:31 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-09-11 18:10:31 (UTC) |
commit | 53dda80aaab72d7efdbed8a206dc1fa64fed10ee (patch) (unidiff) | |
tree | 23b5248145679628c0d346f7d42c53714634e1a3 /kmicromail/libmailwrapper | |
parent | 438403295657bdcab9ee9e526c6a08894e876f63 (diff) | |
download | kdepimpi-53dda80aaab72d7efdbed8a206dc1fa64fed10ee.zip kdepimpi-53dda80aaab72d7efdbed8a206dc1fa64fed10ee.tar.gz kdepimpi-53dda80aaab72d7efdbed8a206dc1fa64fed10ee.tar.bz2 |
progress fixes
-rw-r--r-- | kmicromail/libmailwrapper/abstractmail.cpp | 13 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/imapwrapper.cpp | 5 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/pop3wrapper.cpp | 12 |
3 files changed, 23 insertions, 7 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 | |||
@@ -145,16 +145,18 @@ void AbstractMail::deleteMails(const QString &,const QValueList<Opie::Core::OSma | |||
145 | void AbstractMail::deleteMailList(const QValueList<RecMailP>&target) | 145 | void AbstractMail::deleteMailList(const QValueList<RecMailP>&target) |
146 | { | 146 | { |
147 | //qDebug("AbstractMail::deleteMailList:: Please reimplement! "); | 147 | //qDebug("AbstractMail::deleteMailList:: Please reimplement! "); |
148 | // this is currently re-implemented in pop3wrapper and imapwrapper | 148 | // this is currently re-implemented in pop3wrapper and imapwrapper |
149 | int iii = 0; | 149 | int iii = 0; |
150 | int count = target.count(); | 150 | int count = target.count(); |
151 | QWidget wid; | 151 | QProgressBar wid ( count ); |
152 | wid.setCaption( tr("Deleting ...")); | ||
152 | wid.show(); | 153 | wid.show(); |
153 | while (iii < count ) { | 154 | while (iii < count ) { |
154 | Global::statusMessage(tr("Delete message %1 of %2").arg(iii).arg(count)); | 155 | Global::statusMessage(tr("Delete message %1 of %2").arg(iii).arg(count)); |
156 | wid.setProgress( iii ); | ||
155 | wid.raise(); | 157 | wid.raise(); |
156 | qApp->processEvents(); | 158 | qApp->processEvents(); |
157 | RecMailP mail = (*target.at( iii )); | 159 | RecMailP mail = (*target.at( iii )); |
158 | deleteMail(mail); | 160 | deleteMail(mail); |
159 | ++iii; | 161 | ++iii; |
160 | } | 162 | } |
@@ -234,17 +236,20 @@ void AbstractMail::mvcpMailList(const QValueList<RecMailP>& t, | |||
234 | encodedString*st = 0; | 236 | encodedString*st = 0; |
235 | int iii = 0; | 237 | int iii = 0; |
236 | int count = t.count(); | 238 | int count = t.count(); |
237 | if ( count == 0 ) | 239 | if ( count == 0 ) |
238 | return; | 240 | return; |
239 | // wel, processevents is qite strange, we need a widget for getting | 241 | // wel, processevents is qite strange, we need a widget for getting |
240 | // Global::statusMessage(tr("Copy2 message %1").arg(iii)); displayed | 242 | // Global::statusMessage(tr("Copy2 message %1").arg(iii)); displaye |
241 | QWidget wid; | 243 | |
244 | QProgressBar wid ( count ); | ||
245 | wid.setCaption( tr("Copying ...")); | ||
242 | wid.show(); | 246 | wid.show(); |
243 | while (iii < count ) { | 247 | while (iii < count ) { |
244 | Global::statusMessage(tr("Copy message %1 of %2").arg(iii).arg(count)); | 248 | Global::statusMessage(tr("Copy message %1 of %2").arg(iii).arg(count)); |
249 | wid.setProgress( iii ); | ||
245 | wid.raise(); | 250 | wid.raise(); |
246 | qApp->processEvents(); | 251 | qApp->processEvents(); |
247 | RecMailP r = (*t.at( iii )); | 252 | RecMailP r = (*t.at( iii )); |
248 | st = fetchRawBody(r); | 253 | st = fetchRawBody(r); |
249 | if (st) { | 254 | if (st) { |
250 | targetWrapper->storeMessage(st->Content(),st->Length(),targetFolder); | 255 | targetWrapper->storeMessage(st->Content(),st->Length(),targetFolder); |
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 | |||
@@ -941,16 +941,19 @@ void IMAPwrapper::deleteMailList(const QValueList<RecMailP>&target) | |||
941 | int count = target.count(); | 941 | int count = target.count(); |
942 | // qDebug("imap remove count %d ", count); | 942 | // qDebug("imap remove count %d ", count); |
943 | 943 | ||
944 | 944 | ||
945 | mMax = count; | 945 | mMax = count; |
946 | //progress( tr("Delete")); | 946 | //progress( tr("Delete")); |
947 | QWidget wid; | 947 | |
948 | QProgressBar wid ( count ); | ||
949 | wid.setCaption( tr("Deleting ...")); | ||
948 | wid.show(); | 950 | wid.show(); |
949 | while (iii < count ) { | 951 | while (iii < count ) { |
950 | Global::statusMessage(tr("Delete message %1 of %2").arg(iii).arg(count)); | 952 | Global::statusMessage(tr("Delete message %1 of %2").arg(iii).arg(count)); |
953 | wid.setProgress( iii ); | ||
951 | wid.raise(); | 954 | wid.raise(); |
952 | qApp->processEvents(); | 955 | qApp->processEvents(); |
953 | RecMailP mail = (*target.at( iii )); | 956 | RecMailP mail = (*target.at( iii )); |
954 | //#if 0 | 957 | //#if 0 |
955 | //qDebug("IMAP remove %d %d ", iii, mail->getNumber() ); | 958 | //qDebug("IMAP remove %d %d ", iii, mail->getNumber() ); |
956 | err = selectMbox(mail->getMbox()); | 959 | err = selectMbox(mail->getMbox()); |
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 | |||
@@ -197,16 +197,19 @@ void POP3wrapper::deleteMailList(const QValueList<RecMailP>&target) | |||
197 | { | 197 | { |
198 | login(); | 198 | login(); |
199 | if (!m_pop3) | 199 | if (!m_pop3) |
200 | return; | 200 | return; |
201 | int iii = 0; | 201 | int iii = 0; |
202 | int count = target.count(); | 202 | int count = target.count(); |
203 | QWidget wid; | 203 | |
204 | QProgressBar wid ( count ); | ||
205 | wid.setCaption( tr("Deleting ...")); | ||
204 | wid.show(); | 206 | wid.show(); |
205 | while (iii < count ) { | 207 | while (iii < count ) { |
206 | Global::statusMessage(tr("Delete message %1 of %2").arg(iii).arg(count)); | 208 | Global::statusMessage(tr("Delete message %1 of %2").arg(iii).arg(count)); |
209 | wid.setProgress( iii ); | ||
207 | wid.raise(); | 210 | wid.raise(); |
208 | qApp->processEvents(); | 211 | qApp->processEvents(); |
209 | //qDebug("delete "); | 212 | //qDebug("delete "); |
210 | RecMailP mail = (*target.at( iii )); | 213 | RecMailP mail = (*target.at( iii )); |
211 | int err = mailsession_remove_message(m_pop3->sto_session,mail->getNumber()); | 214 | int err = mailsession_remove_message(m_pop3->sto_session,mail->getNumber()); |
212 | if (err != MAIL_NO_ERROR) { | 215 | if (err != MAIL_NO_ERROR) { |
@@ -236,16 +239,21 @@ int POP3wrapper::deleteAllMail(const FolderP&) { | |||
236 | uint32_t result = 0; | 239 | uint32_t result = 0; |
237 | int err = mailsession_messages_number(m_pop3->sto_session,NULL,&result); | 240 | int err = mailsession_messages_number(m_pop3->sto_session,NULL,&result); |
238 | if (err != MAIL_NO_ERROR) { | 241 | if (err != MAIL_NO_ERROR) { |
239 | Global::statusMessage(tr("Error getting folder info")); | 242 | Global::statusMessage(tr("Error getting folder info")); |
240 | return 0; | 243 | return 0; |
241 | } | 244 | } |
242 | QWidget wid; | 245 | |
246 | |||
247 | |||
248 | QProgressBar wid ( result ); | ||
249 | wid.setCaption( tr("Deleting ...")); | ||
243 | wid.show(); | 250 | wid.show(); |
244 | for (unsigned int i = 0; i < result; ++i) { | 251 | for (unsigned int i = 0; i < result; ++i) { |
245 | Global::statusMessage(tr("Delete message %1 of %2").arg(i).arg(result)); | 252 | Global::statusMessage(tr("Delete message %1 of %2").arg(i).arg(result)); |
253 | wid.setProgress( i ); | ||
246 | wid.raise(); | 254 | wid.raise(); |
247 | qApp->processEvents(); | 255 | qApp->processEvents(); |
248 | 256 | ||
249 | err = mailsession_remove_message(m_pop3->sto_session,i+1); | 257 | err = mailsession_remove_message(m_pop3->sto_session,i+1); |
250 | if (err != MAIL_NO_ERROR) { | 258 | if (err != MAIL_NO_ERROR) { |
251 | Global::statusMessage(tr("Error deleting mail %1").arg(i+1)); | 259 | Global::statusMessage(tr("Error deleting mail %1").arg(i+1)); |