summaryrefslogtreecommitdiffabout
path: root/kmicromail/composemail.cpp
Side-by-side diff
Diffstat (limited to 'kmicromail/composemail.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kmicromail/composemail.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/kmicromail/composemail.cpp b/kmicromail/composemail.cpp
index 2c2e279..ca4f247 100644
--- a/kmicromail/composemail.cpp
+++ b/kmicromail/composemail.cpp
@@ -120,9 +120,9 @@ void ComposeMail::saveAsDraft()
wrapper.storeMail(mail);
AttachViewItem *it = (AttachViewItem *) attList->firstChild();
/* attachments we will ignore! */
- if ( it != NULL ) {
+ if ( it != 0 ) {
if ( warnAttach )
QMessageBox::warning(0,tr("Store message"),
tr("<center>Attachments will not be stored in \"Draft\" folder</center>"));
warnAttach = false;
@@ -135,9 +135,9 @@ 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 )
{
//qDebug(" ComposeMail::pickAddress ");
@@ -299,15 +299,21 @@ void ComposeMail::accept()
txt.append( sigMultiLine->text() );
}
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();
}