diff options
author | David Edmundson <davidedmundson@kde.org> | 2018-04-06 01:27:32 +0100 |
---|---|---|
committer | David Faure <david.faure@kdab.com> | 2018-11-06 09:52:09 +0000 |
commit | d761c6278305ef8737daca4bc3e61a119b40e107 (patch) | |
tree | a046ea21152c5182884a58074a4c3af66b5f9e34 /src/dbus/qdbusservicewatcher.cpp | |
parent | fc88dd52a42da682cbd360916be7c9f94a69b72c (diff) |
QDBusServiceWatcher namespace prefix support
This allows a user to efficiently watch for services with a common
domain prefix.
This is exposed in the API via a wildcard character in the service name.
For example creating a watcher on "org.mpris*" will match
"org.mpris.foo" "org.mpris.bar" and "org.mpris" itself. It will not
match org.mprisasdf.
Internally the argument match rules have been expanded from a single
QStringList to a struct containing args and arg0namespace. This was done
so that we can easily use argpath in match rules in the future.
Change-Id: I55882ab603cc6ba478e8c0ea9a6800f6e483a50c
Reviewed-by: Kai Uwe Broulik <kde@privat.broulik.de>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: David Faure <david.faure@kdab.com>
Diffstat (limited to 'src/dbus/qdbusservicewatcher.cpp')
-rw-r--r-- | src/dbus/qdbusservicewatcher.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/dbus/qdbusservicewatcher.cpp b/src/dbus/qdbusservicewatcher.cpp index 0c2fb9118f..b0bfe7254d 100644 --- a/src/dbus/qdbusservicewatcher.cpp +++ b/src/dbus/qdbusservicewatcher.cpp @@ -139,6 +139,17 @@ void QDBusServiceWatcherPrivate::removeService(const QString &service) QDBusConnectionInterface::serviceOwnerChanged() signal because it allows one to receive only the signals for which the class is interested in. + Ending a service name with the character '*' will match all service names + within the specified namespace. + + For example "com.example.backend1*" will match + \list + \li com.example.backend1 + \li com.example.backend1.foo + \li com.example.backend1.foo.bar + \endlist + Substrings in the same domain will not be matched, i.e "com.example.backend12". + \sa QDBusConnection */ |