In addition to /media and $HOME, also show mounts in $XDG_USER_DIR

Prepare for the future where udisks will use $XDG_USER_DIR/Volumes
instead of /media when mounting filesystems on behalf of the user.

Signed-off-by: David Zeuthen <davidz@redhat.com>
This commit is contained in:
David Zeuthen 2011-08-12 11:10:22 -04:00
parent 9fafa34345
commit 428f49b9c8

View File

@ -1975,15 +1975,19 @@ g_unix_mount_guess_should_display (GUnixMountEntry *mount_entry)
return FALSE;
/* Only display things in /media (which are generally user mountable)
and home dir (fuse stuff) */
and home dir (fuse stuff) and $XDG_RUNTIME_DIR */
mount_path = mount_entry->mount_path;
if (mount_path != NULL)
{
gboolean is_in_runtime_dir = FALSE;
/* Hide mounts within a dot path, suppose it was a purpose to hide this mount */
if (g_strstr_len (mount_path, -1, "/.") != NULL)
return FALSE;
if (g_str_has_prefix (mount_path, "/media/"))
if (g_getenv ("XDG_RUNTIME_DIR") != NULL && g_str_has_prefix (mount_path, g_get_user_runtime_dir ()))
is_in_runtime_dir = TRUE;
if (is_in_runtime_dir || g_str_has_prefix (mount_path, "/media/"))
{
char *path;
/* Avoid displaying mounts that are not accessible to the user.