@@ -687,6 +687,7 @@ It has been changed in GVFS 1.14.")
687
687
(" gvfs-monitor-file" . " monitor" )
688
688
(" gvfs-mount" . " mount" )
689
689
(" gvfs-move" . " move" )
690
+ (" gvfs-rename" . " rename" )
690
691
(" gvfs-rm" . " remove" )
691
692
(" gvfs-set-attribute" . " set" )
692
693
(" gvfs-trash" . " trash" ))
@@ -973,11 +974,15 @@ file names."
973
974
(copy-directory filename newname keep-date t )
974
975
(when (eq op 'rename ) (delete-directory filename 'recursive )))
975
976
976
- (let ((t1 (tramp-tramp-file-p filename))
977
- (t2 (tramp-tramp-file-p newname))
978
- (equal-remote (tramp-equal-remote filename newname))
979
- (gvfs-operation (if (eq op 'copy ) " gvfs-copy" " gvfs-move" ))
980
- (msg-operation (if (eq op 'copy ) " Copying" " Renaming" )))
977
+ (let* ((t1 (tramp-tramp-file-p filename))
978
+ (t2 (tramp-tramp-file-p newname))
979
+ (equal-remote (tramp-equal-remote filename newname))
980
+ (gvfs-operation
981
+ (cond
982
+ ((eq op 'copy ) " gvfs-copy" )
983
+ (equal-remote " gvfs-rename" )
984
+ (t " gvfs-move" )))
985
+ (msg-operation (if (eq op 'copy ) " Copying" " Renaming" )))
981
986
982
987
(with-parsed-tramp-file-name (if t1 filename newname) nil
983
988
(unless (file-exists-p filename)
@@ -1048,8 +1053,8 @@ file names."
1048
1053
(filename newname &optional ok-if-already-exists keep-date
1049
1054
preserve-uid-gid preserve-extended-attributes)
1050
1055
" Like `copy-file' for Tramp files."
1051
- (setq filename (expand-file-name filename))
1052
- ( setq newname (expand-file-name newname))
1056
+ (setq filename (expand-file-name filename)
1057
+ newname (expand-file-name newname))
1053
1058
; ; At least one file a Tramp file?
1054
1059
(if (or (tramp-tramp-file-p filename)
1055
1060
(tramp-tramp-file-p newname))
@@ -1545,8 +1550,8 @@ If FILE-SYSTEM is non-nil, return file system attributes."
1545
1550
" Like `rename-file' for Tramp files."
1546
1551
; ; Check if both files are local -- invoke normal rename-file.
1547
1552
; ; Otherwise, use Tramp from local system.
1548
- (setq filename (expand-file-name filename))
1549
- ( setq newname (expand-file-name newname))
1553
+ (setq filename (expand-file-name filename)
1554
+ newname (expand-file-name newname))
1550
1555
; ; At least one file a Tramp file?
1551
1556
(if (or (tramp-tramp-file-p filename)
1552
1557
(tramp-tramp-file-p newname))
@@ -1613,6 +1618,12 @@ If FILE-SYSTEM is non-nil, return file system attributes."
1613
1618
(setq method " davs"
1614
1619
localname
1615
1620
(concat (tramp-gvfs-get-remote-prefix v) localname)))
1621
+ (when (string-equal " media" method)
1622
+ (when-let
1623
+ ((media (tramp-get-connection-property v " media-device" nil )))
1624
+ (setq method (tramp-media-device-method media)
1625
+ host (tramp-media-device-host media)
1626
+ port (tramp-media-device-port media))))
1616
1627
(when (and user domain)
1617
1628
(setq user (concat domain " ;" user)))
1618
1629
(url-recreate-url
@@ -1648,6 +1659,14 @@ If FILE-SYSTEM is non-nil, return file system attributes."
1648
1659
(dbus-unescape-from-identifier
1649
1660
(replace-regexp-in-string " ^.*/\\ ([^/]+\\ )$" " \\ 1" object-path)))
1650
1661
1662
+ (defun tramp-gvfs-url-host (url )
1663
+ " Return the host name part of URL, a string.
1664
+ We cannot use `url-host' , because `url-generic-parse-url' returns
1665
+ a downcased host name only."
1666
+ (and (stringp url)
1667
+ (string-match " ^[[:alnum:]]+://\\ ([^/:]+\\ )" url)
1668
+ (match-string 1 url)))
1669
+
1651
1670
1652
1671
; ; D-Bus GVFS functions.
1653
1672
@@ -1788,17 +1807,17 @@ If FILE-SYSTEM is non-nil, return file system attributes."
1788
1807
(when (string-equal " google-drive" method)
1789
1808
(setq method " gdrive" ))
1790
1809
(when (and (string-equal " http" method) (stringp uri))
1791
- (setq uri (url-generic-parse-url uri)
1810
+ (setq host (tramp-gvfs-url-host uri)
1811
+ uri (url-generic-parse-url uri)
1792
1812
method (url-type uri)
1793
1813
user (url-user uri)
1794
- host (url-host uri)
1795
1814
port (url-portspec uri)))
1796
1815
(when (member method tramp-media-methods)
1797
1816
; ; Ensure that media devices are cached.
1798
1817
(tramp-get-media-devices nil )
1799
1818
(let ((v (tramp-get-connection-property
1800
1819
(make-tramp-media-device
1801
- :method method :host ( downcase host) :port port)
1820
+ :method method :host host :port port)
1802
1821
" vector" nil )))
1803
1822
(when v
1804
1823
(setq method (tramp-file-name-method v)
@@ -1889,17 +1908,17 @@ If FILE-SYSTEM is non-nil, return file system attributes."
1889
1908
(when (string-equal " google-drive" method)
1890
1909
(setq method " gdrive" ))
1891
1910
(when (and (string-equal " http" method) (stringp uri))
1892
- (setq uri (url-generic-parse-url uri)
1911
+ (setq host (tramp-gvfs-url-host uri)
1912
+ uri (url-generic-parse-url uri)
1893
1913
method (url-type uri)
1894
1914
user (url-user uri)
1895
- host (url-host uri)
1896
1915
port (url-portspec uri)))
1897
1916
(when (member method tramp-media-methods)
1898
1917
; ; Ensure that media devices are cached.
1899
1918
(tramp-get-media-devices vec)
1900
1919
(let ((v (tramp-get-connection-property
1901
1920
(make-tramp-media-device
1902
- :method method :host ( downcase host) :port port)
1921
+ :method method :host host :port port)
1903
1922
" vector" nil )))
1904
1923
(when v
1905
1924
(setq method (tramp-file-name-method v)
@@ -2015,7 +2034,7 @@ and \"org.gtk.Private.RemoteVolumeMonitor.VolumeRemoved\" signals."
2015
2034
:host (replace-regexp-in-string " " " _" (nth 1 volume))))
2016
2035
(media (make-tramp-media-device
2017
2036
:method method
2018
- :host (url-host uri )
2037
+ :host (tramp-gvfs- url-host ( nth 5 volume) )
2019
2038
:port (and (url-portspec uri)))))
2020
2039
(when (member method tramp-media-methods)
2021
2040
(tramp-message
@@ -2342,8 +2361,8 @@ It checks for registered GNOME Online Accounts."
2342
2361
(defun tramp-get-media-device (vec )
2343
2362
" Transform VEC into a `tramp-media-device' structure.
2344
2363
Check, that respective cache values do exist."
2345
- (if-let* ((media (tramp-get-connection-property vec " media-device" nil ))
2346
- (prop (tramp-get-connection-property media " vector" nil )))
2364
+ (if-let ((media (tramp-get-connection-property vec " media-device" nil ))
2365
+ (prop (tramp-get-connection-property media " vector" nil )))
2347
2366
media
2348
2367
(tramp-get-media-devices vec)
2349
2368
(tramp-get-connection-property vec " media-device" nil )))
@@ -2365,7 +2384,7 @@ VEC is used only for traces."
2365
2384
:host (replace-regexp-in-string " " " _" (nth 1 volume))))
2366
2385
(media (make-tramp-media-device
2367
2386
:method method
2368
- :host (url-host uri )
2387
+ :host (tramp-gvfs- url-host ( nth 5 volume) )
2369
2388
:port (and (url-portspec uri)
2370
2389
(number-to-string (url-portspec uri))))))
2371
2390
(push (tramp-file-name-host vec) devices)
0 commit comments