Refactoring "Replace Nested Conditional with Guard Clauses"
authorAndrey Paskal <apaskal@gmail.com>
Thu, 24 Dec 2009 16:17:23 +0000 (19:17 +0300)
committerAndrey Paskal <apaskal@gmail.com>
Sun, 27 Dec 2009 10:00:37 +0000 (13:00 +0300)
src/plugins/engine.cpp

index 220154e..cf4cc8e 100644 (file)
@@ -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);
 }