From 9935d3d33633369dc762c4e8497756c45f035193 Mon Sep 17 00:00:00 2001 From: Montel Laurent Date: Mon, 17 Dec 2012 15:18:25 +0100 Subject: [PATCH] Finish job when user canceled dialogbox or agent is not valid. Bug found by david --- createnewcontactjob.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/createnewcontactjob.cpp b/createnewcontactjob.cpp index 6cbf3b0f2..d12c88533 100644 --- a/createnewcontactjob.cpp +++ b/createnewcontactjob.cpp @@ -85,9 +85,17 @@ void CreateNewContactJob::slotCollectionsFetched(KJob*job) connect( job, SIGNAL(result(KJob*)), SLOT(slotResourceCreationDone(KJob*)) ); job->configure( mParentWidget ); job->start(); + return; + } else { //if agent is not valid => return error and finish job + setError( UserDefinedError ); + emitResult(); + return; } + } else { //dialog canceled => return error and finish job + setError( UserDefinedError ); + emitResult(); + return; } - return; } createContact(); emitResult();