diff options
author | David Zeuthen <zeuthen@gmail.com> | 2012-11-28 13:21:20 -0500 |
---|---|---|
committer | David Zeuthen <zeuthen@gmail.com> | 2012-11-28 13:21:20 -0500 |
commit | 56a11c77e5bbefcbb490e7e39a3f724f7f207509 (patch) | |
tree | 089cc8c526a87e6175e9e83a143f93c6fe8a2b41 /monitor | |
parent | 765fa2635fc565453c42489c13825efa13434a70 (diff) | |
download | gvfs-56a11c77e5bbefcbb490e7e39a3f724f7f207509.tar.gz |
udisks2: fix symbolic icons for devices without an UDisksDrive
We were returning folder-remote-symbolic which is incorrect since that
should only be used for network filesystems.
Signed-off-by: David Zeuthen <zeuthen@gmail.com>
Diffstat (limited to 'monitor')
-rw-r--r-- | monitor/udisks2/gvfsudisks2mount.c | 2 | ||||
-rw-r--r-- | monitor/udisks2/gvfsudisks2utils.c | 17 | ||||
-rw-r--r-- | monitor/udisks2/gvfsudisks2utils.h | 1 | ||||
-rw-r--r-- | monitor/udisks2/gvfsudisks2volume.c | 4 |
4 files changed, 22 insertions, 2 deletions
diff --git a/monitor/udisks2/gvfsudisks2mount.c b/monitor/udisks2/gvfsudisks2mount.c index cb888c2b..0889cc77 100644 --- a/monitor/udisks2/gvfsudisks2mount.c +++ b/monitor/udisks2/gvfsudisks2mount.c @@ -268,7 +268,7 @@ update_mount (GVfsUDisks2Mount *mount) else mount->name = g_strdup (mount->mount_entry_name); - mount->symbolic_icon = g_themed_icon_new ("folder-remote-symbolic"); + mount->symbolic_icon = gvfs_udisks2_utils_symbolic_icon_from_fs_type (g_unix_mount_get_fs_type (mount->mount_entry)); } /* compute whether something changed */ diff --git a/monitor/udisks2/gvfsudisks2utils.c b/monitor/udisks2/gvfsudisks2utils.c index c969dabf..9e354556 100644 --- a/monitor/udisks2/gvfsudisks2utils.c +++ b/monitor/udisks2/gvfsudisks2utils.c @@ -82,6 +82,23 @@ gvfs_udisks2_utils_icon_from_fs_type (const gchar *fs_type) return g_themed_icon_new_with_default_fallbacks (icon_name); } +GIcon * +gvfs_udisks2_utils_symbolic_icon_from_fs_type (const gchar *fs_type) +{ + const gchar *icon_name; + if (g_strcmp0 (fs_type, "nfs") == 0 || + g_strcmp0 (fs_type, "nfs4") == 0 || + g_strcmp0 (fs_type, "cifs") == 0) + { + icon_name = "folder-remote-symbolic"; + } + else + { + icon_name = "drive-removable-media-symbolic"; + } + return g_themed_icon_new_with_default_fallbacks (icon_name); +} + gchar * gvfs_udisks2_utils_lookup_fstab_options_value (const gchar *fstab_options, const gchar *key) diff --git a/monitor/udisks2/gvfsudisks2utils.h b/monitor/udisks2/gvfsudisks2utils.h index 50c9963e..ac85a22a 100644 --- a/monitor/udisks2/gvfsudisks2utils.h +++ b/monitor/udisks2/gvfsudisks2utils.h @@ -33,6 +33,7 @@ G_BEGIN_DECLS void gvfs_udisks2_utils_udisks_error_to_gio_error (GError *error); GIcon *gvfs_udisks2_utils_icon_from_fs_type (const gchar *fs_type); +GIcon *gvfs_udisks2_utils_symbolic_icon_from_fs_type (const gchar *fs_type); gchar *gvfs_udisks2_utils_lookup_fstab_options_value (const gchar *fstab_options, const gchar *key); diff --git a/monitor/udisks2/gvfsudisks2volume.c b/monitor/udisks2/gvfsudisks2volume.c index 85022660..af623217 100644 --- a/monitor/udisks2/gvfsudisks2volume.c +++ b/monitor/udisks2/gvfsudisks2volume.c @@ -471,6 +471,8 @@ update_volume (GVfsUDisks2Volume *volume) volume->name = g_unix_mount_point_guess_name (volume->mount_point); if (volume->icon == NULL) volume->icon = gvfs_udisks2_utils_icon_from_fs_type (g_unix_mount_point_get_fs_type (volume->mount_point)); + if (volume->symbolic_icon == NULL) + volume->symbolic_icon = gvfs_udisks2_utils_symbolic_icon_from_fs_type (g_unix_mount_point_get_fs_type (volume->mount_point)); } if (volume->mount == NULL) @@ -487,7 +489,7 @@ update_volume (GVfsUDisks2Volume *volume) if (volume->icon == NULL) volume->icon = g_themed_icon_new ("drive-removable-media"); if (volume->symbolic_icon == NULL) - volume->symbolic_icon = g_themed_icon_new ("folder-remote-symbolic"); + volume->symbolic_icon = g_themed_icon_new ("drive-removable-media-symbolic"); /* ---------------------------------------------------------------------------------------------------- */ /* compute whether something changed */ |