summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmanoil Kotsev <deloptes@gmail.com>2019-06-28 16:20:01 +0000
committerEmanoil Kotsev <deloptes@gmail.com>2019-06-28 16:20:01 +0000
commitbc23ccded57d2b4cfd9eefedca7e3c1e12d7e7ca (patch)
tree546e680b08c87e3c7228620762ce84eef4a3f820
parent4e267fc57b58cb68c13d25da39cde08664b7c257 (diff)
downloaddbus-1-tqt-bc23ccde.tar.gz
dbus-1-tqt-bc23ccde.zip
Fix for issue 11 based on latest master
Signed-off-by: Emanoil Kotsev <deloptes@gmail.com>
-rw-r--r--src/tools/dbusxml2qt3/methodgen.cpp24
1 files changed, 19 insertions, 5 deletions
diff --git a/src/tools/dbusxml2qt3/methodgen.cpp b/src/tools/dbusxml2qt3/methodgen.cpp
index 89c3677..882c1cd 100644
--- a/src/tools/dbusxml2qt3/methodgen.cpp
+++ b/src/tools/dbusxml2qt3/methodgen.cpp
@@ -457,7 +457,6 @@ static void writeMethodIntrospection(const Method& method, bool& firstArgument,
if (firstArgument)
{
firstArgument = false;
-
stream << " TQDomElement argumentElement = document.createElement("
<< "\"arg\");" << endl;
}
@@ -537,6 +536,7 @@ static void writeNodeInitialization(const Class& classData,
stream << "}" << endl;
stream << endl;
}
+
static void writeNodeIntrospection(const Class& classData,
const TQValueList<Class>& interfaces, TQTextStream& stream)
{
@@ -607,10 +607,6 @@ bool MethodGenerator::extractMethods(const TQDomElement& interfaceElement,
method.noReply = false;
method.async = hasAnnotation(element, "org.freedesktop.DBus.GLib.Async");
classData.methods.append(method);
- if (method.async) {
- method.async = false;
- classData.methods.append(method);
- }
}
else if (element.tagName() == "signal")
{
@@ -1680,6 +1676,7 @@ void MethodGenerator::writeIntrospectionDataMethod(const Class& classData,
bool firstMethod = true;
bool firstArgument = true;
+ bool firstAsync = true;
TQValueList<Method>::const_iterator it = classData.methods.begin();
TQValueList<Method>::const_iterator endIt = classData.methods.end();
@@ -1699,6 +1696,23 @@ void MethodGenerator::writeIntrospectionDataMethod(const Class& classData,
<< "\"method\");" << endl;
}
+ if ((*it).async)
+ {
+ if (firstAsync) {
+ firstAsync=false;
+ stream << " TQDomElement asyncAnnotationElement = document.createElement("
+ << "\"annotation\");" << endl;
+ }
+ else
+ {
+ stream << " asyncAnnotationElement = document.createElement("
+ << "\"annotation\");" << endl;
+ }
+ stream << " asyncAnnotationElement.setAttribute(\"name\", "
+ << "\"org.freedesktop.DBus.GLib.Async\");" << endl;
+ stream << " methodElement.appendChild(asyncAnnotationElement);" << endl;
+ }
+
writeMethodIntrospection(*it, firstArgument, stream);
stream << " interfaceElement.appendChild(methodElement);" << endl;