Add ability to obtain error messages from async calls

pull/2/head
Timothy Pearson 12 years ago
parent 796df5ebfc
commit 6d564efb42

@ -243,6 +243,8 @@ static void writeHeaderIncludes(const Class& classData, Class::Role role,
break; break;
} }
includes["tqdbus"].insertString("<tqdbuserror.h>");
if (!includes["TQt"].isEmpty()) if (!includes["TQt"].isEmpty())
writeIncludes("TQt", includes["TQt"].keys(), stream); writeIncludes("TQt", includes["TQt"].keys(), stream);
@ -663,6 +665,7 @@ static void writeSignalDeclarations(const Class& classData, Class::Role role,
case Class::Proxy: case Class::Proxy:
stream << "signals:" << endl; stream << "signals:" << endl;
stream << " void AsyncErrorResponseDetected(int asyncCallId, const TQT_DBusError error);" << endl << endl;
prefix = " void "; prefix = " void ";
break; break;

@ -1576,7 +1576,11 @@ void MethodGenerator::writeProxyAsyncReplyHandler(const Class& classData,
// FIXME tricking writeVariables and writeSignalEmit into writing // FIXME tricking writeVariables and writeSignalEmit into writing
// the reply emit code by manipulating arguments and name // the reply emit code by manipulating arguments and name
stream << " int _asyncCallId = asyncCallId;" << endl; stream << " int _asyncCallId = asyncCallId;" << endl << endl;
stream << " if (message.type() == TQT_DBusMessage::ErrorMessage) {" << endl;
stream << " emit AsyncErrorResponseDetected(_asyncCallId, message.error());" << endl;
stream << " }" << endl << endl;
Method signal = *it; Method signal = *it;
signal.arguments.pop_front(); signal.arguments.pop_front();

Loading…
Cancel
Save