a11y: Use desktop file name as app's accessible ID

As the QGuiApplication::desktopFileName doc [1] says:

> This is the file name, without the full path or the
> trailing ".desktop" extension of the desktop entry that
> represents this application according to the freedesktop
> desktop entry specification.

Since the desktop entry represents the application, also
use the desktop file name for the accessible ID of the
application object.

This e.g. makes Okular's application object report an
accessible ID of "org.kde.okular" instead of just "QApplication"
as the AT-SPI2 AccessibleId property on Linux.

[1] https://doc.qt.io/qt-6/qguiapplication.html#desktopFileName-prop

Change-Id: I554da7baaf817866db9044128f73a9ea634cddbf
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 13b4075093866a497e620bdd388afaf8aa0bc962)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Michael Weghorn 2024-08-29 11:27:02 +02:00 committed by Qt Cherry-pick Bot
parent 6a9ee6eb68
commit 8f5b06f977

View File

@ -182,6 +182,8 @@ QString QAccessibleApplication::text(QAccessible::Text t) const
return QGuiApplication::applicationName();
case QAccessible::Description:
return QGuiApplication::applicationFilePath();
case QAccessible::Identifier:
return QGuiApplication::desktopFileName();
default:
break;
}