Diffstat (limited to 'noncore/net/mail/smtpwrapper.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/mail/smtpwrapper.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/noncore/net/mail/smtpwrapper.cpp b/noncore/net/mail/smtpwrapper.cpp index b81a87f..53c0af5 100644 --- a/noncore/net/mail/smtpwrapper.cpp +++ b/noncore/net/mail/smtpwrapper.cpp | |||
@@ -15,6 +15,9 @@ | |||
15 | #include "logindialog.h" | 15 | #include "logindialog.h" |
16 | #include "mailtypes.h" | 16 | #include "mailtypes.h" |
17 | #include "defines.h" | 17 | #include "defines.h" |
18 | #include "sendmailprogress.h" | ||
19 | |||
20 | progressMailSend*SMTPwrapper::sendProgress = 0; | ||
18 | 21 | ||
19 | SMTPwrapper::SMTPwrapper( Settings *s ) | 22 | SMTPwrapper::SMTPwrapper( Settings *s ) |
20 | : QObject() | 23 | : QObject() |
@@ -520,7 +523,10 @@ void SMTPwrapper::readFromFile(const QString&file, char **data, size_t *size ) | |||
520 | 523 | ||
521 | void SMTPwrapper::progress( size_t current, size_t maximum ) | 524 | void SMTPwrapper::progress( size_t current, size_t maximum ) |
522 | { | 525 | { |
523 | // qDebug( "Current: %i of %i", current, maximum ); | 526 | if (SMTPwrapper::sendProgress) { |
527 | SMTPwrapper::sendProgress->setSingleMail(current, maximum ); | ||
528 | qDebug("%u of %u",current,maximum); | ||
529 | } | ||
524 | } | 530 | } |
525 | 531 | ||
526 | void SMTPwrapper::storeMail(char*mail, size_t length, const QString&box) | 532 | void SMTPwrapper::storeMail(char*mail, size_t length, const QString&box) |
@@ -645,9 +651,16 @@ void SMTPwrapper::sendMail(const Mail&mail,bool later ) | |||
645 | if ( mimeMail == NULL ) { | 651 | if ( mimeMail == NULL ) { |
646 | qDebug( "sendMail: error creating mime mail" ); | 652 | qDebug( "sendMail: error creating mime mail" ); |
647 | } else { | 653 | } else { |
654 | sendProgress = new progressMailSend(); | ||
655 | sendProgress->showMaximized(); | ||
656 | sendProgress->show(); | ||
657 | qApp->processEvents(10); | ||
648 | smtpSend( mimeMail,later,smtp); | 658 | smtpSend( mimeMail,later,smtp); |
649 | mailmime_free( mimeMail ); | 659 | mailmime_free( mimeMail ); |
650 | qDebug("Clean up done"); | 660 | qDebug("Clean up done"); |
661 | sendProgress->hide(); | ||
662 | delete sendProgress; | ||
663 | sendProgress = 0; | ||
651 | } | 664 | } |
652 | } | 665 | } |
653 | 666 | ||
@@ -673,6 +686,7 @@ int SMTPwrapper::sendQueuedMail(MBOXwrapper*wrap,SMTPaccount*smtp,RecMail*which) | |||
673 | rcpts = createRcptList( fields ); | 686 | rcpts = createRcptList( fields ); |
674 | ffrom = getField(fields, MAILIMF_FIELD_FROM ); | 687 | ffrom = getField(fields, MAILIMF_FIELD_FROM ); |
675 | from = getFrom(ffrom); | 688 | from = getFrom(ffrom); |
689 | |||
676 | qDebug("Size: %i vs. %i",length,strlen(data)); | 690 | qDebug("Size: %i vs. %i",length,strlen(data)); |
677 | if (rcpts && from) { | 691 | if (rcpts && from) { |
678 | return smtpSend(from,rcpts,data,strlen(data),smtp ); | 692 | return smtpSend(from,rcpts,data,strlen(data),smtp ); |