From: Michael Albinus Date: Mon, 10 Jan 2011 09:46:19 +0000 (+0100) Subject: * net/dbus.el (dbus-unregister-service): Translate returned X-Git-Tag: emacs-pretest-24.0.90~104^2~618^2~1322^2~239^2~13 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=0a203b611556f144e71adb5aaffc5a5adabeae71;p=emacs.git * net/dbus.el (dbus-unregister-service): Translate returned integer into a symbol. (dbus-register-property): Use `dbus-register-service' to do the name registration. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index cd5ec46128b..a876851c959 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2011-01-10 Jan Moringen + + * net/dbus.el (dbus-unregister-service): Translate returned + integer into a symbol. + (dbus-register-property): Use `dbus-register-service' to do the + name registration. + 2011-01-09 Chong Yidong * progmodes/idlw-help.el (idlwave-help-link): Inherit from link diff --git a/lisp/net/dbus.el b/lisp/net/dbus.el index 7903644029e..9f6cbda46ed 100644 --- a/lisp/net/dbus.el +++ b/lisp/net/dbus.el @@ -193,9 +193,14 @@ denoting the bus address. SERVICE must be a known service name." (puthash key (delete elt value) dbus-registered-objects-table) (remhash key dbus-registered-objects-table)))))) dbus-registered-objects-table) - (dbus-call-method - bus dbus-service-dbus dbus-path-dbus dbus-interface-dbus - "ReleaseName" service)) + (let ((reply (dbus-call-method + bus dbus-service-dbus dbus-path-dbus dbus-interface-dbus + "ReleaseName" service))) + (case reply + (1 :released) + (2 :non-existent) + (3 :not-owner) + (t (signal 'dbus-error "Could not unregister service"))))) (defun dbus-call-method-non-blocking-handler (&rest args) "Handler for reply messages of asynchronous D-Bus message calls. @@ -914,17 +919,20 @@ clients from discovering the still incomplete interface." bus dbus-service-dbus dbus-path-dbus dbus-interface-dbus "RequestName" service 0)) - ;; Add the handler. We use `dbus-service-emacs' as service name, in - ;; order to let unregister SERVICE despite of this default handler. + ;; Add handlers for the three property-related methods. (dbus-register-method - bus service path dbus-interface-properties "Get" 'dbus-property-handler - dont-register-service) + bus service path dbus-interface-properties "Get" + 'dbus-property-handler t) (dbus-register-method - bus service path dbus-interface-properties "GetAll" 'dbus-property-handler - dont-register-service) + bus service path dbus-interface-properties "GetAll" + 'dbus-property-handler t) (dbus-register-method - bus service path dbus-interface-properties "Set" 'dbus-property-handler - dont-register-service) + bus service path dbus-interface-properties "Set" + 'dbus-property-handler t) + + ;; Register the name SERVICE with BUS. + (unless dont-register-service + (dbus-register-service bus service)) ;; Send the PropertiesChanged signal. (when emits-signal