]> git.eshelyaron.com Git - emacs.git/commitdiff
* net/dbus.el (dbus-name-owner-changed-handler): Use
authorMichael Albinus <michael.albinus@gmx.de>
Sun, 16 Dec 2007 22:42:47 +0000 (22:42 +0000)
committerMichael Albinus <michael.albinus@gmx.de>
Sun, 16 Dec 2007 22:42:47 +0000 (22:42 +0000)
`dbus-unregister-signal' for removing old rules.  Obey new
structure of `dbus-registered-functions-table'.

lisp/ChangeLog
lisp/net/dbus.el

index e172b30ec31f42b4cb317c1eb7cc5e0643543e44..fe01023428f4b38e38f365ad1879fcf6bb01382d 100644 (file)
@@ -1,3 +1,9 @@
+2007-12-16  Michael Albinus  <michael.albinus@gmx.de>
+
+       * net/dbus.el (dbus-name-owner-changed-handler): Use
+       `dbus-unregister-signal' for removing old rules.  Obey new
+       structure of `dbus-registered-functions-table'.
+
 2007-12-12  Thien-Thi Nguyen  <ttn@gnuvola.org>
 
        * progmodes/cc-vars.el (defcustom-c-stylevar): Rewrite.
index 83d0f7fa3ecc7e7614052ac78c291e79dd5a691e..75bcb8ed138edf30f372f565723041eb4ffe934f 100644 (file)
@@ -79,21 +79,17 @@ owner of SERVICE, or the empty string if SERVICE looses any name owner."
        '(lambda (key value)
          (dolist (elt value)
            ;; key has the structure (BUS INTERFACE SIGNAL).
-           ;; elt has the structure (SERVICE UNAME PATH HANDLER).
-           (when (string-equal old-owner (cadr elt))
+           ;; elt has the structure (UNAME SERVICE PATH HANDLER).
+           (when (string-equal old-owner (car elt))
              ;; Remove old key, and add new entry with changed name.
-             (when dbus-debug (message "Remove rule for %s %s" key elt))
-             ;(dbus-unregister-signal key)
-             (setcar (cdr elt) new-owner)
-             (when dbus-debug (message "Add rule for %s %s" key elt))
+             (dbus-unregister-signal (list key (cdr elt)))
              ;; Maybe we could arrange the lists a little bit better
              ;; that we don't need to extract every single element?
-             (when (not (zerop (length new-owner)))
-               (dbus-register-signal
-                ;; BUS      SERVICE     PATH
-                (nth 0 key) (nth 0 elt) (nth 2 elt)
-                ;; INTERFACE SIGNAL     HANDLER
-                (nth 1 key) (nth 2 key) (nth 3 elt))))))
+             (dbus-register-signal
+              ;; BUS      SERVICE     PATH
+              (nth 0 key) (nth 1 elt) (nth 2 elt)
+              ;; INTERFACE SIGNAL     HANDLER
+              (nth 1 key) (nth 2 key) (nth 3 elt)))))
        (copy-hash-table dbus-registered-functions-table)))))
 
 ;; Register the handler.