From cc67ce39cdd7730caee878da3b191d76cad9479f Mon Sep 17 00:00:00 2001 From: zautrix Date: Sat, 03 Jul 2004 19:26:15 +0000 Subject: better error handling --- (limited to 'kmicromail/composemail.cpp') diff --git a/kmicromail/composemail.cpp b/kmicromail/composemail.cpp index 2c2e279..ca4f247 100644 --- a/kmicromail/composemail.cpp +++ b/kmicromail/composemail.cpp @@ -121,7 +121,7 @@ void ComposeMail::saveAsDraft() AttachViewItem *it = (AttachViewItem *) attList->firstChild(); /* attachments we will ignore! */ - if ( it != NULL ) { + if ( it != 0 ) { if ( warnAttach ) QMessageBox::warning(0,tr("Store message"), tr("
Attachments will not be stored in \"Draft\" folder
")); @@ -136,7 +136,7 @@ void ComposeMail::clearStatus() void ComposeMail::setStatus( QString status ) { topLevelWidget()->setCaption( status ); - QTimer::singleShot ( 5000, this, SLOT( clearStatus() ) ) ; + QTimer::singleShot ( 10000, this, SLOT( clearStatus() ) ) ; } void ComposeMail::pickAddress( QLineEdit *line ) { @@ -300,13 +300,19 @@ void ComposeMail::accept() } mail->setMessage( txt ); AttachViewItem *it = (AttachViewItem *) attList->firstChild(); - while ( it != NULL ) { + while ( it != 0 ) { mail->addAttachment( it->getAttachment() ); it = (AttachViewItem *) it->nextSibling(); } SMTPwrapper wrapper( smtp ); - wrapper.sendMail( mail,checkBoxLater->isChecked() ); + if ( wrapper.sendMail( mail,checkBoxLater->isChecked() ) ) + setStatus( tr ("Mail sent")); + else { + setStatus( tr ("Error: Something went wrong. Nothing sent")); + return; + } + QDialog::accept(); } -- cgit v0.9.0.2