[Kde-bindings] [smokegen] generators/smoke: Apply a patch from Dimitar Dobrev:
Arno Rehn
arno at arnorehn.de
Thu Apr 5 18:45:30 UTC 2012
Git commit 4ae73f1fc2b7fffa0268330319b1969af49fdc31 by Arno Rehn.
Committed on 05/04/2012 at 20:43.
Pushed by arnorehn into branch 'master'.
Apply a patch from Dimitar Dobrev:
Save the parameter names of methods in external files
to be used by bindings.
CCMAIL: kde-bindings at kde.org
CCMAIL: dpldobrev at yahoo.com
M +18 -0 generators/smoke/writeSmokeDataFile.cpp
http://commits.kde.org/smokegen/4ae73f1fc2b7fffa0268330319b1969af49fdc31
diff --git a/generators/smoke/writeSmokeDataFile.cpp b/generators/smoke/writeSmokeDataFile.cpp
index 5ec084b..3c9bbf0 100644
--- a/generators/smoke/writeSmokeDataFile.cpp
+++ b/generators/smoke/writeSmokeDataFile.cpp
@@ -176,6 +176,9 @@ void SmokeDataFile::write()
QFile smokedata(Options::outputDir.filePath("smokedata.cpp"));
smokedata.open(QFile::ReadWrite | QFile::Truncate);
QTextStream out(&smokedata);
+ QFile argNames(Options::outputDir.filePath(QString("%1.argnames.txt").arg(Options::module)));
+ argNames.open(QFile::ReadWrite | QFile::Truncate);
+ QTextStream outArgNames(&argNames);
foreach (const QFileInfo& file, Options::headerList)
out << "#include <" << file.fileName() << ">\n";
out << "\n#include <smoke.h>\n";
@@ -406,6 +409,20 @@ void SmokeDataFile::write()
foreach (const Method& meth, klass->methods()) {
if (meth.access() == Access_private)
continue;
+ if (meth.parameters().size() > 0) {
+ outArgNames << klass->name() << "," << meth.name() << "," << meth.parameters().count() << ";";
+ for (int i = 0; i < meth.parameters().size(); i++) {
+ QString paramName = meth.parameters()[i].name();
+ if (paramName == "") {
+ paramName = "arg" + QString::number(i + 1);
+ }
+ outArgNames << paramName;
+ if (i < meth.parameters().size() - 1) {
+ outArgNames << ",";
+ }
+ }
+ outArgNames << "\n";
+ }
if (isExternal && !declaredVirtualMethods[klass].contains(&meth))
continue;
@@ -729,4 +746,5 @@ void SmokeDataFile::write()
out << "}\n";
smokedata.close();
+ argNames.close();
}
More information about the Kde-bindings
mailing list