aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2009-06-30 14:48:06 +0000
committerMichael Albinus2009-06-30 14:48:06 +0000
commit7ae3ea65e3ee04b8afe7cd364c7029856597a56a (patch)
tree98f4a984519cba675c78b85707009147198869c4
parent4f4126e6a32887ae2f6ebf99e4da038f5cc0b290 (diff)
downloademacs-7ae3ea65e3ee04b8afe7cd364c7029856597a56a.tar.gz
emacs-7ae3ea65e3ee04b8afe7cd364c7029856597a56a.zip
* net/tramp-gvfs.el (tramp-gvfs-methods): Add "synce" method.
(tramp-gvfs-connection-mounted-p): Handle empty user name for synce. (tramp-synce-list-devices, tramp-synce-parse-device-names): New defuns. (top): Add completion function for "synce" method.
-rw-r--r--lisp/ChangeLog7
-rw-r--r--lisp/net/tramp-gvfs.el40
2 files changed, 45 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 037e0981c71..17a21d0b4fa 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -3,6 +3,13 @@
3 * net/tramp.el (tramp-do-copy-or-rename-file-directly): Handle 3 * net/tramp.el (tramp-do-copy-or-rename-file-directly): Handle
4 also the 'rename case, when setting file modes. (Bug#3712) 4 also the 'rename case, when setting file modes. (Bug#3712)
5 5
6 * net/tramp-gvfs.el (tramp-gvfs-methods): Add "synce" method.
7 (tramp-gvfs-connection-mounted-p): Handle empty user name for
8 synce.
9 (tramp-synce-list-devices, tramp-synce-parse-device-names): New
10 defuns.
11 (top): Add completion function for "synce" method.
12
62009-06-30 Kenichi Handa <handa@m17n.org> 132009-06-30 Kenichi Handa <handa@m17n.org>
7 14
8 * international/fontset.el (setup-default-fontset): Add CJK fonts 15 * international/fontset.el (setup-default-fontset): Add CJK fonts
diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el
index 640a281594b..aaba49e8154 100644
--- a/lisp/net/tramp-gvfs.el
+++ b/lisp/net/tramp-gvfs.el
@@ -98,7 +98,7 @@
98(require 'url-parse) 98(require 'url-parse)
99(require 'zeroconf) 99(require 'zeroconf)
100 100
101(defcustom tramp-gvfs-methods '("dav" "davs" "obex") 101(defcustom tramp-gvfs-methods '("dav" "davs" "obex" "synce")
102 "*List of methods for remote files, accessed with GVFS." 102 "*List of methods for remote files, accessed with GVFS."
103 :group 'tramp 103 :group 'tramp
104 :type '(repeat (choice (const "dav") 104 :type '(repeat (choice (const "dav")
@@ -106,7 +106,8 @@
106 (const "ftp") 106 (const "ftp")
107 (const "obex") 107 (const "obex")
108 (const "sftp") 108 (const "sftp")
109 (const "smb")))) 109 (const "smb")
110 (const "synce"))))
110 111
111(defcustom tramp-gvfs-zeroconf-domain "local" 112(defcustom tramp-gvfs-zeroconf-domain "local"
112 "*Zeroconf domain to be used for discovering services, like host names." 113 "*Zeroconf domain to be used for discovering services, like host names."
@@ -898,6 +899,8 @@ ADDRESS can have the form \"xx:xx:xx:xx:xx:xx\" or \"[xx:xx:xx:xx:xx:xx]\"."
898 (setq host (tramp-bluez-device host))) 899 (setq host (tramp-bluez-device host)))
899 (when (and (string-equal "dav" method) (string-equal "true" ssl)) 900 (when (and (string-equal "dav" method) (string-equal "true" ssl))
900 (setq method "davs")) 901 (setq method "davs"))
902 (when (and (string-equal "synce" method) (zerop (length user)))
903 (setq user (or (tramp-file-name-user vec) "")))
901 (unless (zerop (length domain)) 904 (unless (zerop (length domain))
902 (setq user (concat user tramp-prefix-domain-format domain))) 905 (setq user (concat user tramp-prefix-domain-format domain)))
903 (unless (zerop (length port)) 906 (unless (zerop (length port))
@@ -1171,6 +1174,39 @@ be used."
1171 (tramp-set-completion-function 1174 (tramp-set-completion-function
1172 "davs" '((tramp-zeroconf-parse-webdav-device-names "")))) 1175 "davs" '((tramp-zeroconf-parse-webdav-device-names ""))))
1173 1176
1177
1178;; D-Bus SYNCE functions.
1179
1180(defun tramp-synce-list-devices ()
1181 "Returns all discovered synce devices as list."
1182 (let (tramp-synce-devices)
1183 (dolist (device
1184 (with-tramp-dbus-call-method tramp-gvfs-dbus-event-vector t
1185 :system "org.freedesktop.Hal"
1186 "/org/freedesktop/Hal/Manager"
1187 "org.freedesktop.Hal.Manager" "GetAllDevices"))
1188 (when (with-tramp-dbus-call-method tramp-gvfs-dbus-event-vector t
1189 :system "org.freedesktop.Hal" device
1190 "org.freedesktop.Hal.Device" "PropertyExists" "sync.plugin")
1191 (add-to-list
1192 'tramp-synce-devices
1193 (with-tramp-dbus-call-method tramp-gvfs-dbus-event-vector t
1194 :system "org.freedesktop.Hal" device
1195 "org.freedesktop.Hal.Device"
1196 "GetPropertyString" "pda.pocketpc.name"))))
1197 (tramp-message tramp-gvfs-dbus-event-vector 10 "%s" tramp-synce-devices)
1198 tramp-synce-devices))
1199
1200(defun tramp-synce-parse-device-names (ignore)
1201 "Return a list of (nil host) tuples allowed to access."
1202 (mapcar
1203 (lambda (x) (list nil x))
1204 (tramp-synce-list-devices)))
1205
1206;; Add completion function for SYNCE method.
1207(tramp-set-completion-function
1208 "synce" '((tramp-synce-parse-device-names "")))
1209
1174(provide 'tramp-gvfs) 1210(provide 'tramp-gvfs)
1175 1211
1176;;; TODO: 1212;;; TODO: