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 | |||
@@ -6,4 +6,5 @@ | |||
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 | ||
@@ -147,22 +148,9 @@ void AbstractMail::deleteMailList(const QValueList<RecMailP>&target) | |||
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 )); |
@@ -187,26 +175,12 @@ void AbstractMail::mvcpMailList(const QValueList<RecMailP>& t, | |||
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); |
@@ -217,5 +191,4 @@ void AbstractMail::mvcpMailList(const QValueList<RecMailP>& t, | |||
217 | ++iii; | 191 | ++iii; |
218 | } | 192 | } |
219 | bar.hide(); | ||
220 | if (moveit) { | 193 | if (moveit) { |
221 | deleteMailList( t ); | 194 | deleteMailList( t ); |