Diffstat (limited to 'noncore/net/mail/smtpwrapper.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/mail/smtpwrapper.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
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 | |||
@@ -695,14 +695,17 @@ int SMTPwrapper::sendQueuedMail(MBOXwrapper*wrap,SMTPaccount*smtp,RecMail*which) | |||
695 | } | 695 | } |
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; |
708 | QList<RecMail> mailsToRemove; | 711 | QList<RecMail> mailsToRemove; |
@@ -710,7 +713,7 @@ void SMTPwrapper::flushOutbox(SMTPaccount*smtp) | |||
710 | wrap->listMessages(mbox,mailsToSend); | 713 | wrap->listMessages(mbox,mailsToSend); |
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); |
716 | sendProgress = new progressMailSend(); | 719 | sendProgress = new progressMailSend(); |
@@ -722,6 +725,8 @@ void SMTPwrapper::flushOutbox(SMTPaccount*smtp) | |||
722 | if (sendQueuedMail(wrap,smtp,mailsToSend.at(0))==0) { | 725 | if (sendQueuedMail(wrap,smtp,mailsToSend.at(0))==0) { |
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 | } |
727 | mailsToRemove.append(mailsToSend.at(0)); | 732 | mailsToRemove.append(mailsToSend.at(0)); |
@@ -734,4 +739,6 @@ void SMTPwrapper::flushOutbox(SMTPaccount*smtp) | |||
734 | wrap->deleteMails(mbox,mailsToRemove); | 739 | wrap->deleteMails(mbox,mailsToRemove); |
735 | mailsToSend.setAutoDelete(true); | 740 | mailsToSend.setAutoDelete(true); |
736 | delete wrap; | 741 | delete wrap; |
742 | return returnValue; | ||
743 | |||
737 | } | 744 | } |