From ee593cdde639872f3b3c1f0ff59ee3982002064e Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 31 Jul 2023 07:54:52 -0700 Subject: [PATCH] QDBusXmlParser: downgrade property name mismatches to warnings This has happened before: there's a disagreement on whether property names need to be identifiers or not. In Qt, we insist they are, and if this code had been around before, other specifications from other teams in freedesktop.org and gnome.org would have adhered to this rule. But it wasn't, so such properties exist (see [1]). Commit bcc93850fc73689bdd796b19f98cca525636a0fd converted the check that had bene here all along as a proper error for qdbusxml2cpp. So downgrade it a warning and move on. An alternative implementation would keep on going and install this property with the invalid name, but qdbusxml2cpp and other generators may want to ignore such property names later on. I'm not implementing this in a bug fix (or at all). [1] https://fprint.freedesktop.org/fprintd-dev/Device.html Fixes: QTBUG-115596 Task-number: QTBUG-2597 Pick-to: 6.6 Change-Id: Ifbf974a4d10745b099b1fffd1776fb8cc9239125 Reviewed-by: Ievgenii Meshcheriakov --- src/dbus/qdbusxmlparser.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/dbus/qdbusxmlparser.cpp b/src/dbus/qdbusxmlparser.cpp index 7636ba365ad..c2e8df8be7e 100644 --- a/src/dbus/qdbusxmlparser.cpp +++ b/src/dbus/qdbusxmlparser.cpp @@ -96,9 +96,9 @@ bool QDBusXmlParser::parseProperty(QDBusIntrospection::Property &propertyData) QXmlStreamAttributes attributes = m_xml.attributes(); const QString propertyName = attributes.value("name"_L1).toString(); if (!QDBusUtil::isValidMemberName(propertyName)) { - qDBusParserError("Invalid D-Bus member name '%s' found in interface '%s' while parsing " - "introspection", - qPrintable(propertyName), qPrintable(m_currentInterface->name)); + qDBusParserWarning("Invalid D-Bus member name '%s' found in interface '%s' while parsing " + "introspection", + qPrintable(propertyName), qPrintable(m_currentInterface->name)); m_xml.skipCurrentElement(); return false; }