changeset 103643:d4908813a2a1

* net/tramp-gvfs.el (top): Add a default for "synce" in `tramp-default-user-alist'. (tramp-hal-service, tramp-hal-path-manager) (tramp-hal-interface-manager, tramp-hal-interface-device): New defconst. (tramp-synce-list-devices, tramp-synce-parse-device-names): New defuns.
author Michael Albinus <michael.albinus@gmx.de>
date Tue, 30 Jun 2009 21:13:29 +0000
parents 70897100200d
children 17c6a23b322b
files lisp/net/tramp-gvfs.el
diffstat 1 files changed, 41 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/net/tramp-gvfs.el	Tue Jun 30 21:10:55 2009 +0000
+++ b/lisp/net/tramp-gvfs.el	Tue Jun 30 21:13:29 2009 +0000
@@ -36,11 +36,11 @@
 ;; development time, is given in respective comments.
 
 ;; The customer option `tramp-gvfs-methods' contains the list of
-;; supported connection methods.  Per default, these are "dav", "davs"
-;; and "obex".  Note that with "obex" it might be necessary to pair
-;; with the other bluetooth device, if it hasn't been done already.
-;; There might be also some few seconds delay in discovering available
-;; bluetooth devices.
+;; supported connection methods.  Per default, these are "dav",
+;; "davs", "obex" and "synce".  Note that with "obex" it might be
+;; necessary to pair with the other bluetooth device, if it hasn't
+;; been done already.  There might be also some few seconds delay in
+;; discovering available bluetooth devices.
 
 ;; Other possible connection methods are "ftp", "sftp" and "smb".
 ;; When one of these methods is added to the list, the remote access
@@ -65,11 +65,12 @@
 ;; drop me a note.
 
 ;; For hostname completion, information is retrieved either from the
-;; bluez daemon (for the "obex" method), or from the zeroconf daemon
-;; (for the "dav", "davs", and "sftp" methods).  The zeroconf daemon
-;; is pre-configured to discover services in the "local" domain.  If
-;; another domain shall be used for discovering services, the customer
-;; option `tramp-gvfs-zeroconf-domain' can be set accordingly.
+;; bluez daemon (for the "obex" method), the hal daemon (for the
+;; "synce" method), or from the zeroconf daemon (for the "dav",
+;; "davs", and "sftp" methods).  The zeroconf daemon is pre-configured
+;; to discover services in the "local" domain.  If another domain
+;; shall be used for discovering services, the customer option
+;; `tramp-gvfs-zeroconf-domain' can be set accordingly.
 
 ;; Restrictions:
 
@@ -109,6 +110,11 @@
 			 (const "smb")
 			 (const "synce"))))
 
+;; Add a default for `tramp-default-user-alist'.  Rule: For the SYNCE
+;; method, no user is chosen.
+(add-to-list 'tramp-default-user-alist
+	     '("synce" nil nil))
+
 (defcustom tramp-gvfs-zeroconf-domain "local"
   "*Zeroconf domain to be used for discovering services, like host names."
   :group 'tramp
@@ -337,6 +343,19 @@
   "Alist of detected bluetooth devices.
 Every entry is a list (NAME ADDRESS).")
 
+(defconst tramp-hal-service "org.freedesktop.Hal"
+  "The well known name of the HAL service.")
+
+(defconst tramp-hal-path-manager "/org/freedesktop/Hal/Manager"
+  "The object path of the HAL daemon manager.")
+
+(defconst tramp-hal-interface-manager "org.freedesktop.Hal.Manager"
+  "The manager interface of the HAL daemon.")
+
+(defconst tramp-hal-interface-device "org.freedesktop.Hal.Device"
+  "The device interface of the HAL daemon.")
+
+
 ;; New handlers should be added here.
 (defconst tramp-gvfs-file-name-handler-alist
   '(
@@ -1178,22 +1197,24 @@
 ;; D-Bus SYNCE functions.
 
 (defun tramp-synce-list-devices ()
-  "Returns all discovered synce devices as list."
+  "Returns all discovered synce devices as list.
+They are retrieved from the hal daemon."
   (let (tramp-synce-devices)
     (dolist (device
 	     (with-tramp-dbus-call-method tramp-gvfs-dbus-event-vector t
-	      :system "org.freedesktop.Hal"
-	      "/org/freedesktop/Hal/Manager"
-	      "org.freedesktop.Hal.Manager" "GetAllDevices"))
-      (when (with-tramp-dbus-call-method tramp-gvfs-dbus-event-vector t
-	      :system "org.freedesktop.Hal" device
-	      "org.freedesktop.Hal.Device" "PropertyExists" "sync.plugin")
+	       :system tramp-hal-service tramp-hal-path-manager
+	       tramp-hal-interface-manager "GetAllDevices"))
+      (when (and (with-tramp-dbus-call-method tramp-gvfs-dbus-event-vector t
+		   :system tramp-hal-service device tramp-hal-interface-device
+		   "PropertyExists" "sync.plugin")
+		 (with-tramp-dbus-call-method tramp-gvfs-dbus-event-vector t
+		   :system tramp-hal-service device tramp-hal-interface-device
+		   "PropertyExists" "pda.pocketpc.name"))
 	(add-to-list
 	 'tramp-synce-devices
 	 (with-tramp-dbus-call-method tramp-gvfs-dbus-event-vector t
-	   :system "org.freedesktop.Hal" device
-	     "org.freedesktop.Hal.Device"
-	     "GetPropertyString" "pda.pocketpc.name"))))
+	   :system tramp-hal-service device tramp-hal-interface-device
+	   "GetPropertyString" "pda.pocketpc.name"))))
     (tramp-message tramp-gvfs-dbus-event-vector 10 "%s" tramp-synce-devices)
     tramp-synce-devices))