From 5bf5159011abb1b04fc97b8f17da8af77cdd844c Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 9 Aug 2022 11:29:21 -0700 Subject: [PATCH] qdbusxml2cpp: be consistent in the annotation suggestion Some lines were suggesting the method name as context, while most of the others were the parameter or property name. Change-Id: Ie4bb662dcb274440ab8bfffd1709c0a71abc27dc Reviewed-by: David Faure (cherry picked from commit 478b1afbe1544a5c88d26d714ea6307cdcba3bb1) Reviewed-by: Qt Cherry-pick Bot --- src/tools/qdbusxml2cpp/qdbusxml2cpp.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/tools/qdbusxml2cpp/qdbusxml2cpp.cpp b/src/tools/qdbusxml2cpp/qdbusxml2cpp.cpp index 672242d6655..e3acefcdbea 100644 --- a/src/tools/qdbusxml2cpp/qdbusxml2cpp.cpp +++ b/src/tools/qdbusxml2cpp/qdbusxml2cpp.cpp @@ -564,7 +564,7 @@ static void writeProxy(const QString &filename, const QDBusIntrospection::Interf hs << "QDBusPendingReply<"; for (int i = 0; i < method.outputArgs.count(); ++i) hs << (i > 0 ? ", " : "") - << templateArg(qtTypeName(method.name, method.outputArgs.at(i).type, + << templateArg(qtTypeName(method.outputArgs.at(i).name, method.outputArgs.at(i).type, method.annotations, i, "Out")); hs << "> "; } @@ -598,7 +598,7 @@ static void writeProxy(const QString &filename, const QDBusIntrospection::Interf if (method.outputArgs.count() > 1) { // generate the old-form QDBusReply methods with multiple incoming parameters hs << " inline " << (isDeprecated ? "Q_DECL_DEPRECATED " : "") << "QDBusReply<" - << templateArg(qtTypeName(method.name, method.outputArgs.first().type, + << templateArg(qtTypeName(method.outputArgs.first().name, method.outputArgs.first().type, method.annotations, 0, "Out")) << "> "; hs << method.name << "("; @@ -628,7 +628,7 @@ static void writeProxy(const QString &filename, const QDBusIntrospection::Interf // yes, starting from 1 for (int i = 1; i < method.outputArgs.count(); ++i) hs << " " << argNames.at(argPos++) << " = qdbus_cast<" - << templateArg(qtTypeName(method.name, method.outputArgs.at(i).type, + << templateArg(qtTypeName(method.outputArgs.at(i).name, method.outputArgs.at(i).type, method.annotations, i, "Out")) << ">(reply.arguments().at(" << i << "));" << Qt::endl; hs << " }" << Qt::endl @@ -899,7 +899,7 @@ static void writeAdaptor(const QString &filename, const QDBusIntrospection::Inte hs << "void "; cs << "void "; } else { - returnType = qtTypeName(method.name, method.outputArgs.first().type, + returnType = qtTypeName(method.outputArgs.first().name, method.outputArgs.first().type, method.annotations, 0, "Out"); hs << returnType << " "; cs << returnType << " "; @@ -935,13 +935,13 @@ static void writeAdaptor(const QString &filename, const QDBusIntrospection::Inte if (!method.outputArgs.isEmpty()) cs << ", Q_RETURN_ARG(" - << qtTypeName(method.name, method.outputArgs.at(0).type, method.annotations, + << qtTypeName(method.outputArgs.at(0).name, method.outputArgs.at(0).type, method.annotations, 0, "Out") << ", " << argNames.at(method.inputArgs.count()) << ")"; for (int i = 0; i < method.inputArgs.count(); ++i) cs << ", Q_ARG(" - << qtTypeName(method.name, method.inputArgs.at(i).type, method.annotations, + << qtTypeName(method.inputArgs.at(i).name, method.inputArgs.at(i).type, method.annotations, i, "In") << ", " << argNames.at(i) << ")";