Commit d557e7a6 authored by Michael Albinus's avatar Michael Albinus

* 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.
parent 551b8e0b
...@@ -36,11 +36,11 @@ ...@@ -36,11 +36,11 @@
;; development time, is given in respective comments. ;; development time, is given in respective comments.
;; The customer option `tramp-gvfs-methods' contains the list of ;; The customer option `tramp-gvfs-methods' contains the list of
;; supported connection methods. Per default, these are "dav", "davs" ;; supported connection methods. Per default, these are "dav",
;; and "obex". Note that with "obex" it might be necessary to pair ;; "davs", "obex" and "synce". Note that with "obex" it might be
;; with the other bluetooth device, if it hasn't been done already. ;; necessary to pair with the other bluetooth device, if it hasn't
;; There might be also some few seconds delay in discovering available ;; been done already. There might be also some few seconds delay in
;; bluetooth devices. ;; discovering available bluetooth devices.
;; Other possible connection methods are "ftp", "sftp" and "smb". ;; Other possible connection methods are "ftp", "sftp" and "smb".
;; When one of these methods is added to the list, the remote access ;; When one of these methods is added to the list, the remote access
...@@ -65,11 +65,12 @@ ...@@ -65,11 +65,12 @@
;; drop me a note. ;; drop me a note.
;; For hostname completion, information is retrieved either from the ;; For hostname completion, information is retrieved either from the
;; bluez daemon (for the "obex" method), or from the zeroconf daemon ;; bluez daemon (for the "obex" method), the hal daemon (for the
;; (for the "dav", "davs", and "sftp" methods). The zeroconf daemon ;; "synce" method), or from the zeroconf daemon (for the "dav",
;; is pre-configured to discover services in the "local" domain. If ;; "davs", and "sftp" methods). The zeroconf daemon is pre-configured
;; another domain shall be used for discovering services, the customer ;; to discover services in the "local" domain. If another domain
;; option `tramp-gvfs-zeroconf-domain' can be set accordingly. ;; shall be used for discovering services, the customer option
;; `tramp-gvfs-zeroconf-domain' can be set accordingly.
;; Restrictions: ;; Restrictions:
...@@ -109,6 +110,11 @@ ...@@ -109,6 +110,11 @@
(const "smb") (const "smb")
(const "synce")))) (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" (defcustom tramp-gvfs-zeroconf-domain "local"
"*Zeroconf domain to be used for discovering services, like host names." "*Zeroconf domain to be used for discovering services, like host names."
:group 'tramp :group 'tramp
...@@ -337,6 +343,19 @@ It keeps the timestamp of last discovery.") ...@@ -337,6 +343,19 @@ It keeps the timestamp of last discovery.")
"Alist of detected bluetooth devices. "Alist of detected bluetooth devices.
Every entry is a list (NAME ADDRESS).") 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. ;; New handlers should be added here.
(defconst tramp-gvfs-file-name-handler-alist (defconst tramp-gvfs-file-name-handler-alist
'( '(
...@@ -1178,22 +1197,24 @@ be used." ...@@ -1178,22 +1197,24 @@ be used."
;; D-Bus SYNCE functions. ;; D-Bus SYNCE functions.
(defun tramp-synce-list-devices () (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) (let (tramp-synce-devices)
(dolist (device (dolist (device
(with-tramp-dbus-call-method tramp-gvfs-dbus-event-vector t (with-tramp-dbus-call-method tramp-gvfs-dbus-event-vector t
:system "org.freedesktop.Hal" :system tramp-hal-service tramp-hal-path-manager
"/org/freedesktop/Hal/Manager" tramp-hal-interface-manager "GetAllDevices"))
"org.freedesktop.Hal.Manager" "GetAllDevices")) (when (and (with-tramp-dbus-call-method tramp-gvfs-dbus-event-vector t
(when (with-tramp-dbus-call-method tramp-gvfs-dbus-event-vector t :system tramp-hal-service device tramp-hal-interface-device
:system "org.freedesktop.Hal" device "PropertyExists" "sync.plugin")
"org.freedesktop.Hal.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 (add-to-list
'tramp-synce-devices 'tramp-synce-devices
(with-tramp-dbus-call-method tramp-gvfs-dbus-event-vector t (with-tramp-dbus-call-method tramp-gvfs-dbus-event-vector t
:system "org.freedesktop.Hal" device :system tramp-hal-service device tramp-hal-interface-device
"org.freedesktop.Hal.Device" "GetPropertyString" "pda.pocketpc.name"))))
"GetPropertyString" "pda.pocketpc.name"))))
(tramp-message tramp-gvfs-dbus-event-vector 10 "%s" tramp-synce-devices) (tramp-message tramp-gvfs-dbus-event-vector 10 "%s" tramp-synce-devices)
tramp-synce-devices)) tramp-synce-devices))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment