author | tille <tille> | 2002-06-19 13:06:57 (UTC) |
---|---|---|
committer | tille <tille> | 2002-06-19 13:06:57 (UTC) |
commit | 8d6e1b42d3b5b8dc376f0979d9f4363d9a6c6970 (patch) (unidiff) | |
tree | 35b6166a07f887b262b784947caec9a0c2e4dabe | |
parent | 2bcd7302e4e156ad5f389b23c01a690917abee01 (diff) | |
download | opie-8d6e1b42d3b5b8dc376f0979d9f4363d9a6c6970.zip opie-8d6e1b42d3b5b8dc376f0979d9f4363d9a6c6970.tar.gz opie-8d6e1b42d3b5b8dc376f0979d9f4363d9a6c6970.tar.bz2 |
fixed error while sending queue
-rw-r--r-- | noncore/unsupported/mail2/composer.cpp | 9 |
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() | |||
155 | if (header.isNull() || message.isNull()) return;// Aborted. | 155 | if (header.isNull() || message.isNull()) return;// Aborted. |
156 | 156 | ||
157 | abort->setEnabled(true); | 157 | abort->setEnabled(true); |
158 | 158 | ||
159 | SmtpHandler *handler = new SmtpHandler(header, message, accountsLoaded[from->currentItem()], to->text()); | 159 | SmtpHandler *handler = new SmtpHandler(header, message, accountsLoaded[from->currentItem()], to->text()); |
160 | connect(handler, SIGNAL(finished()), SLOT(slotSendFinished())); | 160 | connect(handler, SIGNAL(finished()), SLOT(slotSendFinished())); |
161 | connect(handler, SIGNAL(error(const QString &)), SLOT(slotSendError(const QString &))); | 161 | connect(handler, SIGNAL(error(const QString &)), SLOT(slotSendError(const QString &))); |
162 | connect(handler, SIGNAL(status(const QString &)), status, SLOT(setText(const QString &))); | 162 | connect(handler, SIGNAL(status(const QString &)), status, SLOT(setText(const QString &))); |
163 | } | 163 | } |
164 | 164 | ||
165 | void Composer::slotSendQueued() | 165 | void Composer::slotSendQueued() |
166 | { | 166 | { |
167 | 167 | int effSendCount = 0; | |
168 | qDebug("Sending queued messages"); | 168 | qDebug("Sending queued messages"); |
169 | Config cfg( "mailqueue", Config::User ); | 169 | Config cfg( "mailqueue", Config::User ); |
170 | cfg.setGroup( "Settings" ); | 170 | cfg.setGroup( "Settings" ); |
171 | _sendCount = 0; | 171 | _sendCount = 0; |
172 | _sendError = 0; | 172 | _sendError = 0; |
173 | _toSend = cfg.readNumEntry( "count", 0 ); | 173 | _toSend = cfg.readNumEntry( "count", 0 ); |
174 | 174 | ||
175 | if (_toSend == 0) close(); | 175 | if (_toSend == 0) close(); |
176 | 176 | ||
177 | qDebug("%i messages to send", _toSend); | 177 | qDebug("%i messages to send", _toSend); |
178 | QString str; | 178 | QString str; |
179 | for (int i=1;i<=_toSend;i++) | 179 | for (int i=1;i<=_toSend;i++) |
@@ -236,30 +236,35 @@ void Composer::slotSendQueued() | |||
236 | smail.setAttachments(attachments); | 236 | smail.setAttachments(attachments); |
237 | 237 | ||
238 | qDebug("putting mail together"); | 238 | qDebug("putting mail together"); |
239 | 239 | ||
240 | QString header, message; | 240 | QString header, message; |
241 | MailFactory::genMail(header, message, smail, this); | 241 | MailFactory::genMail(header, message, smail, this); |
242 | if (header.isNull() || message.isNull()) continue;//return;// Aborted. | 242 | if (header.isNull() || message.isNull()) continue;//return;// Aborted. |
243 | 243 | ||
244 | // abort->setEnabled(true); | 244 | // abort->setEnabled(true); |
245 | 245 | ||
246 | qDebug("Sending to %s",toAdr.latin1()); | 246 | qDebug("Sending to %s",toAdr.latin1()); |
247 | SmtpHandler *handler = new SmtpHandler(header, message, accnt ,toAdr); | 247 | SmtpHandler *handler = new SmtpHandler(header, message, accnt ,toAdr); |
248 | 248 | effSendCount++; | |
249 | connect(handler, SIGNAL(finished()), SLOT(slotSendQueuedFinished())); | 249 | connect(handler, SIGNAL(finished()), SLOT(slotSendQueuedFinished())); |
250 | connect(handler, SIGNAL(error(const QString &)), SLOT(slotSendQueuedError(const QString &))); | 250 | connect(handler, SIGNAL(error(const QString &)), SLOT(slotSendQueuedError(const QString &))); |
251 | connect(handler, SIGNAL(status(const QString &)), status, SLOT(setText(const QString &))); | 251 | connect(handler, SIGNAL(status(const QString &)), status, SLOT(setText(const QString &))); |
252 | 252 | ||
253 | } | 253 | } |
254 | if (effSendCount < _toSend) | ||
255 | { | ||
256 | _toSend = effSendCount; | ||
257 | QMessageBox::information(this, tr("Error"), tr("<p>There was a problem sending some of the queued mails.</p>"), tr("Ok")); | ||
258 | } | ||
254 | } | 259 | } |
255 | 260 | ||
256 | void Composer::slotQueueMail() | 261 | void Composer::slotQueueMail() |
257 | { | 262 | { |
258 | if (to->text().find(QRegExp(".*\\@.*\\..*")) == -1) { | 263 | if (to->text().find(QRegExp(".*\\@.*\\..*")) == -1) { |
259 | QMessageBox::information(this, tr("Error"), tr("<p>You have to specify a recipient.<br>(eg: foo@bar.org)</p>"), tr("Ok")); | 264 | QMessageBox::information(this, tr("Error"), tr("<p>You have to specify a recipient.<br>(eg: foo@bar.org)</p>"), tr("Ok")); |
260 | return; | 265 | return; |
261 | } | 266 | } |
262 | 267 | ||
263 | Config cfg( "mailqueue", Config::User ); | 268 | Config cfg( "mailqueue", Config::User ); |
264 | 269 | ||
265 | cfg.setGroup( "Settings" ); | 270 | cfg.setGroup( "Settings" ); |