summaryrefslogtreecommitdiff
path: root/noncore/net/mail/libmailwrapper/smtpwrapper.cpp
authoralwin <alwin>2003-12-24 01:29:43 (UTC)
committer alwin <alwin>2003-12-24 01:29:43 (UTC)
commit242f7a04e3e4963a5606ac603d54a4f115de4a04 (patch) (unidiff)
treedd8578fbc812791dd7e5026a28710a8313cf5cf8 /noncore/net/mail/libmailwrapper/smtpwrapper.cpp
parent7c720aabcad9b325dbf9910493e3c9fa1d63805e (diff)
downloadopie-242f7a04e3e4963a5606ac603d54a4f115de4a04.zip
opie-242f7a04e3e4963a5606ac603d54a4f115de4a04.tar.gz
opie-242f7a04e3e4963a5606ac603d54a4f115de4a04.tar.bz2
tried to implement a progress dialog when sending mails. It doesn't work
(dialog will show but makes no updates, when using qApp->progressEvents(x) dialog hides) I don't know why - and I giving up for the moment.
Diffstat (limited to 'noncore/net/mail/libmailwrapper/smtpwrapper.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/libmailwrapper/smtpwrapper.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/noncore/net/mail/libmailwrapper/smtpwrapper.cpp b/noncore/net/mail/libmailwrapper/smtpwrapper.cpp
index b81a87f..53c0af5 100644
--- a/noncore/net/mail/libmailwrapper/smtpwrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/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
20progressMailSend*SMTPwrapper::sendProgress = 0;
18 21
19SMTPwrapper::SMTPwrapper( Settings *s ) 22SMTPwrapper::SMTPwrapper( Settings *s )
20 : QObject() 23 : QObject()
@@ -520,7 +523,10 @@ void SMTPwrapper::readFromFile(const QString&file, char **data, size_t *size )
520 523
521void SMTPwrapper::progress( size_t current, size_t maximum ) 524void 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
526void SMTPwrapper::storeMail(char*mail, size_t length, const QString&box) 532void 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 );