https://bugzilla.xfce.org/show_bug.cgi?id=15447

            Bug ID: 15447
           Summary: Should use G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME as
                    filename instead of ID when copying from GVFS mounted
                    file systems
    Classification: Xfce Core
           Product: Thunar
           Version: git
          Hardware: PC (x86_64)
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: Medium
         Component: Thunarx
          Assignee: xfce-bugs@xfce.org
          Reporter: poli...@gmail.com
  Target Milestone: 1.8.7

Situation - Using Gnome-Accounts and GVFS to mount a Google Drive. On copying a
file from the remote GVFS filesystem, the filenames are turned into
incomprehensible strings, taken from Google's internal ID used to distinguish
identically-named files.

Distribution : Manjaro
Thunar: 1.8.4git-771dc2
gnome-control-center 3.32.1-1
gvfs 1.40.1-2
gvfs-google 1.40.1-2
gvfs-goa 1.40.1-2
gnome-online-accounts 3.32.0-1

To reproduce: 
1. install gnome-control-centre, google-gvfs and gnome-online-accounts, 
2. Use `sh -c "XDG_CURRENT_DESKTOP=GNOME gnome-control-center"` to add a Google
account
3. Mount Google drive in Thunar and open it
4. Copy a file from Google Drive to a local file system
5. Notice the name of the copied file is nothing like the name of the file as
correctly shown in Thunar, eg, copying a file named "my.vimrc" to my home
directory resulted in a file named "19K-XUZfXa3V_BZEK<redacted>_6lclt"


As per https://developer.gnome.org/gio/stable/GFile.html#GFile.description:

> All GFiles have a basename (get with g_file_get_basename()). These names are 
> byte strings that are used to identify the file on the filesystem (relative 
> to its parent directory) and there is no guarantees that they have any 
> particular charset encoding or even make any sense at all. If you want to use 
> filenames in a user interface you should use the display name that you can 
> get by requesting the G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME attribute with 
> g_file_query_info(). This is guaranteed to be in UTF-8 and can be used in a 
> user interface. But always store the real basename or the GFile to use to 
> actually access the file, because there is no way to go from a display name 
> to the actual name.

Clearly, Thunar is accessing this G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME when
displaying files in the UI, but on copying, it is instead using the byte string
instead of ensuring that the copied file ends up represented to the user the
same way.

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Xfce-bugs mailing list
Xfce-bugs@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce-bugs

Reply via email to