author | conber <conber> | 2002-06-15 20:53:53 (UTC) |
---|---|---|
committer | conber <conber> | 2002-06-15 20:53:53 (UTC) |
commit | be10ba352f2a89bc5ec816eefc307a4ae2f7ff6b (patch) (unidiff) | |
tree | 414e77447b8f8d6baeef6588a009cb65e1353c0b | |
parent | e23774336087439cfed07899c8446eab674a3de8 (diff) | |
download | opie-be10ba352f2a89bc5ec816eefc307a4ae2f7ff6b.zip opie-be10ba352f2a89bc5ec816eefc307a4ae2f7ff6b.tar.gz opie-be10ba352f2a89bc5ec816eefc307a4ae2f7ff6b.tar.bz2 |
fixed abort bug
-rw-r--r-- | noncore/unsupported/mail2/composer.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/noncore/unsupported/mail2/composer.cpp b/noncore/unsupported/mail2/composer.cpp index 03d50b6..57f0779 100644 --- a/noncore/unsupported/mail2/composer.cpp +++ b/noncore/unsupported/mail2/composer.cpp | |||
@@ -91,64 +91,65 @@ void Composer::slotSendMail() | |||
91 | return; | 91 | return; |
92 | } | 92 | } |
93 | 93 | ||
94 | SendMail smail; | 94 | SendMail smail; |
95 | smail.setFrom(from->currentText()); | 95 | smail.setFrom(from->currentText()); |
96 | smail.setReplyTo(replyto->text()); | 96 | smail.setReplyTo(replyto->text()); |
97 | smail.setTo(to->text()); | 97 | smail.setTo(to->text()); |
98 | smail.setCc(cc->text()); | 98 | smail.setCc(cc->text()); |
99 | smail.setBcc(bcc->text()); | 99 | smail.setBcc(bcc->text()); |
100 | smail.setSubject(subject->text()); | 100 | smail.setSubject(subject->text()); |
101 | smail.setMessage(message->text()); | 101 | smail.setMessage(message->text()); |
102 | smail.setNeedsMime(attachView->childCount() == 0 ? false : true); | 102 | smail.setNeedsMime(attachView->childCount() == 0 ? false : true); |
103 | smail.setAccount(accountsLoaded[from->currentItem()]); | 103 | smail.setAccount(accountsLoaded[from->currentItem()]); |
104 | 104 | ||
105 | if (priority->currentItem() == POPUP_PRIO_LOW) { | 105 | if (priority->currentItem() == POPUP_PRIO_LOW) { |
106 | smail.setPriority("Low");// No i18n on purpose | 106 | smail.setPriority("Low");// No i18n on purpose |
107 | } else if (priority->currentItem() == POPUP_PRIO_NORMAL) { | 107 | } else if (priority->currentItem() == POPUP_PRIO_NORMAL) { |
108 | smail.setPriority("Normal");// No i18n on purpose | 108 | smail.setPriority("Normal");// No i18n on purpose |
109 | } else if (priority->currentItem() == POPUP_PRIO_HIGH) { | 109 | } else if (priority->currentItem() == POPUP_PRIO_HIGH) { |
110 | smail.setPriority("High");// No i18n on purpose | 110 | smail.setPriority("High");// No i18n on purpose |
111 | } | 111 | } |
112 | 112 | ||
113 | QValueList<Attachment> attachments; | 113 | QValueList<Attachment> attachments; |
114 | QListViewItem *item; | 114 | QListViewItem *item; |
115 | for (item = attachView->firstChild(); item != 0; item = item->itemBelow()) { | 115 | for (item = attachView->firstChild(); item != 0; item = item->itemBelow()) { |
116 | attachments.append(((AttachViewItem *)item)->attachment()); | 116 | attachments.append(((AttachViewItem *)item)->attachment()); |
117 | } | 117 | } |
118 | 118 | ||
119 | smail.setAttachments(attachments); | 119 | smail.setAttachments(attachments); |
120 | 120 | ||
121 | QString header, message; | 121 | QString header, message; |
122 | MailFactory::genMail(header, message, smail, this); | 122 | MailFactory::genMail(header, message, smail, this); |
123 | if (header.isNull() || message.isNull()) return;// Aborted. | ||
123 | 124 | ||
124 | abort->setEnabled(true); | 125 | abort->setEnabled(true); |
125 | 126 | ||
126 | SmtpHandler *handler = new SmtpHandler(header, message, accountsLoaded[from->currentItem()], to->text()); | 127 | SmtpHandler *handler = new SmtpHandler(header, message, accountsLoaded[from->currentItem()], to->text()); |
127 | connect(handler, SIGNAL(finished()), SLOT(slotSendFinished())); | 128 | connect(handler, SIGNAL(finished()), SLOT(slotSendFinished())); |
128 | connect(handler, SIGNAL(error(const QString &)), SLOT(slotSendError(const QString &))); | 129 | connect(handler, SIGNAL(error(const QString &)), SLOT(slotSendError(const QString &))); |
129 | connect(handler, SIGNAL(status(const QString &)), status, SLOT(setText(const QString &))); | 130 | connect(handler, SIGNAL(status(const QString &)), status, SLOT(setText(const QString &))); |
130 | } | 131 | } |
131 | 132 | ||
132 | void Composer::slotSendError(const QString &error) | 133 | void Composer::slotSendError(const QString &error) |
133 | { | 134 | { |
134 | status->setText(tr("<font color=#ff0000>Error occoured during sending.</font>")); | 135 | status->setText(tr("<font color=#ff0000>Error occoured during sending.</font>")); |
135 | QMessageBox::warning(this, tr("Error"), tr("<p>%1</p").arg(error), tr("Ok")); | 136 | QMessageBox::warning(this, tr("Error"), tr("<p>%1</p").arg(error), tr("Ok")); |
136 | } | 137 | } |
137 | 138 | ||
138 | void Composer::slotSendFinished() | 139 | void Composer::slotSendFinished() |
139 | { | 140 | { |
140 | QMessageBox::information(this, tr("Success"), tr("<p>The mail was sent successfully.</p>"), tr("Ok")); | 141 | QMessageBox::information(this, tr("Success"), tr("<p>The mail was sent successfully.</p>"), tr("Ok")); |
141 | 142 | ||
142 | status->setText(QString(0)); | 143 | status->setText(QString(0)); |
143 | abort->setEnabled(false); | 144 | abort->setEnabled(false); |
144 | } | 145 | } |
145 | 146 | ||
146 | void Composer::slotFillStuff() | 147 | void Composer::slotFillStuff() |
147 | { | 148 | { |
148 | QValueList<Account> accounts = ConfigFile::getAccounts(); | 149 | QValueList<Account> accounts = ConfigFile::getAccounts(); |
149 | int i = 0; | 150 | int i = 0; |
150 | 151 | ||
151 | QValueList<Account>::Iterator it; | 152 | QValueList<Account>::Iterator it; |
152 | for (it = accounts.begin(); it != accounts.end(); it++) { | 153 | for (it = accounts.begin(); it != accounts.end(); it++) { |
153 | if (!(*it).email().isEmpty() && !(*it).smtpServer().isEmpty() && !(*it).smtpPort().isEmpty()) { | 154 | if (!(*it).email().isEmpty() && !(*it).smtpServer().isEmpty() && !(*it).smtpPort().isEmpty()) { |
154 | if (!(*it).realName().isEmpty()) | 155 | if (!(*it).realName().isEmpty()) |