From: Andrey Paskal Date: Thu, 24 Dec 2009 16:17:23 +0000 (+0300) Subject: Refactoring "Replace Nested Conditional with Guard Clauses" X-Git-Url: https://gitweb.ananas.su/?a=commitdiff_plain;h=0a85c5b9fe3fbeceb4465e184be49d8963b3b1ee;p=projects%2Fananas-labs-qt4.git Refactoring "Replace Nested Conditional with Guard Clauses" --- diff --git a/src/plugins/engine.cpp b/src/plugins/engine.cpp index 220154e..cf4cc8e 100644 --- a/src/plugins/engine.cpp +++ b/src/plugins/engine.cpp @@ -696,18 +696,12 @@ aEngine::OpenForm(QString fname, int mode, aObject* selecter)//Q_ULLONG ido) aCfgItem object, form; form = md->find(fname); - if(!form.isNull()) - { - object = md->parent(md->parent(form)); - if(object.isNull()) return 0; - qulonglong ido =0; - if(selecter) ido = selecter->sysValue("id").toULongLong(); - return openForm(atoi(md->attr(object,mda_id)), atoi(md->attr(form,mda_id)), mode, mode, ido); - } - else - { - return 0; - } + if(form.isNull()) return 0; + object = md->parent(md->parent(form)); + if(object.isNull()) return 0; + qulonglong ido =0; + if(selecter) ido = selecter->sysValue("id").toULongLong(); + return openForm(atoi(md->attr(object,mda_id)), atoi(md->attr(form,mda_id)), mode, mode, ido); }