SVN commit 428650 by mteijeiro: * append a "\n" when the sieve script doesn't ends on "\n" * Emit a result signal on a sievejob error. Now, on a uploading script failure, the slot is catched, and show the script window again. M +5 -1 managesievescriptsdialog.cpp M +2 -0 sievejob.cpp --- trunk/KDE/kdepim/kmail/managesievescriptsdialog.cpp #428649:428650 @@ -319,7 +319,11 @@ void KMail::ManageSieveScriptsDialog::slotSieveEditorOkClicked() { if ( !mSieveEditor ) return; - SieveJob * job = SieveJob::put( mCurrentURL, mSieveEditor->script(), mWasActive, mWasActive ); + QString script = mSieveEditor->script(); + //assert the scripts ends with new line + if ( !script.endsWith( "\n" ) ) + script.append( "\n" ); + SieveJob * job = SieveJob::put( mCurrentURL, script, mWasActive, mWasActive ); connect( job, SIGNAL(result(KMail::SieveJob*,bool,const QString&,bool)), this, SLOT(slotPutResult(KMail::SieveJob*,bool)) ); } --- trunk/KDE/kdepim/kmail/sievejob.cpp #428649:428650 @@ -191,6 +191,8 @@ if ( job->error() ) { job->showErrorDialog( 0 ); + emit result( this, false, mScript, mUrl.fileName() == mActiveScriptName ); + if ( lastCmd == List ) emit gotList( this, false, mAvailableScripts, mActiveScriptName ); else