diff options
author | Michael Albinus <michael.albinus@gmx.de> | 2020-09-21 13:41:30 +0200 |
---|---|---|
committer | Michael Albinus <michael.albinus@gmx.de> | 2020-09-21 13:41:30 +0200 |
commit | 63f9d9af81a2758bfb3699ce223d9cbf891257d6 (patch) | |
tree | cbc9dd6e1103dc8425ab4dd78ad5e0a6f3b5e749 /lisp/net/dbus.el | |
parent | 81aed7becfdc66af464e54c90680e9507693bdaf (diff) | |
download | emacs-63f9d9af81a2758bfb3699ce223d9cbf891257d6.tar.gz |
Add D-Bus tests
* doc/misc/dbus.texi (Type Conversion): Precise basic type values.
* lisp/net/dbus.el (dbus-register-property): Send signal directly.
* src/dbusbind.c (xd_signature): Accept non-nil objects for
DBUS_TYPE_BOOLEAN.
* test/lisp/net/dbus-tests.el (dbus-test01-basic-types)
(dbus-test01-compound-types): New tests.
Diffstat (limited to 'lisp/net/dbus.el')
-rw-r--r-- | lisp/net/dbus.el | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/lisp/net/dbus.el b/lisp/net/dbus.el index 458ee81d70f..86db7cbf18a 100644 --- a/lisp/net/dbus.el +++ b/lisp/net/dbus.el @@ -1660,6 +1660,19 @@ clients from discovering the still incomplete interface. (unless (or dont-register-service (member service (dbus-list-names bus))) (dbus-register-service bus service)) + ;; Send the PropertiesChanged signal. + (when emits-signal + (dbus-send-signal + bus service path dbus-interface-properties "PropertiesChanged" + ;; changed_properties. + (if (eq access :write) + '(:array: :signature "{sv}") + `(:array (:dict-entry ,property ,value))) + ;; invalidated_properties. + (if (eq access :write) + `(:array ,property) + '(:array)))) + ;; Create a hash table entry. We use nil for the unique name, ;; because the property might be accessed from anybody. (let ((key (list :property bus interface property)) @@ -1670,14 +1683,6 @@ clients from discovering the still incomplete interface. bus service path interface property)))) (puthash key val dbus-registered-objects-table) - ;; Set or Get the property, in order to validate the property's - ;; value and to send the PropertiesChanged signal. - (when (member service (dbus-list-names bus)) - (if (eq access :read) - (dbus-get-property bus service path interface property) - (apply - #'dbus-set-property bus service path interface property (cdr value)))) - ;; Return the object. (list key (list service path))))) |