summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/unsupported/mail2/composer.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/noncore/unsupported/mail2/composer.cpp b/noncore/unsupported/mail2/composer.cpp
index 03dacae..52ebbdd 100644
--- a/noncore/unsupported/mail2/composer.cpp
+++ b/noncore/unsupported/mail2/composer.cpp
@@ -155,25 +155,25 @@ void Composer::slotSendMail()
if (header.isNull() || message.isNull()) return; // Aborted.
abort->setEnabled(true);
SmtpHandler *handler = new SmtpHandler(header, message, accountsLoaded[from->currentItem()], to->text());
connect(handler, SIGNAL(finished()), SLOT(slotSendFinished()));
connect(handler, SIGNAL(error(const QString &)), SLOT(slotSendError(const QString &)));
connect(handler, SIGNAL(status(const QString &)), status, SLOT(setText(const QString &)));
}
void Composer::slotSendQueued()
{
-
+ int effSendCount = 0;
qDebug("Sending queued messages");
Config cfg( "mailqueue", Config::User );
cfg.setGroup( "Settings" );
_sendCount = 0;
_sendError = 0;
_toSend = cfg.readNumEntry( "count", 0 );
if (_toSend == 0) close();
qDebug("%i messages to send", _toSend);
QString str;
for (int i=1;i<=_toSend;i++)
@@ -236,30 +236,35 @@ void Composer::slotSendQueued()
smail.setAttachments(attachments);
qDebug("putting mail together");
QString header, message;
MailFactory::genMail(header, message, smail, this);
if (header.isNull() || message.isNull()) continue;//return; // Aborted.
// abort->setEnabled(true);
qDebug("Sending to %s",toAdr.latin1());
SmtpHandler *handler = new SmtpHandler(header, message, accnt ,toAdr);
-
+ effSendCount++;
connect(handler, SIGNAL(finished()), SLOT(slotSendQueuedFinished()));
connect(handler, SIGNAL(error(const QString &)), SLOT(slotSendQueuedError(const QString &)));
connect(handler, SIGNAL(status(const QString &)), status, SLOT(setText(const QString &)));
}
+ if (effSendCount < _toSend)
+ {
+ _toSend = effSendCount;
+ QMessageBox::information(this, tr("Error"), tr("<p>There was a problem sending some of the queued mails.</p>"), tr("Ok"));
+ }
}
void Composer::slotQueueMail()
{
if (to->text().find(QRegExp(".*\\@.*\\..*")) == -1) {
QMessageBox::information(this, tr("Error"), tr("<p>You have to specify a recipient.<br>(eg: foo@bar.org)</p>"), tr("Ok"));
return;
}
Config cfg( "mailqueue", Config::User );
cfg.setGroup( "Settings" );