summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKent Hansen <khansen@trolltech.com>2009-03-19 16:33:25 +0100
committerKent Hansen <khansen@trolltech.com>2009-03-19 16:33:25 +0100
commit47f99bd19e499568dd6f811718da1e812ee1ddbf (patch)
tree75802aec01276314104a589b5b83c09494bbfe4c
parent1ff84cc76c56097a73c66bc9e40ae3417fbf1300 (diff)
Fixes: separate bindings init function from plugin class
Details: makes it easy to statically compile the bindings into an application without requiring a plugin; just include the generated .pri file in your .pro file, then call e.g. qtscript_initialize_com_trolltech_qt_gui_bindings()
-rw-r--r--generator/prigenerator.cpp2
-rw-r--r--generator/setupgenerator.cpp430
-rw-r--r--qtbindings/qtscript_core/qtscript_core.pro2
-rw-r--r--qtbindings/qtscript_gui/qtscript_gui.pro2
-rw-r--r--qtbindings/qtscript_network/qtscript_network.pro2
-rw-r--r--qtbindings/qtscript_opengl/qtscript_opengl.pro2
-rw-r--r--qtbindings/qtscript_phonon/qtscript_phonon.pro2
-rw-r--r--qtbindings/qtscript_sql/qtscript_sql.pro2
-rw-r--r--qtbindings/qtscript_svg/qtscript_svg.pro2
-rw-r--r--qtbindings/qtscript_uitools/qtscript_uitools.pro2
-rw-r--r--qtbindings/qtscript_webkit/qtscript_webkit.pro2
-rw-r--r--qtbindings/qtscript_xml/qtscript_xml.pro2
-rw-r--r--qtbindings/qtscript_xmlpatterns/qtscript_xmlpatterns.pro2
13 files changed, 236 insertions, 218 deletions
diff --git a/generator/prigenerator.cpp b/generator/prigenerator.cpp
index 68a8808..5b787d6 100644
--- a/generator/prigenerator.cpp
+++ b/generator/prigenerator.cpp
@@ -58,7 +58,7 @@ void PriGenerator::generate()
foreach (const QString &entry, list) {
file.stream << " $$PWD/" << entry << " \\\n";
}
- file.stream << "\n\n";
+ file.stream << " $$PWD/init.cpp\n";
if (file.done())
++m_num_generated_written;
diff --git a/generator/setupgenerator.cpp b/generator/setupgenerator.cpp
index 622d071..c07601e 100644
--- a/generator/setupgenerator.cpp
+++ b/generator/setupgenerator.cpp
@@ -34,19 +34,6 @@ void SetupGenerator::addClass(const AbstractMetaClass *cls)
void writeQtScriptQtBindingsLicense(QTextStream &stream);
-static void writeIncludes(QTextStream &stream)
-{
- stream << "#include <QtScript/QScriptExtensionPlugin>" << endl
- << "#include <QtScript/QScriptValue>" << endl
- << "#include <QtScript/QScriptEngine>" << endl;
-#ifdef Q_SCRIPT_LAZY_GENERATOR
- stream << "#include <QtScript/QScriptClass>" << endl
- << "#include <QtScript/QScriptString>" << endl;
-#endif
- stream << "#include <QtCore/QDebug>" << endl;
-}
-
-void writeInclude(QTextStream &stream, const Include &inc);
void maybeDeclareMetaType(QTextStream &stream, const QString &typeName,
QSet<QString> &registeredTypeNames);
bool hasDefaultConstructor(const AbstractMetaClass *meta_class);
@@ -69,231 +56,262 @@ void SetupGenerator::generate()
components.removeAt(0);
}
packName.replace(".", "_");
- FileOut file(m_out_dir + "/generated_cpp/" + packName + "/main.cpp");
- QTextStream &s = file.stream;
- if (FileOut::license)
- writeQtScriptQtBindingsLicense(s);
+ {
+ FileOut initFile(m_out_dir + "/generated_cpp/" + packName + "/init.cpp");
+ QTextStream &s = initFile.stream;
- writeIncludes(s);
- s << endl;
- foreach (const AbstractMetaClass *cls, list)
- writeInclude(s, cls->typeEntry()->include());
- s << endl;
+ if (FileOut::license)
+ writeQtScriptQtBindingsLicense(s);
- // declare individual class creation functions
- foreach (const AbstractMetaClass *cls, list) {
- s << "QScriptValue qtscript_create_" << cls->name() << "_class(QScriptEngine *engine);" << endl;
- }
- s << endl;
+ s << "#include <QtScript/QScriptValue>" << endl
+ << "#include <QtScript/QScriptEngine>" << endl;
+#ifdef Q_SCRIPT_LAZY_GENERATOR
+ s << "#include <QtScript/QScriptClass>" << endl
+ << "#include <QtScript/QScriptString>" << endl;
+#endif
+ s << endl;
- // write table of class names
- {
- s << "static const char * const qtscript_" << packName << "_class_names[] = {" << endl;
- bool needComma = false;
+ // declare individual class creation functions
foreach (const AbstractMetaClass *cls, list) {
- s << " ";
- if (needComma)
- s << ", ";
- s << "\"" << cls->name() << "\"" << endl;
- needComma = true;
+ s << "QScriptValue qtscript_create_" << cls->name() << "_class(QScriptEngine *engine);" << endl;
}
- s << "};" << endl << endl;
- }
+ s << endl;
- // write table of function pointers
- {
- s << "typedef QScriptValue (*QtBindingCreator)(QScriptEngine *engine);" << endl;
- s << "static const QtBindingCreator qtscript_" << packName << "_class_functions[] = {" << endl;
- bool needComma = false;
- foreach (const AbstractMetaClass *cls, list) {
- s << " ";
- if (needComma)
- s << ", ";
- s << "qtscript_create_" << cls->name() << "_class" << endl;
- needComma = true;
+ // write table of class names
+ {
+ s << "static const char * const qtscript_" << packName << "_class_names[] = {" << endl;
+ bool needComma = false;
+ foreach (const AbstractMetaClass *cls, list) {
+ s << " ";
+ if (needComma)
+ s << ", ";
+ s << "\"" << cls->name() << "\"" << endl;
+ needComma = true;
+ }
+ s << "};" << endl << endl;
}
- s << "};" << endl << endl;
- }
-#ifdef Q_SCRIPT_LAZY_GENERATOR
- {
- // declare meta-types
- QSet<QString> registeredTypeNames = m_qmetatype_declared_typenames;
- foreach (const AbstractMetaClass *cls, list) {
- if (cls->isNamespace())
- continue;
- QString name = cls->qualifiedCppName();
- if (cls->typeEntry()->isValue() && ::hasDefaultConstructor(cls))
- maybeDeclareMetaType(s, name, registeredTypeNames);
- maybeDeclareMetaType(s, name + "*", registeredTypeNames);
+ // write table of function pointers
+ {
+ s << "typedef QScriptValue (*QtBindingCreator)(QScriptEngine *engine);" << endl;
+ s << "static const QtBindingCreator qtscript_" << packName << "_class_functions[] = {" << endl;
+ bool needComma = false;
+ foreach (const AbstractMetaClass *cls, list) {
+ s << " ";
+ if (needComma)
+ s << ", ";
+ s << "qtscript_create_" << cls->name() << "_class" << endl;
+ needComma = true;
+ }
+ s << "};" << endl << endl;
}
- s << endl;
- // write table of metatype-ids
- s << "static const int qtscript_" << packName << "_metatype_ids[] = {" << endl;
- for (int i = 0; i < list.size(); ++i) {
- const AbstractMetaClass *cls = list.at(i);
- s << " ";
- if (i > 0)
- s << ", ";
- if (cls->isNamespace()) {
- s << "-1, -1";
- } else {
+
+#ifdef Q_SCRIPT_LAZY_GENERATOR
+ {
+ // declare meta-types
+ QSet<QString> registeredTypeNames = m_qmetatype_declared_typenames;
+ foreach (const AbstractMetaClass *cls, list) {
+ if (cls->isNamespace())
+ continue;
QString name = cls->qualifiedCppName();
if (cls->typeEntry()->isValue() && ::hasDefaultConstructor(cls))
- s << "qMetaTypeId<" << name << ">()";
- else
- s << "-1";
- s << ", qMetaTypeId<" << name << "*>()";
+ maybeDeclareMetaType(s, name, registeredTypeNames);
+ maybeDeclareMetaType(s, name + "*", registeredTypeNames);
}
s << endl;
+ // write table of metatype-ids
+ s << "static const int qtscript_" << packName << "_metatype_ids[] = {" << endl;
+ for (int i = 0; i < list.size(); ++i) {
+ const AbstractMetaClass *cls = list.at(i);
+ s << " ";
+ if (i > 0)
+ s << ", ";
+ if (cls->isNamespace()) {
+ s << "-1, -1";
+ } else {
+ QString name = cls->qualifiedCppName();
+ if (cls->typeEntry()->isValue() && ::hasDefaultConstructor(cls))
+ s << "qMetaTypeId<" << name << ">()";
+ else
+ s << "-1";
+ s << ", qMetaTypeId<" << name << "*>()";
+ }
+ s << endl;
+ }
+ s << "};" << endl << endl;
}
- s << "};" << endl << endl;
- }
- // write the fake prototype class
- {
- s << "class qtscript_" << packName << "_FakePrototype : public QScriptClass" << endl
- << "{" << endl
- << "public:" << endl
- << " qtscript_" << packName << "_FakePrototype(QScriptEngine *engine)" << endl
- << " : QScriptClass(engine) {}" << endl << endl
+ // write the fake prototype class
+ {
+ s << "class qtscript_" << packName << "_FakePrototype : public QScriptClass" << endl
+ << "{" << endl
+ << "public:" << endl
+ << " qtscript_" << packName << "_FakePrototype(QScriptEngine *engine)" << endl
+ << " : QScriptClass(engine) {}" << endl << endl
- << " QueryFlags queryProperty(const QScriptValue &fake," << endl
- << " const QScriptString &name, QueryFlags flags, uint *)" << endl
- << " {" << endl
- << " if (fake.prototype().isValid())" << endl
- << " return 0;" << endl
- << " int classIndex = fake.data().toInt32();" << endl
- << " const char *className = qtscript_" << packName << "_class_names[classIndex];" << endl
+ << " QueryFlags queryProperty(const QScriptValue &fake," << endl
+ << " const QScriptString &name, QueryFlags flags, uint *)" << endl
+ << " {" << endl
+ << " if (fake.prototype().isValid())" << endl
+ << " return 0;" << endl
+ << " int classIndex = fake.data().toInt32();" << endl
+ << " const char *className = qtscript_" << packName << "_class_names[classIndex];" << endl
// << " qDebug() << \"faking\" << className;" << endl
- << " QScriptValue extensionObject = engine()->globalObject();" << endl
- << " QScriptValue ctor = extensionObject.property(className);" << endl
- << " QScriptValue genuine = ctor.property(\"prototype\");" << endl
- << " Q_ASSERT(genuine.isObject());" << endl
- << " const_cast<QScriptValue&>(fake).setPrototype(genuine);" << endl
- << " if (!genuine.property(name).isValid())" << endl
- << " flags &= ~HandlesReadAccess;" << endl
- << " return flags & ~HandlesWriteAccess;" << endl
- << " }" << endl << endl
+ << " QScriptValue extensionObject = engine()->globalObject();" << endl
+ << " QScriptValue ctor = extensionObject.property(className);" << endl
+ << " QScriptValue genuine = ctor.property(\"prototype\");" << endl
+ << " Q_ASSERT(genuine.isObject());" << endl
+ << " const_cast<QScriptValue&>(fake).setPrototype(genuine);" << endl
+ << " if (!genuine.property(name).isValid())" << endl
+ << " flags &= ~HandlesReadAccess;" << endl
+ << " return flags & ~HandlesWriteAccess;" << endl
+ << " }" << endl << endl
- << " QScriptValue property(const QScriptValue &fake, "
- << "const QScriptString &name, uint)" << endl
- << " {" << endl
- << " return fake.prototype().property(name, QScriptValue::ResolveLocal);" << endl
- << " }" << endl
- << "};" << endl << endl;
- }
+ << " QScriptValue property(const QScriptValue &fake, "
+ << "const QScriptString &name, uint)" << endl
+ << " {" << endl
+ << " return fake.prototype().property(name, QScriptValue::ResolveLocal);" << endl
+ << " }" << endl
+ << "};" << endl << endl;
+ }
- // write the lazy class loader
- {
- s << "static QScriptValue qtscript_" << packName << "_getSetClass("
- << "QScriptContext *context, QScriptEngine *engine)" << endl
+ // write the lazy class loader
+ {
+ s << "static QScriptValue qtscript_" << packName << "_getSetClass("
+ << "QScriptContext *context, QScriptEngine *engine)" << endl
+ << "{" << endl
+ << " QScriptValue target = context->thisObject();" << endl
+ << " int classIndex = context->callee().data().toInt32();" << endl
+ << " const char *className = qtscript_" << packName << "_class_names[classIndex];" << endl
+ << " qDebug() << \"loading\" << className;" << endl
+ << " target.setProperty(className, QScriptValue(), "
+ << "QScriptValue::PropertyGetter|QScriptValue::PropertySetter);" << endl
+ << " if (context->argumentCount() == 1) {" << endl
+ << " target.setProperty(className, context->argument(0));" << endl
+ << " } else {" << endl
+ << " target.setProperty(className, qtscript_"
+ << packName << "_class_functions[classIndex](engine)," << endl
+ << " QScriptValue::SkipInEnumeration);" << endl
+ << " }" << endl
+ << " return target.property(className);" << endl
+ << "}" << endl << endl;
+ }
+#endif
+
+ // bindings init function
+ s << "void qtscript_initialize_" << packName << "_bindings(QScriptValue &extensionObject)" << endl
<< "{" << endl
- << " QScriptValue target = context->thisObject();" << endl
- << " int classIndex = context->callee().data().toInt32();" << endl
- << " const char *className = qtscript_" << packName << "_class_names[classIndex];" << endl
- << " qDebug() << \"loading\" << className;" << endl
- << " target.setProperty(className, QScriptValue(), "
- << "QScriptValue::PropertyGetter|QScriptValue::PropertySetter);" << endl
- << " if (context->argumentCount() == 1) {" << endl
- << " target.setProperty(className, context->argument(0));" << endl
- << " } else {" << endl
- << " target.setProperty(className, qtscript_"
- << packName << "_class_functions[classIndex](engine)," << endl
+ << " QScriptEngine *engine = extensionObject.engine();" << endl;
+#ifdef Q_SCRIPT_LAZY_GENERATOR
+ s << " qtscript_" << packName << "_FakePrototype *fakeProtoClass;" << endl
+ << " fakeProtoClass = new qtscript_" << packName << "_FakePrototype(engine);" << endl;
+#endif
+ s << " for (int i = 0; i < " << list.size() << "; ++i) {" << endl
+#ifndef Q_SCRIPT_LAZY_GENERATOR
+ << " extensionObject.setProperty(qtscript_" << packName << "_class_names[i]," << endl
+ << " qtscript_" << packName << "_class_functions[i](engine)," << endl
<< " QScriptValue::SkipInEnumeration);" << endl
- << " }" << endl
- << " return target.property(className);" << endl
- << "}" << endl << endl;
- }
+#else
+ << " QScriptValue classIndex(engine, i);" << endl
+ << " QScriptValue fakeCtor = engine->newFunction(qtscript_" << packName << "_getSetClass);" << endl
+ << " fakeCtor.setData(classIndex);" << endl
+ << " extensionObject.setProperty(qtscript_" << packName << "_class_names[i]," << endl
+ << " fakeCtor, QScriptValue::PropertyGetter|QScriptValue::PropertySetter"
+ << "|QScriptValue::SkipInEnumeration);" << endl
+ << " QScriptValue fakeProto = engine->newObject(fakeProtoClass, classIndex);" << endl
+ << " fakeProto.setPrototype(QScriptValue());" << endl
+ << " if (qtscript_" << packName << "_metatype_ids[i*2] != -1)" << endl
+ << " engine->setDefaultPrototype(qtscript_"
+ << packName << "_metatype_ids[i*2], fakeProto);" << endl
+ << " if (qtscript_" << packName << "_metatype_ids[i*2+1] != -1)" << endl
+ << " engine->setDefaultPrototype(qtscript_"
+ << packName << "_metatype_ids[i*2+1], fakeProto);" << endl
#endif
+ << " }" << endl
+ << "}" << endl;
- // plugin class declaration
- s << "class " << packName << "_ScriptPlugin : public QScriptExtensionPlugin" << endl
- << "{" << endl
- << "public:" << endl
- << " QStringList keys() const;" << endl
- << " void initialize(const QString &key, QScriptEngine *engine);" << endl
- << "};" << endl
- << "" << endl;
+ if (initFile.done())
+ ++m_num_generated_written;
+ ++m_num_generated;
+ }
- // keys()
- s << "QStringList " << packName << "_ScriptPlugin::keys() const" << endl
- << "{" << endl
- << " QStringList list;" << endl;
{
- QString key;
- for (int i = 0; i < components.size(); ++i) {
- if (i > 0)
- key.append(".");
- key.append(components.at(i));
- s << " list << QLatin1String(\"" << key << "\");" << endl;
+ FileOut pluginFile(m_out_dir + "/generated_cpp/" + packName + "/plugin.cpp");
+ QTextStream &s = pluginFile.stream;
+
+ if (FileOut::license)
+ writeQtScriptQtBindingsLicense(s);
+
+ s << "#include <QtScript/QScriptExtensionPlugin>" << endl
+ << "#include <QtScript/QScriptValue>" << endl
+ << "#include <QtScript/QScriptEngine>" << endl << endl;
+
+ // declare the init function
+ s << "void qtscript_initialize_" << packName << "_bindings(QScriptValue &);" << endl << endl;
+
+ // plugin class declaration
+ s << "class " << packName << "_ScriptPlugin : public QScriptExtensionPlugin" << endl
+ << "{" << endl
+ << "public:" << endl
+ << " QStringList keys() const;" << endl
+ << " void initialize(const QString &key, QScriptEngine *engine);" << endl
+ << "};" << endl
+ << "" << endl;
+
+ // keys()
+ s << "QStringList " << packName << "_ScriptPlugin::keys() const" << endl
+ << "{" << endl
+ << " QStringList list;" << endl;
+ {
+ QString key;
+ for (int i = 0; i < components.size(); ++i) {
+ if (i > 0)
+ key.append(".");
+ key.append(components.at(i));
+ s << " list << QLatin1String(\"" << key << "\");" << endl;
+ }
}
- }
- s << " return list;" << endl
- << "}" << endl;
+ s << " return list;" << endl
+ << "}" << endl;
- // initialize()
- s << endl
- << "void " << packName << "_ScriptPlugin::initialize(const QString &key, QScriptEngine *engine)" << endl
- << "{";
- {
- QString key;
- for (int i = 0; i < components.size(); ++i) {
- s << endl << " ";
- if (i > 0) {
- key.append(".");
- s << "} else ";
+ // initialize()
+ s << endl
+ << "void " << packName << "_ScriptPlugin::initialize(const QString &key, QScriptEngine *engine)" << endl
+ << "{";
+ {
+ QString key;
+ for (int i = 0; i < components.size(); ++i) {
+ s << endl << " ";
+ if (i > 0) {
+ key.append(".");
+ s << "} else ";
+ }
+ key.append(components.at(i));
+ s << "if (key == QLatin1String(\"" << key << "\")) {";
}
- key.append(components.at(i));
- s << "if (key == QLatin1String(\"" << key << "\")) {";
}
- }
- s << endl << " QScriptValue extensionObject = ";
- // ### generalize
- if (packName == "com.trolltech.qt.phonon")
- s << "setupPackage(\"phonon\", engine)";
- else
- s << "engine->globalObject()";
- s << ";" << endl;
+ s << endl << " QScriptValue extensionObject = ";
+ // ### generalize
+ if (packName == "com.trolltech.qt.phonon")
+ s << "setupPackage(\"phonon\", engine)";
+ else
+ s << "engine->globalObject()";
+ s << ";" << endl;
-#ifdef Q_SCRIPT_LAZY_GENERATOR
- s << " qtscript_" << packName << "_FakePrototype *fakeProtoClass;" << endl
- << " fakeProtoClass = new qtscript_" << packName << "_FakePrototype(engine);" << endl;
-#endif
- s << " for (int i = 0; i < " << list.size() << "; ++i) {" << endl
-#ifndef Q_SCRIPT_LAZY_GENERATOR
- << " extensionObject.setProperty(qtscript_" << packName << "_class_names[i]," << endl
- << " qtscript_" << packName << "_class_functions[i](engine)," << endl
- << " QScriptValue::SkipInEnumeration);" << endl
-#else
- << " QScriptValue classIndex(engine, i);" << endl
- << " QScriptValue fakeCtor = engine->newFunction(qtscript_" << packName << "_getSetClass);" << endl
- << " fakeCtor.setData(classIndex);" << endl
- << " extensionObject.setProperty(qtscript_" << packName << "_class_names[i]," << endl
- << " fakeCtor, QScriptValue::PropertyGetter|QScriptValue::PropertySetter"
- << "|QScriptValue::SkipInEnumeration);" << endl
- << " QScriptValue fakeProto = engine->newObject(fakeProtoClass, classIndex);" << endl
- << " fakeProto.setPrototype(QScriptValue());" << endl
- << " if (qtscript_" << packName << "_metatype_ids[i*2] != -1)" << endl
- << " engine->setDefaultPrototype(qtscript_"
- << packName << "_metatype_ids[i*2], fakeProto);" << endl
- << " if (qtscript_" << packName << "_metatype_ids[i*2+1] != -1)" << endl
- << " engine->setDefaultPrototype(qtscript_"
- << packName << "_metatype_ids[i*2+1], fakeProto);" << endl
-#endif
- << " }" << endl;
+ s << " qtscript_initialize_" << packName << "_bindings(extensionObject);" << endl;
- s << " } else {" << endl
- << " Q_ASSERT_X(false, \"" << packName << "::initialize\", qPrintable(key));" << endl
- << " }" << endl
- << "}" << endl;
+ s << " } else {" << endl
+ << " Q_ASSERT_X(false, \"" << packName << "::initialize\", qPrintable(key));" << endl
+ << " }" << endl
+ << "}" << endl << endl;
- s << "Q_EXPORT_STATIC_PLUGIN(" << packName << "_ScriptPlugin)" << endl
- << "Q_EXPORT_PLUGIN2(qtscript_" << packName.toLower() << ", " << packName << "_ScriptPlugin)" << endl << endl;
-
- if (file.done())
- ++m_num_generated_written;
- ++m_num_generated;
+ s << "Q_EXPORT_STATIC_PLUGIN(" << packName << "_ScriptPlugin)" << endl
+ << "Q_EXPORT_PLUGIN2(qtscript_" << packName.toLower() << ", " << packName << "_ScriptPlugin)" << endl;
+
+ if (pluginFile.done())
+ ++m_num_generated_written;
+ ++m_num_generated;
+ }
}
}
diff --git a/qtbindings/qtscript_core/qtscript_core.pro b/qtbindings/qtscript_core/qtscript_core.pro
index 0ed8e3a..2dced76 100644
--- a/qtbindings/qtscript_core/qtscript_core.pro
+++ b/qtbindings/qtscript_core/qtscript_core.pro
@@ -1,4 +1,4 @@
TARGET = qtscript_core
include(../qtbindingsbase.pri)
-SOURCES += $$GENERATEDCPP/com_trolltech_qt_core/main.cpp
+SOURCES += $$GENERATEDCPP/com_trolltech_qt_core/plugin.cpp
include($$GENERATEDCPP/com_trolltech_qt_core/com_trolltech_qt_core.pri)
diff --git a/qtbindings/qtscript_gui/qtscript_gui.pro b/qtbindings/qtscript_gui/qtscript_gui.pro
index 5936046..f3ab584 100644
--- a/qtbindings/qtscript_gui/qtscript_gui.pro
+++ b/qtbindings/qtscript_gui/qtscript_gui.pro
@@ -1,4 +1,4 @@
TARGET = qtscript_gui
include(../qtbindingsbase.pri)
-SOURCES += $$GENERATEDCPP/com_trolltech_qt_gui/main.cpp
+SOURCES += $$GENERATEDCPP/com_trolltech_qt_gui/plugin.cpp
include($$GENERATEDCPP/com_trolltech_qt_gui/com_trolltech_qt_gui.pri)
diff --git a/qtbindings/qtscript_network/qtscript_network.pro b/qtbindings/qtscript_network/qtscript_network.pro
index 38d4908..072e538 100644
--- a/qtbindings/qtscript_network/qtscript_network.pro
+++ b/qtbindings/qtscript_network/qtscript_network.pro
@@ -2,5 +2,5 @@ TARGET = qtscript_network
include(../qtbindingsbase.pri)
QT -= gui
QT += network
-SOURCES += $$GENERATEDCPP/com_trolltech_qt_network/main.cpp
+SOURCES += $$GENERATEDCPP/com_trolltech_qt_network/plugin.cpp
include($$GENERATEDCPP/com_trolltech_qt_network/com_trolltech_qt_network.pri)
diff --git a/qtbindings/qtscript_opengl/qtscript_opengl.pro b/qtbindings/qtscript_opengl/qtscript_opengl.pro
index 9ad5a11..f231f2f 100644
--- a/qtbindings/qtscript_opengl/qtscript_opengl.pro
+++ b/qtbindings/qtscript_opengl/qtscript_opengl.pro
@@ -1,5 +1,5 @@
TARGET = qtscript_opengl
include(../qtbindingsbase.pri)
QT += opengl
-SOURCES += $$GENERATEDCPP/com_trolltech_qt_opengl/main.cpp
+SOURCES += $$GENERATEDCPP/com_trolltech_qt_opengl/plugin.cpp
include($$GENERATEDCPP/com_trolltech_qt_opengl/com_trolltech_qt_opengl.pri)
diff --git a/qtbindings/qtscript_phonon/qtscript_phonon.pro b/qtbindings/qtscript_phonon/qtscript_phonon.pro
index 72015a5..34bdae2 100644
--- a/qtbindings/qtscript_phonon/qtscript_phonon.pro
+++ b/qtbindings/qtscript_phonon/qtscript_phonon.pro
@@ -1,5 +1,5 @@
TARGET = qtscript_phonon
include(../qtbindingsbase.pri)
QT += phonon
-SOURCES += $$GENERATEDCPP/com_trolltech_qt_phonon/main.cpp
+SOURCES += $$GENERATEDCPP/com_trolltech_qt_phonon/plugin.cpp
include($$GENERATEDCPP/com_trolltech_qt_phonon/com_trolltech_qt_phonon.pri)
diff --git a/qtbindings/qtscript_sql/qtscript_sql.pro b/qtbindings/qtscript_sql/qtscript_sql.pro
index 0c0782c..788c82f 100644
--- a/qtbindings/qtscript_sql/qtscript_sql.pro
+++ b/qtbindings/qtscript_sql/qtscript_sql.pro
@@ -2,5 +2,5 @@ TARGET = qtscript_sql
include(../qtbindingsbase.pri)
QT -= gui
QT += sql
-SOURCES += $$GENERATEDCPP/com_trolltech_qt_sql/main.cpp
+SOURCES += $$GENERATEDCPP/com_trolltech_qt_sql/plugin.cpp
include($$GENERATEDCPP/com_trolltech_qt_sql/com_trolltech_qt_sql.pri)
diff --git a/qtbindings/qtscript_svg/qtscript_svg.pro b/qtbindings/qtscript_svg/qtscript_svg.pro
index b4367f5..3aa7dcb 100644
--- a/qtbindings/qtscript_svg/qtscript_svg.pro
+++ b/qtbindings/qtscript_svg/qtscript_svg.pro
@@ -1,5 +1,5 @@
TARGET = qtscript_svg
include(../qtbindingsbase.pri)
QT += svg
-SOURCES += $$GENERATEDCPP/com_trolltech_qt_svg/main.cpp
+SOURCES += $$GENERATEDCPP/com_trolltech_qt_svg/plugin.cpp
include($$GENERATEDCPP/com_trolltech_qt_svg/com_trolltech_qt_svg.pri)
diff --git a/qtbindings/qtscript_uitools/qtscript_uitools.pro b/qtbindings/qtscript_uitools/qtscript_uitools.pro
index f09d223..2f48778 100644
--- a/qtbindings/qtscript_uitools/qtscript_uitools.pro
+++ b/qtbindings/qtscript_uitools/qtscript_uitools.pro
@@ -1,5 +1,5 @@
TARGET = qtscript_uitools
include(../qtbindingsbase.pri)
CONFIG += uitools
-SOURCES += $$GENERATEDCPP/com_trolltech_qt_uitools/main.cpp
+SOURCES += $$GENERATEDCPP/com_trolltech_qt_uitools/plugin.cpp
include($$GENERATEDCPP/com_trolltech_qt_uitools/com_trolltech_qt_uitools.pri)
diff --git a/qtbindings/qtscript_webkit/qtscript_webkit.pro b/qtbindings/qtscript_webkit/qtscript_webkit.pro
index 2b3f3b0..58bd913 100644
--- a/qtbindings/qtscript_webkit/qtscript_webkit.pro
+++ b/qtbindings/qtscript_webkit/qtscript_webkit.pro
@@ -1,5 +1,5 @@
TARGET = qtscript_webkit
include(../qtbindingsbase.pri)
QT += network webkit
-SOURCES += $$GENERATEDCPP/com_trolltech_qt_webkit/main.cpp
+SOURCES += $$GENERATEDCPP/com_trolltech_qt_webkit/plugin.cpp
include($$GENERATEDCPP/com_trolltech_qt_webkit/com_trolltech_qt_webkit.pri)
diff --git a/qtbindings/qtscript_xml/qtscript_xml.pro b/qtbindings/qtscript_xml/qtscript_xml.pro
index af99772..a4ab9c8 100644
--- a/qtbindings/qtscript_xml/qtscript_xml.pro
+++ b/qtbindings/qtscript_xml/qtscript_xml.pro
@@ -2,5 +2,5 @@ TARGET = qtscript_xml
include(../qtbindingsbase.pri)
QT -= gui
QT += xml
-SOURCES += $$GENERATEDCPP/com_trolltech_qt_xml/main.cpp
+SOURCES += $$GENERATEDCPP/com_trolltech_qt_xml/plugin.cpp
include($$GENERATEDCPP/com_trolltech_qt_xml/com_trolltech_qt_xml.pri)
diff --git a/qtbindings/qtscript_xmlpatterns/qtscript_xmlpatterns.pro b/qtbindings/qtscript_xmlpatterns/qtscript_xmlpatterns.pro
index ed98f5a..2255ef8 100644
--- a/qtbindings/qtscript_xmlpatterns/qtscript_xmlpatterns.pro
+++ b/qtbindings/qtscript_xmlpatterns/qtscript_xmlpatterns.pro
@@ -2,5 +2,5 @@ TARGET = qtscript_xmlpatterns
include(../qtbindingsbase.pri)
QT -= gui
QT += xmlpatterns network
-SOURCES += $$GENERATEDCPP/com_trolltech_qt_xmlpatterns/main.cpp
+SOURCES += $$GENERATEDCPP/com_trolltech_qt_xmlpatterns/plugin.cpp
include($$GENERATEDCPP/com_trolltech_qt_xmlpatterns/com_trolltech_qt_xmlpatterns.pri)