summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlf Jasper <ulf.jasper@web.de>2020-09-02 19:59:57 +0200
committerUlf Jasper <ulf.jasper@web.de>2020-09-02 19:59:57 +0200
commit5aa5c0372dc3cccf2676d26a17b4d5f71caf8cdc (patch)
tree7aa85be9c34c3114fa5b29c253931951e1bcf6d7
parentc5e8254b9c89ac866df057fa3acd2dc44e3989ae (diff)
parent1457e84f4468f4a5f2de8c182596225cb1355afa (diff)
downloademacs-5aa5c0372dc3cccf2676d26a17b4d5f71caf8cdc.tar.gz
emacs-5aa5c0372dc3cccf2676d26a17b4d5f71caf8cdc.tar.bz2
emacs-5aa5c0372dc3cccf2676d26a17b4d5f71caf8cdc.zip
Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs
-rw-r--r--lisp/net/dbus.el26
1 files changed, 18 insertions, 8 deletions
diff --git a/lisp/net/dbus.el b/lisp/net/dbus.el
index fdd726ff613..971d3e730ed 100644
--- a/lisp/net/dbus.el
+++ b/lisp/net/dbus.el
@@ -1484,15 +1484,19 @@ clients from discovering the still incomplete interface."
;; 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))
- (val
- (list
+ (let* ((key (list :property bus interface property))
+ ;; Remove possible existing entry, because it must be overwritten.
+ (val (seq-remove
+ (lambda (item)
+ (equal (butlast item) (list nil service path)))
+ (gethash key dbus-registered-objects-table)))
+ (entry
(list
nil service path
(cons
(if emits-signal (list access :emits-signal) (list access))
- value)))))
- (puthash key val dbus-registered-objects-table)
+ value))))
+ (puthash key (cons entry val) dbus-registered-objects-table)
;; Return the object.
(list key (list service path))))
@@ -1509,9 +1513,15 @@ It will be registered for all objects created by `dbus-register-property'."
(cond
;; "Get" returns a variant.
((string-equal method "Get")
- (let ((entry (gethash (list :property bus interface property)
- dbus-registered-objects-table)))
- (when (string-equal path (nth 2 (car entry)))
+ (let ((entry
+ ;; Remove entries not belonging to this case.
+ (seq-remove
+ (lambda (item)
+ (not (string-equal (nth 2 item) path)))
+ (gethash (list :property bus interface property)
+ dbus-registered-objects-table))))
+
+ (when (string-equal path (nth 2 (car entry)))
`((:variant ,(cdar (last (car entry))))))))
;; "Set" expects a variant.