summaryrefslogtreecommitdiff
authoralwin <alwin>2004-03-12 11:22:54 (UTC)
committer alwin <alwin>2004-03-12 11:22:54 (UTC)
commit6e37f7d804b100579c11fc77fcc99326ad98a9c7 (patch) (unidiff)
treecb92522221a566df3b030ae25f0550a92803f46c
parenta1ddbd219fcee196172f3fd684afac467e5f2469 (diff)
downloadopie-6e37f7d804b100579c11fc77fcc99326ad98a9c7.zip
opie-6e37f7d804b100579c11fc77fcc99326ad98a9c7.tar.gz
opie-6e37f7d804b100579c11fc77fcc99326ad98a9c7.tar.bz2
start usage of smart-pointer
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/composemail.cpp43
1 files changed, 21 insertions, 22 deletions
diff --git a/noncore/net/mail/composemail.cpp b/noncore/net/mail/composemail.cpp
index b9c9cbc..445cc5e 100644
--- a/noncore/net/mail/composemail.cpp
+++ b/noncore/net/mail/composemail.cpp
@@ -188,38 +188,37 @@ void ComposeMail::accept()
188 qDebug( "Sending Mail with " + 188 qDebug( "Sending Mail with " +
189 smtpAccounts.at( smtpAccountBox->currentItem() )->getAccountName() ); 189 smtpAccounts.at( smtpAccountBox->currentItem() )->getAccountName() );
190#endif 190#endif
191 Mail mail; 191 Opie::osmart_pointer<Mail> mail=new Mail;
192 192
193 SMTPaccount *smtp = smtpAccounts.at( smtpAccountBox->currentItem() ); 193 SMTPaccount *smtp = smtpAccounts.at( smtpAccountBox->currentItem() );
194 mail.setMail(fromBox->currentText()); 194 mail->setMail(fromBox->currentText());
195 195
196 if ( !toLine->text().isEmpty() ) { 196 if ( !toLine->text().isEmpty() ) {
197 mail.setTo( toLine->text() ); 197 mail->setTo( toLine->text() );
198 } else { 198 } else {
199 QMessageBox::warning(0,tr("Sending mail"), 199 QMessageBox::warning(0,tr("Sending mail"),
200 tr("No Receiver spezified" ) ); 200 tr("No Receiver spezified" ) );
201 return; 201 return;
202 } 202 }
203 mail.setName(senderNameEdit->text()); 203 mail->setName(senderNameEdit->text());
204 mail.setCC( ccLine->text() ); 204 mail->setCC( ccLine->text() );
205 mail.setBCC( bccLine->text() ); 205 mail->setBCC( bccLine->text() );
206 mail.setReply( replyLine->text() ); 206 mail->setReply( replyLine->text() );
207 mail.setSubject( subjectLine->text() ); 207 mail->setSubject( subjectLine->text() );
208 if (!m_replyid.isEmpty()) { 208 if (!m_replyid.isEmpty()) {
209 QStringList ids; 209 QStringList ids;
210 ids.append(m_replyid); 210 ids.append(m_replyid);
211 mail.setInreply(ids); 211 mail->setInreply(ids);
212 } 212 }
213 QString txt = message->text(); 213 QString txt = message->text();
214 if ( !sigMultiLine->text().isEmpty() ) { 214 if ( !sigMultiLine->text().isEmpty() ) {
215 txt.append( "\n--\n" ); 215 txt.append( "\n--\n" );
216 txt.append( sigMultiLine->text() ); 216 txt.append( sigMultiLine->text() );
217 } 217 }
218 qDebug(txt); 218 mail->setMessage( txt );
219 mail.setMessage( txt );
220 AttachViewItem *it = (AttachViewItem *) attList->firstChild(); 219 AttachViewItem *it = (AttachViewItem *) attList->firstChild();
221 while ( it != NULL ) { 220 while ( it != NULL ) {
222 mail.addAttachment( it->getAttachment() ); 221 mail->addAttachment( it->getAttachment() );
223 it = (AttachViewItem *) it->nextSibling(); 222 it = (AttachViewItem *) it->nextSibling();
224 } 223 }
225 224
@@ -237,18 +236,18 @@ void ComposeMail::reject()
237 tr("No"),QString::null,0,1); 236 tr("No"),QString::null,0,1);
238 237
239 if (yesno == 0) { 238 if (yesno == 0) {
240 Mail mail; 239 Opie::osmart_pointer<Mail> mail=new Mail();
241 mail.setMail(fromBox->currentText()); 240 mail->setMail(fromBox->currentText());
242 mail.setTo( toLine->text() ); 241 mail->setTo( toLine->text() );
243 mail.setName(senderNameEdit->text()); 242 mail->setName(senderNameEdit->text());
244 mail.setCC( ccLine->text() ); 243 mail->setCC( ccLine->text() );
245 mail.setBCC( bccLine->text() ); 244 mail->setBCC( bccLine->text() );
246 mail.setReply( replyLine->text() ); 245 mail->setReply( replyLine->text() );
247 mail.setSubject( subjectLine->text() ); 246 mail->setSubject( subjectLine->text() );
248 if (!m_replyid.isEmpty()) { 247 if (!m_replyid.isEmpty()) {
249 QStringList ids; 248 QStringList ids;
250 ids.append(m_replyid); 249 ids.append(m_replyid);
251 mail.setInreply(ids); 250 mail->setInreply(ids);
252 } 251 }
253 QString txt = message->text(); 252 QString txt = message->text();
254 if ( !sigMultiLine->text().isEmpty() ) { 253 if ( !sigMultiLine->text().isEmpty() ) {
@@ -256,7 +255,7 @@ void ComposeMail::reject()
256 txt.append( sigMultiLine->text() ); 255 txt.append( sigMultiLine->text() );
257 } 256 }
258 qDebug(txt); 257 qDebug(txt);
259 mail.setMessage( txt ); 258 mail->setMessage( txt );
260 259
261 /* only use the default drafts folder name! */ 260 /* only use the default drafts folder name! */
262 Storemail wrapper(AbstractMail::draftFolder()); 261 Storemail wrapper(AbstractMail::draftFolder());