Fix for issue 11 based on latest master

Signed-off-by: Emanoil Kotsev <deloptes@gmail.com>
pull/12/head
Emanoil Kotsev 5 years ago
parent 4e267fc57b
commit bc23ccded5

@ -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;

Loading…
Cancel
Save