From kde-commits Thu Jul 02 21:46:17 2009 From: Albert Astals Cid Date: Thu, 02 Jul 2009 21:46:17 +0000 To: kde-commits Subject: KDE/kdelibs/kdecore/kconfig_compiler Message-Id: <1246571177.391083.13124.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=124657120107748 SVN commit 990647 by aacid: kconfig_compiler does some advanced stuff like having parametrized entries, support them this makes kdelibs test compile sorry for being such a lame devel M +13 -3 kconfig_compiler.cpp --- trunk/KDE/kdelibs/kdecore/kconfig_compiler/kconfig_compiler.cpp #990646:990647 @@ -1161,7 +1161,11 @@ QString result = e->code(); QTextStream out(&result, QIODevice::WriteOnly); - out << " return " << e->defaultValue() << ";" << endl; + if (!e->param().isEmpty()) { + out << " return " << e->defaultValue().replace("[$("+e->param()+")]", "[i]") << ";"; + } else { + out << " return " << e->defaultValue() << ";"; + } return result; } @@ -1617,7 +1621,10 @@ h << enumType(*itEntry); else h << cppType(t); - h << " " << getDefaultFunction(n) << "()" << Const; + h << " " << getDefaultFunction(n) << "("; + if ( !(*itEntry)->param().isEmpty() ) + h << " " << cppType( (*itEntry)->paramType() ) <<" i "; + h << ")" << Const; // function body inline only if not using dpointer // for BC mode if ( !dpointer ) @@ -2101,7 +2108,10 @@ cpp << enumType(*itEntry); else cpp << cppType(t); - cpp << " " << getDefaultFunction(n, className) << "()" << Const; + cpp << " " << getDefaultFunction(n, className) << "("; + if ( !(*itEntry)->param().isEmpty() ) + cpp << " " << cppType( (*itEntry)->paramType() ) <<" i "; + cpp << ")" << Const << endl; cpp << endl << "{" << endl; cpp << memberGetDefaultBody(*itEntry); cpp << "}" << endl << endl;