qdbus: add call GetConnectionCredentials interface

[ChangeLog][QtDBus][QDBusConnectionInterface] Added method serviceCredentials().
See <https://dbus.freedesktop.org/doc/dbus-specification.html>
section: 'Method: org.freedesktop.DBus.GetConnectionCredentials' for more information.

Change-Id: If37687a35278fde8b0afc33eb19f9fa6b8dbe200
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 5ee2737d916af7e444cae88209d9f0bd4d29e7ea)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Li Changze 2025-06-03 13:16:44 +08:00 committed by Qt Cherry-pick Bot
parent 0b69f2f7ab
commit 2fb5bd9669
2 changed files with 17 additions and 0 deletions

View File

@ -206,6 +206,21 @@ QDBusReply<uint> QDBusConnectionInterface::serviceUid(const QString &serviceName
QList<QVariant>() << serviceName);
}
/*!
\since 6.10
Returns the connection credentials for the process currently holding
the bus service \a serviceName.
See <https://dbus.freedesktop.org/doc/dbus-specification.html>
section: 'Method: org.freedesktop.DBus.GetConnectionCredentials' for more information.
*/
QDBusReply<QVariantMap> QDBusConnectionInterface::serviceCredentials(const QString &serviceName) const
{
return internalConstCall(QDBus::AutoDetect, "GetConnectionCredentials"_L1,
QList<QVariant>() << serviceName);
}
/*!
Requests that the bus start the service given by the name \a name.
*/

View File

@ -66,6 +66,8 @@ public Q_SLOTS:
QDBusReply<uint> servicePid(const QString &serviceName) const;
QDBusReply<uint> serviceUid(const QString &serviceName) const;
QDBusReply<QVariantMap> serviceCredentials(const QString &serviceName) const;
QDBusReply<void> startService(const QString &name);
Q_SIGNALS: