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 @@ -125,13 +125,13 @@ void POP3wrapper::login() server = account->getServer().latin1(); port = account->getPort().toUInt(); if ( account->getUser().isEmpty() || account->getPassword().isEmpty() ) { + qApp->processEvents(); LoginDialog login( account->getUser(), account->getPassword(), NULL, 0, true ); login.show(); if ( QDialog::Accepted == login.exec() ) { // ok - qDebug("ok "); user = login.getUser(); pass = login.getPassword(); } else { // cancel @@ -164,9 +164,9 @@ void POP3wrapper::login() err = mailstorage_connect(m_pop3); if (err != MAIL_NO_ERROR) { ; // odebug << QString( "FEHLERNUMMER %1" ).arg( err ) << oendl; - Global::statusMessage(tr("Error initializing folder")); + Global::statusMessage(tr("Error %1 initializing folder").arg( err )); mailstorage_free(m_pop3); m_pop3 = 0; } else { mailsession * session = m_pop3->sto_session; @@ -199,26 +199,13 @@ void POP3wrapper::deleteMailList(const QValueList<RecMailP>&target) if (!m_pop3) return; int iii = 0; int count = target.count(); - QProgressBar bar( count,0 ); - bar.setCaption (("Removing mails - close to abort!") ); - int w = 300; - if ( QApplication::desktop()->width() < 320 ) - w = 220; - int h = bar.sizeHint().height() ; - int dw = QApplication::desktop()->width(); - int dh = QApplication::desktop()->height(); - bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); - bar.show(); - int modulo = (count/10)+1; - int incCounter = 0; + QWidget wid; + wid.show(); while (iii < count ) { - if ( ! bar.isVisible() ) - return ; - if ( incCounter % modulo == 0 ) - bar.setProgress( incCounter ); - ++incCounter; + Global::statusMessage(tr("Delete message %1 of %2").arg(iii).arg(count)); + wid.raise(); qApp->processEvents(); //qDebug("delete "); RecMailP mail = (*target.at( iii )); int err = mailsession_remove_message(m_pop3->sto_session,mail->getNumber()); @@ -251,27 +238,15 @@ int POP3wrapper::deleteAllMail(const FolderP&) { if (err != MAIL_NO_ERROR) { Global::statusMessage(tr("Error getting folder info")); return 0; } - QProgressBar bar( result,0 ); - bar.setCaption (("Deleting mails - close to abort!") ); - int w = 300; - if ( QApplication::desktop()->width() < 320 ) - w = 220; - int h = bar.sizeHint().height() ; - int dw = QApplication::desktop()->width(); - int dh = QApplication::desktop()->height(); - bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); - bar.show(); - int modulo = (result/10)+1; - int incCounter = 0; - for (unsigned int i = 0; i < result; ++i) { - if ( ! bar.isVisible() ) - return 0; - if ( incCounter % modulo == 0 ) - bar.setProgress( incCounter ); - ++incCounter; + QWidget wid; + wid.show(); + for (unsigned int i = 0; i < result; ++i) { + Global::statusMessage(tr("Delete message %1 of %2").arg(i).arg(result)); + 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; |