From 45bdbff13b383dd99f9019a3d6dda6fcda6a3b11 Mon Sep 17 00:00:00 2001 From: Emanoil Kotsev Date: Tue, 26 May 2020 22:42:52 +0200 Subject: [PATCH] Fix #23 dbusxml2qt3 with multiple interfaces Signed-off-by: Emanoil Kotsev --- src/tools/dbusxml2qt3/methodgen.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/tools/dbusxml2qt3/methodgen.cpp b/src/tools/dbusxml2qt3/methodgen.cpp index f86f762..48cf704 100644 --- a/src/tools/dbusxml2qt3/methodgen.cpp +++ b/src/tools/dbusxml2qt3/methodgen.cpp @@ -553,6 +553,7 @@ static void writeNodeIntrospection(const Class& classData, stream << "{" << endl; stream << " TQDomDocument doc;" << endl; + stream << " TQDomElement interfaceElement;" << endl; stream << " TQDomElement nodeElement = doc.createElement(\"node\");" << endl; stream << " if (!objectPath.isEmpty() && objectPath.compare(\"/\") != 0)" << endl; stream << " {" << endl; @@ -560,7 +561,7 @@ static void writeNodeIntrospection(const Class& classData, stream << " }" << endl; stream << " // Introspectable is added by default. Show it only if there is interface" << endl; stream << " if (interfaces.count()>1) {" << endl; - stream << " TQDomElement interfaceElement = doc.createElement(\"interface\");" + stream << " interfaceElement = doc.createElement(\"interface\");" << endl; stream << " org::freedesktop::DBus::IntrospectableInterface" << "::buildIntrospectionData(interfaceElement);" << endl; @@ -574,7 +575,7 @@ static void writeNodeIntrospection(const Class& classData, if ((*it).dbusName == "org.freedesktop.DBus.Introspectable") continue; stream << endl; - stream << " TQDomElement interfaceElement = doc.createElement(\"interface\");" + stream << " interfaceElement = doc.createElement(\"interface\");" << endl; stream << " " << (*it).namespaces.join("::") + "::" + (*it).name << "Interface::buildIntrospectionData(interfaceElement);" << endl;