summaryrefslogtreecommitdiff
path: root/daemon
diff options
context:
space:
mode:
authorOndrej Holy <oholy@redhat.com>2020-10-21 09:18:21 +0200
committerOndrej Holy <oholy@redhat.com>2020-10-21 09:45:07 +0200
commit731bdbf7bf807c05eddd3a1559c01640d0dfe40e (patch)
treeed51820fa1b6ff9ea827e1cfe2ae5294d9873873 /daemon
parentccf4138a14a574517c3d597239d149bbc5dafd50 (diff)
downloadgvfs-731bdbf7bf807c05eddd3a1559c01640d0dfe40e.tar.gz
google: Set the display name for the root folder alsowip/oholy/google-display-name
As per the documentation, it is guaranteed that the display name attribute is always set. The same applies for the name attribute. However, this is not true for the root of the google backend. This sometimes causes file chooser crashes currently. Let's set those attributes also for root. Fixes: https://gitlab.gnome.org/GNOME/gvfs/-/issues/523
Diffstat (limited to 'daemon')
-rw-r--r--daemon/gvfsbackendgoogle.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/daemon/gvfsbackendgoogle.c b/daemon/gvfsbackendgoogle.c
index 27c9eba0..d3333281 100644
--- a/daemon/gvfsbackendgoogle.c
+++ b/daemon/gvfsbackendgoogle.c
@@ -1298,23 +1298,29 @@ build_file_info (GVfsBackendGoogle *self,
g_file_info_set_file_type (info, file_type);
- if (is_root)
- goto out;
-
id = gdata_entry_get_id (entry);
g_file_info_set_attribute_string (info, G_FILE_ATTRIBUTE_ID_FILE, id);
- if (is_symlink)
+ if (is_root)
+ name = "/";
+ else if (is_symlink)
name = symlink_name;
else
name = id;
g_file_info_set_name (info, name);
- title = gdata_entry_get_title (entry);
+ if (is_root)
+ title = g_vfs_backend_get_display_name (G_VFS_BACKEND (self));
+ else
+ title = gdata_entry_get_title (entry);
+
g_file_info_set_display_name (info, title);
g_file_info_set_edit_name (info, title);
+ if (is_root)
+ goto out;
+
copy_name = generate_copy_name (self, entry, entry_path);
/* Sanitize copy-name by replacing slashes with dashes. This is