summaryrefslogtreecommitdiff
authorharlekin <harlekin>2004-01-03 20:49:34 (UTC)
committer harlekin <harlekin>2004-01-03 20:49:34 (UTC)
commit02b7e56d865847ce8f4a35b7075f7b3bb7b0de76 (patch) (unidiff)
treef8e0272523f9080ef2dee6901545febf854b2122
parenta89470252ffae1670e12ef5d81db08d0e27af265 (diff)
downloadopie-02b7e56d865847ce8f4a35b7075f7b3bb7b0de76.zip
opie-02b7e56d865847ce8f4a35b7075f7b3bb7b0de76.tar.gz
opie-02b7e56d865847ce8f4a35b7075f7b3bb7b0de76.tar.bz2
communicate outgoing mails status to the QPE/Pim channel ( to which the todayplugin listens for example)
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/libmailwrapper/smtpwrapper.cpp30
-rw-r--r--noncore/net/mail/libmailwrapper/smtpwrapper.h10
-rw-r--r--noncore/net/mail/opiemail.cpp3
-rw-r--r--noncore/net/mail/smtpwrapper.cpp30
-rw-r--r--noncore/net/mail/smtpwrapper.h10
5 files changed, 75 insertions, 8 deletions
diff --git a/noncore/net/mail/libmailwrapper/smtpwrapper.cpp b/noncore/net/mail/libmailwrapper/smtpwrapper.cpp
index 30c0707..7e03af9 100644
--- a/noncore/net/mail/libmailwrapper/smtpwrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/smtpwrapper.cpp
@@ -9,2 +9,5 @@
9 9
10#include <qpe/config.h>
11#include <qpe/qcopenvelope_qws.h>
12
10#include <libetpan/libetpan.h> 13#include <libetpan/libetpan.h>
@@ -25,2 +28,12 @@ SMTPwrapper::SMTPwrapper( Settings *s )
25 settings = s; 28 settings = s;
29 Config cfg( "mail" );
30 cfg.setGroup( "Status" );
31 m_queuedMail = cfg.readNumEntry( "outgoing", 0 );
32 emit queuedMails( m_queuedMail );
33 connect( this, SIGNAL( queuedMails( int ) ), this, SLOT( emitQCop( int ) ) );
34}
35
36void SMTPwrapper::emitQCop( int queued ) {
37 QCopEnvelope env( "QPE/Pim", "outgoingMails(int)" );
38 env << queued;
26} 39}
@@ -250,3 +263,3 @@ mailmime *SMTPwrapper::buildFilePart(const QString&filename,const QString&mimety
250 } 263 }
251 264
252 int disptype = MAILMIME_DISPOSITION_TYPE_ATTACHMENT; 265 int disptype = MAILMIME_DISPOSITION_TYPE_ATTACHMENT;
@@ -352,3 +365,3 @@ mailmime *SMTPwrapper::createMimeMail(const Mail &mail )
352 txtPart = buildTxtPart( mail.getMessage() ); 365 txtPart = buildTxtPart( mail.getMessage() );
353 366
354 if ( txtPart == NULL ) goto err_free_message; 367 if ( txtPart == NULL ) goto err_free_message;
@@ -491,3 +504,3 @@ void SMTPwrapper::smtpSend( mailmime *mail,bool later, SMTPaccount *smtp )
491 from = data = 0; 504 from = data = 0;
492 505
493 mailmessage * msg = 0; 506 mailmessage * msg = 0;
@@ -509,2 +522,6 @@ void SMTPwrapper::smtpSend( mailmime *mail,bool later, SMTPaccount *smtp )
509 if (data) free( data ); 522 if (data) free( data );
523 Config cfg( "mail" );
524 cfg.setGroup( "Status" );
525 cfg.writeEntry( "outgoing", ++m_queuedMail );
526 emit queuedMails( m_queuedMail );
510 return; 527 return;
@@ -655,3 +672,3 @@ int SMTPwrapper::sendQueuedMail(MBOXwrapper*wrap,SMTPaccount*smtp,RecMail*which)
655 free(data); 672 free(data);
656 } 673 }
657 if (from) { 674 if (from) {
@@ -702,2 +719,7 @@ bool SMTPwrapper::flushOutbox(SMTPaccount*smtp)
702 } 719 }
720 Config cfg( "mail" );
721 cfg.setGroup( "Status" );
722 m_queuedMail = 0;
723 cfg.writeEntry( "outgoing", m_queuedMail );
724 emit queuedMails( m_queuedMail );
703 sendProgress->hide(); 725 sendProgress->hide();
diff --git a/noncore/net/mail/libmailwrapper/smtpwrapper.h b/noncore/net/mail/libmailwrapper/smtpwrapper.h
index 0535983..05becf2 100644
--- a/noncore/net/mail/libmailwrapper/smtpwrapper.h
+++ b/noncore/net/mail/libmailwrapper/smtpwrapper.h
@@ -33,2 +33,6 @@ public:
33 static progressMailSend*sendProgress; 33 static progressMailSend*sendProgress;
34
35signals:
36 void queuedMails( int );
37
34protected: 38protected:
@@ -58,2 +62,8 @@ protected:
58 int sendQueuedMail(MBOXwrapper*wrap,SMTPaccount*smtp,RecMail*which); 62 int sendQueuedMail(MBOXwrapper*wrap,SMTPaccount*smtp,RecMail*which);
63
64 int m_queuedMail;
65
66protected slots:
67 void emitQCop( int queued );
68
59}; 69};
diff --git a/noncore/net/mail/opiemail.cpp b/noncore/net/mail/opiemail.cpp
index e35f5b6..54453b7 100644
--- a/noncore/net/mail/opiemail.cpp
+++ b/noncore/net/mail/opiemail.cpp
@@ -27,2 +27,5 @@ OpieMail::OpieMail( QWidget *parent, const char *name, WFlags flags )
27#endif 27#endif
28
29
30
28} 31}
diff --git a/noncore/net/mail/smtpwrapper.cpp b/noncore/net/mail/smtpwrapper.cpp
index 30c0707..7e03af9 100644
--- a/noncore/net/mail/smtpwrapper.cpp
+++ b/noncore/net/mail/smtpwrapper.cpp
@@ -9,2 +9,5 @@
9 9
10#include <qpe/config.h>
11#include <qpe/qcopenvelope_qws.h>
12
10#include <libetpan/libetpan.h> 13#include <libetpan/libetpan.h>
@@ -25,2 +28,12 @@ SMTPwrapper::SMTPwrapper( Settings *s )
25 settings = s; 28 settings = s;
29 Config cfg( "mail" );
30 cfg.setGroup( "Status" );
31 m_queuedMail = cfg.readNumEntry( "outgoing", 0 );
32 emit queuedMails( m_queuedMail );
33 connect( this, SIGNAL( queuedMails( int ) ), this, SLOT( emitQCop( int ) ) );
34}
35
36void SMTPwrapper::emitQCop( int queued ) {
37 QCopEnvelope env( "QPE/Pim", "outgoingMails(int)" );
38 env << queued;
26} 39}
@@ -250,3 +263,3 @@ mailmime *SMTPwrapper::buildFilePart(const QString&filename,const QString&mimety
250 } 263 }
251 264
252 int disptype = MAILMIME_DISPOSITION_TYPE_ATTACHMENT; 265 int disptype = MAILMIME_DISPOSITION_TYPE_ATTACHMENT;
@@ -352,3 +365,3 @@ mailmime *SMTPwrapper::createMimeMail(const Mail &mail )
352 txtPart = buildTxtPart( mail.getMessage() ); 365 txtPart = buildTxtPart( mail.getMessage() );
353 366
354 if ( txtPart == NULL ) goto err_free_message; 367 if ( txtPart == NULL ) goto err_free_message;
@@ -491,3 +504,3 @@ void SMTPwrapper::smtpSend( mailmime *mail,bool later, SMTPaccount *smtp )
491 from = data = 0; 504 from = data = 0;
492 505
493 mailmessage * msg = 0; 506 mailmessage * msg = 0;
@@ -509,2 +522,6 @@ void SMTPwrapper::smtpSend( mailmime *mail,bool later, SMTPaccount *smtp )
509 if (data) free( data ); 522 if (data) free( data );
523 Config cfg( "mail" );
524 cfg.setGroup( "Status" );
525 cfg.writeEntry( "outgoing", ++m_queuedMail );
526 emit queuedMails( m_queuedMail );
510 return; 527 return;
@@ -655,3 +672,3 @@ int SMTPwrapper::sendQueuedMail(MBOXwrapper*wrap,SMTPaccount*smtp,RecMail*which)
655 free(data); 672 free(data);
656 } 673 }
657 if (from) { 674 if (from) {
@@ -702,2 +719,7 @@ bool SMTPwrapper::flushOutbox(SMTPaccount*smtp)
702 } 719 }
720 Config cfg( "mail" );
721 cfg.setGroup( "Status" );
722 m_queuedMail = 0;
723 cfg.writeEntry( "outgoing", m_queuedMail );
724 emit queuedMails( m_queuedMail );
703 sendProgress->hide(); 725 sendProgress->hide();
diff --git a/noncore/net/mail/smtpwrapper.h b/noncore/net/mail/smtpwrapper.h
index 0535983..05becf2 100644
--- a/noncore/net/mail/smtpwrapper.h
+++ b/noncore/net/mail/smtpwrapper.h
@@ -33,2 +33,6 @@ public:
33 static progressMailSend*sendProgress; 33 static progressMailSend*sendProgress;
34
35signals:
36 void queuedMails( int );
37
34protected: 38protected:
@@ -58,2 +62,8 @@ protected:
58 int sendQueuedMail(MBOXwrapper*wrap,SMTPaccount*smtp,RecMail*which); 62 int sendQueuedMail(MBOXwrapper*wrap,SMTPaccount*smtp,RecMail*which);
63
64 int m_queuedMail;
65
66protected slots:
67 void emitQCop( int queued );
68
59}; 69};