author | alwin <alwin> | 2004-03-02 12:21:11 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-03-02 12:21:11 (UTC) |
commit | b6b1c97559c0ed9f2e33632272426bf98f289232 (patch) (unidiff) | |
tree | d3a9987704770cdf5eb14e1136f6e3ecb2f36a04 /noncore/unsupported/mail2/composer.cpp | |
parent | 0d59c780513da78033f4d9040475dee9db0256d4 (diff) | |
download | opie-b6b1c97559c0ed9f2e33632272426bf98f289232.zip opie-b6b1c97559c0ed9f2e33632272426bf98f289232.tar.gz opie-b6b1c97559c0ed9f2e33632272426bf98f289232.tar.bz2 |
applied the patch generated by the optimize_connect script from
TT.
Diffstat (limited to 'noncore/unsupported/mail2/composer.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/unsupported/mail2/composer.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/noncore/unsupported/mail2/composer.cpp b/noncore/unsupported/mail2/composer.cpp index cb80299..da1aee9 100644 --- a/noncore/unsupported/mail2/composer.cpp +++ b/noncore/unsupported/mail2/composer.cpp | |||
@@ -137,50 +137,50 @@ void Composer::slotSendMail() | |||
137 | if (priority->currentItem() == POPUP_PRIO_LOW) { | 137 | if (priority->currentItem() == POPUP_PRIO_LOW) { |
138 | smail.setPriority("Low");// No i18n on purpose | 138 | smail.setPriority("Low");// No i18n on purpose |
139 | } else if (priority->currentItem() == POPUP_PRIO_NORMAL) { | 139 | } else if (priority->currentItem() == POPUP_PRIO_NORMAL) { |
140 | smail.setPriority("Normal");// No i18n on purpose | 140 | smail.setPriority("Normal");// No i18n on purpose |
141 | } else if (priority->currentItem() == POPUP_PRIO_HIGH) { | 141 | } else if (priority->currentItem() == POPUP_PRIO_HIGH) { |
142 | smail.setPriority("High");// No i18n on purpose | 142 | smail.setPriority("High");// No i18n on purpose |
143 | } | 143 | } |
144 | 144 | ||
145 | QValueList<Attachment> attachments; | 145 | QValueList<Attachment> attachments; |
146 | QListViewItem *item; | 146 | QListViewItem *item; |
147 | for (item = attachView->firstChild(); item != 0; item = item->itemBelow()) { | 147 | for (item = attachView->firstChild(); item != 0; item = item->itemBelow()) { |
148 | attachments.append(((AttachViewItem *)item)->attachment()); | 148 | attachments.append(((AttachViewItem *)item)->attachment()); |
149 | } | 149 | } |
150 | 150 | ||
151 | smail.setAttachments(attachments); | 151 | smail.setAttachments(attachments); |
152 | 152 | ||
153 | QString header, message; | 153 | QString header, message; |
154 | MailFactory::genMail(header, message, smail, this); | 154 | MailFactory::genMail(header, message, smail, this); |
155 | if (header.isNull() || message.isNull()) return;// Aborted. | 155 | if (header.isNull() || message.isNull()) return;// Aborted. |
156 | 156 | ||
157 | status->setStopEnabled(true); | 157 | status->setStopEnabled(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(setStatusText(const QString &))); | 162 | connect(handler, SIGNAL(status(const QString&)), status, SLOT(setStatusText(const QString&))); |
163 | } | 163 | } |
164 | 164 | ||
165 | void Composer::slotSendQueued() | 165 | void Composer::slotSendQueued() |
166 | { | 166 | { |
167 | int effSendCount = 0; | 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++) |
180 | { | 180 | { |
181 | qDebug("sending message %i",i); | 181 | qDebug("sending message %i",i); |
182 | cfg.setGroup( "Mail_" + QString::number(i) ); | 182 | cfg.setGroup( "Mail_" + QString::number(i) ); |
183 | SendMail smail; | 183 | SendMail smail; |
184 | str = cfg.readEntry("from"); | 184 | str = cfg.readEntry("from"); |
185 | qDebug("setFrom %s",str.latin1()); | 185 | qDebug("setFrom %s",str.latin1()); |
186 | smail.setFrom( str ); | 186 | smail.setFrom( str ); |
@@ -226,50 +226,50 @@ void Composer::slotSendQueued() | |||
226 | for (int j = 0; i < ac; ac++) { | 226 | for (int j = 0; i < ac; ac++) { |
227 | an = "Attachment_" + QString::number( j ); | 227 | an = "Attachment_" + QString::number( j ); |
228 | qDebug(an.latin1()); | 228 | qDebug(an.latin1()); |
229 | a.setFileName(cfg.readEntry( an + "fileName" )); | 229 | a.setFileName(cfg.readEntry( an + "fileName" )); |
230 | a.setNewName(cfg.readEntry( an + "newName" )); | 230 | a.setNewName(cfg.readEntry( an + "newName" )); |
231 | a.setDescription(cfg.readEntry( an + "description" )); | 231 | a.setDescription(cfg.readEntry( an + "description" )); |
232 | a.setDocLnk( DocLnk( cfg.readEntry( an + "docLnk" )) ); | 232 | a.setDocLnk( DocLnk( cfg.readEntry( an + "docLnk" )) ); |
233 | attachments.append( a ); | 233 | attachments.append( a ); |
234 | } | 234 | } |
235 | 235 | ||
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 | effSendCount++; | 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(setStatusText(const QString &))); | 251 | connect(handler, SIGNAL(status(const QString&)), status, SLOT(setStatusText(const QString&))); |
252 | 252 | ||
253 | } | 253 | } |
254 | if (effSendCount < _toSend) | 254 | if (effSendCount < _toSend) |
255 | { | 255 | { |
256 | _toSend = effSendCount; | 256 | _toSend = effSendCount; |
257 | QMessageBox::information(this, tr("Error"), tr("<p>There was a problem sending some of the queued mails.</p>"), tr("Ok")); | 257 | QMessageBox::information(this, tr("Error"), tr("<p>There was a problem sending some of the queued mails.</p>"), tr("Ok")); |
258 | } | 258 | } |
259 | } | 259 | } |
260 | 260 | ||
261 | void Composer::slotQueueMail() | 261 | void Composer::slotQueueMail() |
262 | { | 262 | { |
263 | if (to->text().find(QRegExp(".*\\@.*\\..*")) == -1) { | 263 | if (to->text().find(QRegExp(".*\\@.*\\..*")) == -1) { |
264 | 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")); |
265 | return; | 265 | return; |
266 | } | 266 | } |
267 | 267 | ||
268 | Config cfg( "mailqueue", Config::User ); | 268 | Config cfg( "mailqueue", Config::User ); |
269 | 269 | ||
270 | cfg.setGroup( "Settings" ); | 270 | cfg.setGroup( "Settings" ); |
271 | int count = cfg.readNumEntry( "count", 0 ); | 271 | int count = cfg.readNumEntry( "count", 0 ); |
272 | count++; | 272 | count++; |
273 | cfg.writeEntry( "count", count ); | 273 | cfg.writeEntry( "count", count ); |
274 | qDebug("queueing mail %i",count); | 274 | qDebug("queueing mail %i",count); |
275 | 275 | ||