a11y atspi: Send D-Bus reply for "GetCaption" in expected format

Just like for the "GetSummary" case, the argument in the
reply for this AT-SPI table method needs to
be wrapped in a variant.

Fixes this warning from the output of the client side
using libatspi:

> (accerciser:181933): dbind-WARNING **: 11:50:36.394: atspi_dbus_get_property:
> expected a variant when fetching Caption from interface org.a11y.atspi.Table; got (so)

Fixes: QTBUG-105520
Change-Id: I18167359e4cd3bb14a94289ac7481f9e39a18ad0
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 7594e8ca4d91935400f065e138ff1e4b4f212478)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Michael Weghorn 2022-08-10 13:44:39 +02:00 committed by Qt Cherry-pick Bot
parent 0f7390e410
commit 37045f8efc

View File

@ -2237,10 +2237,10 @@ bool AtSpiAdaptor::tableInterface(QAccessibleInterface *interface, const QString
QAccessibleInterface * captionInterface= interface->tableInterface()->caption(); QAccessibleInterface * captionInterface= interface->tableInterface()->caption();
if (captionInterface) { if (captionInterface) {
QSpiObjectReference ref = QSpiObjectReference(connection, QDBusObjectPath(pathForInterface(captionInterface))); QSpiObjectReference ref = QSpiObjectReference(connection, QDBusObjectPath(pathForInterface(captionInterface)));
sendReply(connection, message, QVariant::fromValue(ref)); sendReply(connection, message, QVariant::fromValue(QDBusVariant(QVariant::fromValue(ref))));
} else { } else {
sendReply(connection, message, QVariant::fromValue( sendReply(connection, message, QVariant::fromValue(QDBusVariant(QVariant::fromValue(
QSpiObjectReference(connection, QDBusObjectPath(ATSPI_DBUS_PATH_NULL)))); QSpiObjectReference(connection, QDBusObjectPath(ATSPI_DBUS_PATH_NULL))))));
} }
} else if (function == "GetNColumns"_L1) { } else if (function == "GetNColumns"_L1) {
connection.send(message.createReply(QVariant::fromValue(QDBusVariant( connection.send(message.createReply(QVariant::fromValue(QDBusVariant(