diff --git a/src/tools/dbusxml2qt3/classgen.cpp b/src/tools/dbusxml2qt3/classgen.cpp index 7ca39a1..c410d45 100644 --- a/src/tools/dbusxml2qt3/classgen.cpp +++ b/src/tools/dbusxml2qt3/classgen.cpp @@ -365,15 +365,22 @@ static void writeSourceIncludes(const Class& classData, Class::Role role, } static void writeInterfaceIncludes(const TQValueList interfaces, - TQTextStream& stream) + const TQString& customInterfaceFilename, TQTextStream& stream) { stream << "// interface classes includes" << endl; - TQValueList::const_iterator it = interfaces.begin(); - TQValueList::const_iterator endIt = interfaces.end(); - for (; it != endIt; ++it) + if (!customInterfaceFilename.isNull()) + { + stream << "#include \"" << customInterfaceFilename << ".h\"" << endl; + } + else { - stream << "#include \"" << (*it).name.lower() << "Interface.h\"" << endl; + TQValueList::const_iterator it = interfaces.begin(); + TQValueList::const_iterator endIt = interfaces.end(); + for (; it != endIt; ++it) + { + stream << "#include \"" << (*it).name.lower() << "Interface.h\"" << endl; + } } stream << "#include \"introspectableInterface.h\"" << endl; @@ -1061,6 +1068,7 @@ bool ClassGenerator::generateProxy(const Class& classData, bool ClassGenerator::generateNode(const Class& classData, const TQValueList& interfaces, + const TQString& customInterfaceFilename, TQTextStream& headerStream, TQTextStream& sourceStream) { @@ -1075,7 +1083,7 @@ bool ClassGenerator::generateNode(const Class& classData, // create source writeSourceIncludes(classData, Class::Node, sourceStream); - writeInterfaceIncludes(interfaces, sourceStream); + writeInterfaceIncludes(interfaces, customInterfaceFilename, sourceStream); openNamespaces(classData.namespaces, sourceStream); diff --git a/src/tools/dbusxml2qt3/classgen.h b/src/tools/dbusxml2qt3/classgen.h index 1abb893..83559a2 100644 --- a/src/tools/dbusxml2qt3/classgen.h +++ b/src/tools/dbusxml2qt3/classgen.h @@ -46,6 +46,7 @@ public: TQTextStream& headerStream, TQTextStream& sourceStream); static bool generateNode(const Class& classData, const TQValueList& interfaces, + const TQString& customInterfaceFilename, TQTextStream& headerStream, TQTextStream& sourceStream); static bool generateIncludeMoc(const TQString& baseName, TQTextStream& sourceStream); }; diff --git a/src/tools/dbusxml2qt3/main.cpp b/src/tools/dbusxml2qt3/main.cpp index 0f19dc5..763c998 100644 --- a/src/tools/dbusxml2qt3/main.cpp +++ b/src/tools/dbusxml2qt3/main.cpp @@ -139,6 +139,7 @@ int main(int argc, char** argv) // if no specific option is selected, we generate everything bool generateAll = !(generateProxies || generateInterfaces || generateNode); + TQString customInterfaceFilename = TQString::null; if (checkForOption(options, "classname")) { @@ -183,6 +184,7 @@ int main(int argc, char** argv) TQTextStream sourceStream; TQString baseName = options["interface"]; + customInterfaceFilename = baseName; if (!baseName.isEmpty()) { if (!ClassGenerator::initStreams(baseName, headerStream, sourceStream)) @@ -376,7 +378,7 @@ int main(int argc, char** argv) exit(4); } - ClassGenerator::generateNode(classData, interfaces, + ClassGenerator::generateNode(classData, interfaces, customInterfaceFilename, headerStream, sourceStream); ClassGenerator::finishStreams(baseName, headerStream, sourceStream);