[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdelibs/kdecore/kconfig_compiler
From:       Albert Astals Cid <tsdgeos () terra ! es>
Date:       2009-07-02 21:46:17
Message-ID: 1246571177.391083.13124.nullmailer () svn ! kde ! org
[Download RAW message or body]

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;
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic