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 bcc93850fc 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 <ievgenii.meshcheriakov@qt.io>
This commit is contained in:
Thiago Macieira 2023-07-31 07:54:52 -07:00
parent ec3d09bd9c
commit ee593cdde6

View File

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