summaryrefslogtreecommitdiffstats
path: root/src/tools
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2022-08-09 11:13:05 -0700
committerThiago Macieira <thiago.macieira@intel.com>2022-08-16 16:05:25 -0700
commite163c4943593aec7f69c2bbaf49a0020d806d23d (patch)
tree35f6c6ac647a0fbf57a1b482574270259370d939 /src/tools
parent478b1afbe1544a5c88d26d714ea6307cdcba3bb1 (diff)
qdbusxml2cpp: remove the old "In"-for-signal compatibility code
This led to an infinite recursion in case the annotation was completely missing. Instead of trying to fix that, I'm simply implementing the "### Qt6" request from c62f71722639c39f210ddbec0c4d832521b3f187 . [ChangeLog][qdbusxml2cpp] Removed the old compatibility code that accepted "In" annotations for signal argument names, introduced in Qt 5.8. Pick-to: 6.4 Fixes: QTBUG-104722 Change-Id: Ie4bb662dcb274440ab8bfffd1709bfc3daf0846d Reviewed-by: David Faure <david.faure@kdab.com>
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/qdbusxml2cpp/qdbusxml2cpp.cpp24
1 files changed, 8 insertions, 16 deletions
diff --git a/src/tools/qdbusxml2cpp/qdbusxml2cpp.cpp b/src/tools/qdbusxml2cpp/qdbusxml2cpp.cpp
index ccfd3f3990..c79baf66d6 100644
--- a/src/tools/qdbusxml2cpp/qdbusxml2cpp.cpp
+++ b/src/tools/qdbusxml2cpp/qdbusxml2cpp.cpp
@@ -175,12 +175,9 @@ static QString classNameForInterface(const QString &interface, ClassType classTy
return retval;
}
-// ### Qt6 Remove the two isSignal ifs
-// They are only here because before signal arguments where previously searched as "In" so to maintain compatibility
-// we first search for "Out" and if not found we search for "In"
static QByteArray qtTypeName(const QString &where, const QString &signature,
const QDBusIntrospection::Annotations &annotations, qsizetype paramId = -1,
- const char *direction = "Out", bool isSignal = false)
+ const char *direction = "Out")
{
int type = QDBusMetaType::signatureToMetaType(signature.toLatin1()).id();
if (type == QMetaType::UnknownType) {
@@ -197,17 +194,12 @@ static QByteArray qtTypeName(const QString &where, const QString &signature,
qttype = annotations.value(oldAnnotationName);
if (qttype.isEmpty()) {
- if (!isSignal || qstrcmp(direction, "Out") == 0) {
- fprintf(stderr, "%s: Got unknown type `%s' processing '%s'\n",
- PROGRAMNAME, qPrintable(signature), qPrintable(inputFile));
- fprintf(stderr,
- "You should add <annotation name=\"%s\" value=\"<type>\"/> to the XML "
- "description for '%s'\n",
- qPrintable(annotationName), qPrintable(where));
- }
-
- if (isSignal)
- return qtTypeName(where, signature, annotations, paramId, "In", isSignal);
+ fprintf(stderr, "%s: Got unknown type `%s' processing '%s'\n",
+ PROGRAMNAME, qPrintable(signature), qPrintable(inputFile));
+ fprintf(stderr,
+ "You should add <annotation name=\"%s\" value=\"<type>\"/> to the XML "
+ "description for '%s'\n",
+ qPrintable(annotationName), qPrintable(where));
exit(1);
}
@@ -318,7 +310,7 @@ static void writeSignalArgList(QTextStream &ts, const QStringList &argNames,
for (qsizetype i = 0; i < outputArgs.size(); ++i) {
const QDBusIntrospection::Argument &arg = outputArgs.at(i);
QString type = constRefArg(
- qtTypeName(arg.name, arg.type, annotations, i, "Out", true /* isSignal */));
+ qtTypeName(arg.name, arg.type, annotations, i, "Out"));
if (!first)
ts << ", ";