Diffstat (limited to 'kmicromail/libmailwrapper/pop3wrapper.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kmicromail/libmailwrapper/pop3wrapper.cpp | 49 |
1 files changed, 12 insertions, 37 deletions
diff --git a/kmicromail/libmailwrapper/pop3wrapper.cpp b/kmicromail/libmailwrapper/pop3wrapper.cpp index f430121..8d2f778 100644 --- a/kmicromail/libmailwrapper/pop3wrapper.cpp +++ b/kmicromail/libmailwrapper/pop3wrapper.cpp | |||
@@ -126,11 +126,11 @@ void POP3wrapper::login() | |||
126 | port = account->getPort().toUInt(); | 126 | port = account->getPort().toUInt(); |
127 | 127 | ||
128 | if ( account->getUser().isEmpty() || account->getPassword().isEmpty() ) { | 128 | if ( account->getUser().isEmpty() || account->getPassword().isEmpty() ) { |
129 | qApp->processEvents(); | ||
129 | LoginDialog login( account->getUser(), account->getPassword(), NULL, 0, true ); | 130 | LoginDialog login( account->getUser(), account->getPassword(), NULL, 0, true ); |
130 | login.show(); | 131 | login.show(); |
131 | if ( QDialog::Accepted == login.exec() ) { | 132 | if ( QDialog::Accepted == login.exec() ) { |
132 | // ok | 133 | // ok |
133 | qDebug("ok "); | ||
134 | user = login.getUser(); | 134 | user = login.getUser(); |
135 | pass = login.getPassword(); | 135 | pass = login.getPassword(); |
136 | } else { | 136 | } else { |
@@ -165,7 +165,7 @@ void POP3wrapper::login() | |||
165 | err = mailstorage_connect(m_pop3); | 165 | err = mailstorage_connect(m_pop3); |
166 | if (err != MAIL_NO_ERROR) { | 166 | if (err != MAIL_NO_ERROR) { |
167 | ; // odebug << QString( "FEHLERNUMMER %1" ).arg( err ) << oendl; | 167 | ; // odebug << QString( "FEHLERNUMMER %1" ).arg( err ) << oendl; |
168 | Global::statusMessage(tr("Error initializing folder")); | 168 | Global::statusMessage(tr("Error %1 initializing folder").arg( err )); |
169 | mailstorage_free(m_pop3); | 169 | mailstorage_free(m_pop3); |
170 | m_pop3 = 0; | 170 | m_pop3 = 0; |
171 | } else { | 171 | } else { |
@@ -200,24 +200,11 @@ void POP3wrapper::deleteMailList(const QValueList<RecMailP>&target) | |||
200 | return; | 200 | return; |
201 | int iii = 0; | 201 | int iii = 0; |
202 | int count = target.count(); | 202 | int count = target.count(); |
203 | QProgressBar bar( count,0 ); | 203 | QWidget wid; |
204 | bar.setCaption (("Removing mails - close to abort!") ); | 204 | wid.show(); |
205 | int w = 300; | ||
206 | if ( QApplication::desktop()->width() < 320 ) | ||
207 | w = 220; | ||
208 | int h = bar.sizeHint().height() ; | ||
209 | int dw = QApplication::desktop()->width(); | ||
210 | int dh = QApplication::desktop()->height(); | ||
211 | bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); | ||
212 | bar.show(); | ||
213 | int modulo = (count/10)+1; | ||
214 | int incCounter = 0; | ||
215 | while (iii < count ) { | 205 | while (iii < count ) { |
216 | if ( ! bar.isVisible() ) | 206 | Global::statusMessage(tr("Delete message %1 of %2").arg(iii).arg(count)); |
217 | return ; | 207 | wid.raise(); |
218 | if ( incCounter % modulo == 0 ) | ||
219 | bar.setProgress( incCounter ); | ||
220 | ++incCounter; | ||
221 | qApp->processEvents(); | 208 | qApp->processEvents(); |
222 | //qDebug("delete "); | 209 | //qDebug("delete "); |
223 | RecMailP mail = (*target.at( iii )); | 210 | RecMailP mail = (*target.at( iii )); |
@@ -252,25 +239,13 @@ int POP3wrapper::deleteAllMail(const FolderP&) { | |||
252 | Global::statusMessage(tr("Error getting folder info")); | 239 | Global::statusMessage(tr("Error getting folder info")); |
253 | return 0; | 240 | return 0; |
254 | } | 241 | } |
255 | QProgressBar bar( result,0 ); | 242 | QWidget wid; |
256 | bar.setCaption (("Deleting mails - close to abort!") ); | 243 | wid.show(); |
257 | int w = 300; | 244 | for (unsigned int i = 0; i < result; ++i) { |
258 | if ( QApplication::desktop()->width() < 320 ) | 245 | Global::statusMessage(tr("Delete message %1 of %2").arg(i).arg(result)); |
259 | w = 220; | 246 | wid.raise(); |
260 | int h = bar.sizeHint().height() ; | ||
261 | int dw = QApplication::desktop()->width(); | ||
262 | int dh = QApplication::desktop()->height(); | ||
263 | bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); | ||
264 | bar.show(); | ||
265 | int modulo = (result/10)+1; | ||
266 | int incCounter = 0; | ||
267 | for (unsigned int i = 0; i < result; ++i) { | ||
268 | if ( ! bar.isVisible() ) | ||
269 | return 0; | ||
270 | if ( incCounter % modulo == 0 ) | ||
271 | bar.setProgress( incCounter ); | ||
272 | ++incCounter; | ||
273 | qApp->processEvents(); | 247 | qApp->processEvents(); |
248 | |||
274 | err = mailsession_remove_message(m_pop3->sto_session,i+1); | 249 | err = mailsession_remove_message(m_pop3->sto_session,i+1); |
275 | if (err != MAIL_NO_ERROR) { | 250 | if (err != MAIL_NO_ERROR) { |
276 | Global::statusMessage(tr("Error deleting mail %1").arg(i+1)); | 251 | Global::statusMessage(tr("Error deleting mail %1").arg(i+1)); |