author | zautrix <zautrix> | 2004-09-10 19:57:55 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-09-10 19:57:55 (UTC) |
commit | cebdd6de7481514ad5ea0517f7a2e8f4db422be5 (patch) (unidiff) | |
tree | 0b29859b5bbfdcb702724c3b0c721f22b0d0e666 /kmicromail/libmailwrapper/abstractmail.cpp | |
parent | 157120031b77a3d9f10d780a66b6441dac1399fa (diff) | |
download | kdepimpi-cebdd6de7481514ad5ea0517f7a2e8f4db422be5.zip kdepimpi-cebdd6de7481514ad5ea0517f7a2e8f4db422be5.tar.gz kdepimpi-cebdd6de7481514ad5ea0517f7a2e8f4db422be5.tar.bz2 |
Added status info when deleting mails
Diffstat (limited to 'kmicromail/libmailwrapper/abstractmail.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kmicromail/libmailwrapper/abstractmail.cpp | 53 |
1 files changed, 13 insertions, 40 deletions
diff --git a/kmicromail/libmailwrapper/abstractmail.cpp b/kmicromail/libmailwrapper/abstractmail.cpp index cef4e97..f876235 100644 --- a/kmicromail/libmailwrapper/abstractmail.cpp +++ b/kmicromail/libmailwrapper/abstractmail.cpp | |||
@@ -5,6 +5,7 @@ | |||
5 | #include "nntpwrapper.h" | 5 | #include "nntpwrapper.h" |
6 | #include "mhwrapper.h" | 6 | #include "mhwrapper.h" |
7 | #include "mailtypes.h" | 7 | #include "mailtypes.h" |
8 | #include <qpe/global.h> | ||
8 | 9 | ||
9 | 10 | ||
10 | #include <qprogressbar.h> | 11 | #include <qprogressbar.h> |
@@ -146,24 +147,11 @@ void AbstractMail::deleteMailList(const QValueList<RecMailP>&target) | |||
146 | // this is currently re-implemented in pop3wrapper and imapwrapper | 147 | // this is currently re-implemented in pop3wrapper and imapwrapper |
147 | int iii = 0; | 148 | int iii = 0; |
148 | int count = target.count(); | 149 | int count = target.count(); |
149 | QProgressBar bar( count,0 ); | 150 | QWidget wid; |
150 | bar.setCaption (("Removing mails - close to abort!") ); | 151 | wid.show(); |
151 | int w = 300; | 152 | while (iii < count ) { |
152 | if ( QApplication::desktop()->width() < 320 ) | 153 | Global::statusMessage(tr("Delete message %1 of %2").arg(iii).arg(count)); |
153 | w = 220; | 154 | wid.raise(); |
154 | int h = bar.sizeHint().height() ; | ||
155 | int dw = QApplication::desktop()->width(); | ||
156 | int dh = QApplication::desktop()->height(); | ||
157 | bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); | ||
158 | bar.show(); | ||
159 | int modulo = (count/10)+1; | ||
160 | int incCounter = 0; | ||
161 | while (iii < count ) { | ||
162 | if ( ! bar.isVisible() ) | ||
163 | return ; | ||
164 | if ( incCounter % modulo == 0 ) | ||
165 | bar.setProgress( incCounter ); | ||
166 | ++incCounter; | ||
167 | qApp->processEvents(); | 155 | qApp->processEvents(); |
168 | RecMailP mail = (*target.at( iii )); | 156 | RecMailP mail = (*target.at( iii )); |
169 | deleteMail(mail); | 157 | deleteMail(mail); |
@@ -186,28 +174,14 @@ void AbstractMail::mvcpMailList(const QValueList<RecMailP>& t, | |||
186 | int count = t.count(); | 174 | int count = t.count(); |
187 | if ( count == 0 ) | 175 | if ( count == 0 ) |
188 | return; | 176 | return; |
189 | 177 | // wel, processevents is qite strange, we need a widget for getting | |
190 | QProgressBar bar( count,0 ); | 178 | // Global::statusMessage(tr("Copy2 message %1").arg(iii)); displayed |
191 | bar.setCaption (("Copying mails - close to abort!") ); | 179 | QWidget wid; |
192 | int w = 300; | 180 | wid.show(); |
193 | if ( QApplication::desktop()->width() < 320 ) | 181 | while (iii < count ) { |
194 | w = 220; | 182 | Global::statusMessage(tr("Copy message %1 of %2").arg(iii).arg(count)); |
195 | int h = bar.sizeHint().height() ; | 183 | wid.raise(); |
196 | int dw = QApplication::desktop()->width(); | ||
197 | int dh = QApplication::desktop()->height(); | ||
198 | bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); | ||
199 | bar.show(); | ||
200 | int modulo = (count/10)+1; | ||
201 | int incCounter = 0; | ||
202 | while (iii < count ) { | ||
203 | if ( ! bar.isVisible() ) | ||
204 | return ; | ||
205 | if ( incCounter % modulo == 0 ) | ||
206 | bar.setProgress( incCounter ); | ||
207 | ++incCounter; | ||
208 | bar.raise(); | ||
209 | qApp->processEvents(); | 184 | qApp->processEvents(); |
210 | //qDebug("copy "); | ||
211 | RecMailP r = (*t.at( iii )); | 185 | RecMailP r = (*t.at( iii )); |
212 | st = fetchRawBody(r); | 186 | st = fetchRawBody(r); |
213 | if (st) { | 187 | if (st) { |
@@ -216,7 +190,6 @@ void AbstractMail::mvcpMailList(const QValueList<RecMailP>& t, | |||
216 | } | 190 | } |
217 | ++iii; | 191 | ++iii; |
218 | } | 192 | } |
219 | bar.hide(); | ||
220 | if (moveit) { | 193 | if (moveit) { |
221 | deleteMailList( t ); | 194 | deleteMailList( t ); |
222 | //deleteAllMail(fromFolder); | 195 | //deleteAllMail(fromFolder); |