-rw-r--r-- | noncore/net/mail/libmailwrapper/smtpwrapper.cpp | 15 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/smtpwrapper.h | 2 | ||||
-rw-r--r-- | noncore/net/mail/opiemail.cpp | 3 | ||||
-rw-r--r-- | noncore/net/mail/smtpwrapper.cpp | 15 | ||||
-rw-r--r-- | noncore/net/mail/smtpwrapper.h | 2 |
5 files changed, 26 insertions, 11 deletions
diff --git a/noncore/net/mail/libmailwrapper/smtpwrapper.cpp b/noncore/net/mail/libmailwrapper/smtpwrapper.cpp index 770e2b8..a7e4837 100644 --- a/noncore/net/mail/libmailwrapper/smtpwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/smtpwrapper.cpp | |||
@@ -696,12 +696,15 @@ int SMTPwrapper::sendQueuedMail(MBOXwrapper*wrap,SMTPaccount*smtp,RecMail*which) | |||
696 | 696 | ||
697 | /* this is a special fun */ | 697 | /* this is a special fun */ |
698 | void SMTPwrapper::flushOutbox(SMTPaccount*smtp) | 698 | bool SMTPwrapper::flushOutbox(SMTPaccount*smtp) |
699 | { | 699 | { |
700 | if (!smtp) return; | 700 | bool returnValue = true; |
701 | |||
702 | if (!smtp) return false; | ||
703 | |||
701 | QString localfolders = (QString) getenv( "HOME" ) + QString("/Applications/opiemail/localmail/"); | 704 | QString localfolders = (QString) getenv( "HOME" ) + QString("/Applications/opiemail/localmail/"); |
702 | MBOXwrapper*wrap = new MBOXwrapper(localfolders); | 705 | MBOXwrapper*wrap = new MBOXwrapper(localfolders); |
703 | if (!wrap) { | 706 | if (!wrap) { |
704 | qDebug("memory error"); | 707 | qDebug("memory error"); |
705 | return; | 708 | return false; |
706 | } | 709 | } |
707 | QList<RecMail> mailsToSend; | 710 | QList<RecMail> mailsToSend; |
@@ -711,5 +714,5 @@ void SMTPwrapper::flushOutbox(SMTPaccount*smtp) | |||
711 | if (mailsToSend.count()==0) { | 714 | if (mailsToSend.count()==0) { |
712 | delete wrap; | 715 | delete wrap; |
713 | return; | 716 | return false; |
714 | } | 717 | } |
715 | mailsToSend.setAutoDelete(false); | 718 | mailsToSend.setAutoDelete(false); |
@@ -723,4 +726,6 @@ void SMTPwrapper::flushOutbox(SMTPaccount*smtp) | |||
723 | QMessageBox::critical(0,tr("Error sending mail"), | 726 | QMessageBox::critical(0,tr("Error sending mail"), |
724 | tr("Error sending queued mail - breaking")); | 727 | tr("Error sending queued mail - breaking")); |
728 | |||
729 | returnValue = false; | ||
725 | break; | 730 | break; |
726 | } | 731 | } |
@@ -735,3 +740,5 @@ void SMTPwrapper::flushOutbox(SMTPaccount*smtp) | |||
735 | mailsToSend.setAutoDelete(true); | 740 | mailsToSend.setAutoDelete(true); |
736 | delete wrap; | 741 | delete wrap; |
742 | return returnValue; | ||
743 | |||
737 | } | 744 | } |
diff --git a/noncore/net/mail/libmailwrapper/smtpwrapper.h b/noncore/net/mail/libmailwrapper/smtpwrapper.h index baa353b..66180b7 100644 --- a/noncore/net/mail/libmailwrapper/smtpwrapper.h +++ b/noncore/net/mail/libmailwrapper/smtpwrapper.h | |||
@@ -29,5 +29,5 @@ public: | |||
29 | virtual ~SMTPwrapper(){} | 29 | virtual ~SMTPwrapper(){} |
30 | void sendMail(const Mail& mail,bool later=false ); | 30 | void sendMail(const Mail& mail,bool later=false ); |
31 | void flushOutbox(SMTPaccount*smtp); | 31 | bool flushOutbox(SMTPaccount*smtp); |
32 | 32 | ||
33 | static progressMailSend*sendProgress; | 33 | static progressMailSend*sendProgress; |
diff --git a/noncore/net/mail/opiemail.cpp b/noncore/net/mail/opiemail.cpp index 833cac2..0dede90 100644 --- a/noncore/net/mail/opiemail.cpp +++ b/noncore/net/mail/opiemail.cpp | |||
@@ -69,8 +69,9 @@ void OpieMail::slotSendQueued() | |||
69 | if (smtp) { | 69 | if (smtp) { |
70 | SMTPwrapper * wrap = new SMTPwrapper(settings); | 70 | SMTPwrapper * wrap = new SMTPwrapper(settings); |
71 | wrap->flushOutbox(smtp); | 71 | if ( wrap->flushOutbox(smtp) ) { |
72 | QMessageBox::information(0,tr("Info"),tr("Mail queue flushed")); | 72 | QMessageBox::information(0,tr("Info"),tr("Mail queue flushed")); |
73 | } | 73 | } |
74 | } | 74 | } |
75 | } | ||
75 | 76 | ||
76 | void OpieMail::slotSearchMails() | 77 | void OpieMail::slotSearchMails() |
diff --git a/noncore/net/mail/smtpwrapper.cpp b/noncore/net/mail/smtpwrapper.cpp index 770e2b8..a7e4837 100644 --- a/noncore/net/mail/smtpwrapper.cpp +++ b/noncore/net/mail/smtpwrapper.cpp | |||
@@ -696,12 +696,15 @@ int SMTPwrapper::sendQueuedMail(MBOXwrapper*wrap,SMTPaccount*smtp,RecMail*which) | |||
696 | 696 | ||
697 | /* this is a special fun */ | 697 | /* this is a special fun */ |
698 | void SMTPwrapper::flushOutbox(SMTPaccount*smtp) | 698 | bool SMTPwrapper::flushOutbox(SMTPaccount*smtp) |
699 | { | 699 | { |
700 | if (!smtp) return; | 700 | bool returnValue = true; |
701 | |||
702 | if (!smtp) return false; | ||
703 | |||
701 | QString localfolders = (QString) getenv( "HOME" ) + QString("/Applications/opiemail/localmail/"); | 704 | QString localfolders = (QString) getenv( "HOME" ) + QString("/Applications/opiemail/localmail/"); |
702 | MBOXwrapper*wrap = new MBOXwrapper(localfolders); | 705 | MBOXwrapper*wrap = new MBOXwrapper(localfolders); |
703 | if (!wrap) { | 706 | if (!wrap) { |
704 | qDebug("memory error"); | 707 | qDebug("memory error"); |
705 | return; | 708 | return false; |
706 | } | 709 | } |
707 | QList<RecMail> mailsToSend; | 710 | QList<RecMail> mailsToSend; |
@@ -711,5 +714,5 @@ void SMTPwrapper::flushOutbox(SMTPaccount*smtp) | |||
711 | if (mailsToSend.count()==0) { | 714 | if (mailsToSend.count()==0) { |
712 | delete wrap; | 715 | delete wrap; |
713 | return; | 716 | return false; |
714 | } | 717 | } |
715 | mailsToSend.setAutoDelete(false); | 718 | mailsToSend.setAutoDelete(false); |
@@ -723,4 +726,6 @@ void SMTPwrapper::flushOutbox(SMTPaccount*smtp) | |||
723 | QMessageBox::critical(0,tr("Error sending mail"), | 726 | QMessageBox::critical(0,tr("Error sending mail"), |
724 | tr("Error sending queued mail - breaking")); | 727 | tr("Error sending queued mail - breaking")); |
728 | |||
729 | returnValue = false; | ||
725 | break; | 730 | break; |
726 | } | 731 | } |
@@ -735,3 +740,5 @@ void SMTPwrapper::flushOutbox(SMTPaccount*smtp) | |||
735 | mailsToSend.setAutoDelete(true); | 740 | mailsToSend.setAutoDelete(true); |
736 | delete wrap; | 741 | delete wrap; |
742 | return returnValue; | ||
743 | |||
737 | } | 744 | } |
diff --git a/noncore/net/mail/smtpwrapper.h b/noncore/net/mail/smtpwrapper.h index baa353b..66180b7 100644 --- a/noncore/net/mail/smtpwrapper.h +++ b/noncore/net/mail/smtpwrapper.h | |||
@@ -29,5 +29,5 @@ public: | |||
29 | virtual ~SMTPwrapper(){} | 29 | virtual ~SMTPwrapper(){} |
30 | void sendMail(const Mail& mail,bool later=false ); | 30 | void sendMail(const Mail& mail,bool later=false ); |
31 | void flushOutbox(SMTPaccount*smtp); | 31 | bool flushOutbox(SMTPaccount*smtp); |
32 | 32 | ||
33 | static progressMailSend*sendProgress; | 33 | static progressMailSend*sendProgress; |