aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlf Jasper2020-09-02 19:59:57 +0200
committerUlf Jasper2020-09-02 19:59:57 +0200
commit5aa5c0372dc3cccf2676d26a17b4d5f71caf8cdc (patch)
tree7aa85be9c34c3114fa5b29c253931951e1bcf6d7
parentc5e8254b9c89ac866df057fa3acd2dc44e3989ae (diff)
parent1457e84f4468f4a5f2de8c182596225cb1355afa (diff)
downloademacs-5aa5c0372dc3cccf2676d26a17b4d5f71caf8cdc.tar.gz
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."
1484 1484
1485 ;; Create a hash table entry. We use nil for the unique name, 1485 ;; Create a hash table entry. We use nil for the unique name,
1486 ;; because the property might be accessed from anybody. 1486 ;; because the property might be accessed from anybody.
1487 (let ((key (list :property bus interface property)) 1487 (let* ((key (list :property bus interface property))
1488 (val 1488 ;; Remove possible existing entry, because it must be overwritten.
1489 (list 1489 (val (seq-remove
1490 (lambda (item)
1491 (equal (butlast item) (list nil service path)))
1492 (gethash key dbus-registered-objects-table)))
1493 (entry
1490 (list 1494 (list
1491 nil service path 1495 nil service path
1492 (cons 1496 (cons
1493 (if emits-signal (list access :emits-signal) (list access)) 1497 (if emits-signal (list access :emits-signal) (list access))
1494 value))))) 1498 value))))
1495 (puthash key val dbus-registered-objects-table) 1499 (puthash key (cons entry val) dbus-registered-objects-table)
1496 1500
1497 ;; Return the object. 1501 ;; Return the object.
1498 (list key (list service path)))) 1502 (list key (list service path))))
@@ -1509,9 +1513,15 @@ It will be registered for all objects created by `dbus-register-property'."
1509 (cond 1513 (cond
1510 ;; "Get" returns a variant. 1514 ;; "Get" returns a variant.
1511 ((string-equal method "Get") 1515 ((string-equal method "Get")
1512 (let ((entry (gethash (list :property bus interface property) 1516 (let ((entry
1513 dbus-registered-objects-table))) 1517 ;; Remove entries not belonging to this case.
1514 (when (string-equal path (nth 2 (car entry))) 1518 (seq-remove
1519 (lambda (item)
1520 (not (string-equal (nth 2 item) path)))
1521 (gethash (list :property bus interface property)
1522 dbus-registered-objects-table))))
1523
1524 (when (string-equal path (nth 2 (car entry)))
1515 `((:variant ,(cdar (last (car entry)))))))) 1525 `((:variant ,(cdar (last (car entry))))))))
1516 1526
1517 ;; "Set" expects a variant. 1527 ;; "Set" expects a variant.