[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r99667: * net/secrets.el (top): Regis
From: |
Michael Albinus |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r99667: * net/secrets.el (top): Register the D-Bus signals only when the |
Date: |
Tue, 16 Mar 2010 00:27:31 +0100 |
User-agent: |
Bazaar (2.0.3) |
------------------------------------------------------------
revno: 99667
committer: Michael Albinus <address@hidden>
branch nick: trunk
timestamp: Tue 2010-03-16 00:27:31 +0100
message:
* net/secrets.el (top): Register the D-Bus signals only when the
service "org.freedesktop.secrets" can be pinged. Provide
subfeature 'enabled.
modified:
lisp/ChangeLog
lisp/net/secrets.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2010-03-14 21:28:52 +0000
+++ b/lisp/ChangeLog 2010-03-15 23:27:31 +0000
@@ -1,3 +1,9 @@
+2010-03-15 Michael Albinus <address@hidden>
+
+ * net/secrets.el (top): Register the D-Bus signals only when the
+ service "org.freedesktop.secrets" can be pinged. Provide
+ subfeature 'enabled.
+
2010-03-14 Juri Linkov <address@hidden>
Add finder unknown keywords.
=== modified file 'lisp/net/secrets.el'
--- a/lisp/net/secrets.el 2010-03-13 20:33:54 +0000
+++ b/lisp/net/secrets.el 2010-03-15 23:27:31 +0000
@@ -32,9 +32,14 @@
;; In order to activate this package, you must add the following code
;; into your .emacs:
-
+;;
;; (require 'secrets)
+;; It can be checked afterwards, whether there is a daemon providing
+;; this interface:
+;;
+;; (featurep 'secrets 'enabled)
+
;; The atomic objects to be managed by the Secret Service API are
;; secret items, which are something an application wishes to store
;; securely. A good example is a password that an application needs
@@ -383,14 +388,6 @@
(setq secrets-collection-paths
(delete (car args) secrets-collection-paths)))))
-(dbus-register-signal
- :session secrets-service secrets-path
- secrets-interface-service "CollectionCreated" 'secrets-collection-handler)
-
-(dbus-register-signal
- :session secrets-service secrets-path
- secrets-interface-service "CollectionDeleted" 'secrets-collection-handler)
-
(defun secrets-get-collections ()
"Return the object paths of all available collections."
(setq secrets-collection-paths
@@ -667,20 +664,38 @@
:session secrets-service item-path
secrets-interface-item "Delete")))))
-;; We must reset all variables, when there is a new instance of the
-;; "org.freedesktop.secrets" service.
-
-(dbus-register-signal
- :session dbus-service-dbus dbus-path-dbus
- dbus-interface-dbus "NameOwnerChanged"
- (lambda (&rest args)
- (when secrets-debug (message "Secret Service has changed: %S" args))
- (setq secrets-session-path secrets-empty-path
- secrets-prompt-signal nil
- secrets-collection-paths nil))
- secrets-service)
-
-(provide 'secrets)
+(if (dbus-ping :session secrets-service 100)
+
+ (progn
+ ;; We must reset all variables, when there is a new instance of
+ ;; the "org.freedesktop.secrets" service.
+ (dbus-register-signal
+ :session dbus-service-dbus dbus-path-dbus
+ dbus-interface-dbus "NameOwnerChanged"
+ (lambda (&rest args)
+ (when secrets-debug (message "Secret Service has changed: %S" args))
+ (setq secrets-session-path secrets-empty-path
+ secrets-prompt-signal nil
+ secrets-collection-paths nil))
+ secrets-service)
+
+ ;; We want to refresh our cache, when there is a change in
+ ;; collections.
+ (dbus-register-signal
+ :session secrets-service secrets-path
+ secrets-interface-service "CollectionCreated"
+ 'secrets-collection-handler)
+
+ (dbus-register-signal
+ :session secrets-service secrets-path
+ secrets-interface-service "CollectionDeleted"
+ 'secrets-collection-handler)
+
+ ;; We shall inform, whether the secret service is enabled on
+ ;; this machine.
+ (provide 'secrets '(enabled)))
+
+ (provide 'secrets))
;;; TODO:
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/trunk r99667: * net/secrets.el (top): Register the D-Bus signals only when the,
Michael Albinus <=