mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-27 22:46:15 +01:00
Remove type guessing, instead just display mounts in /media and in ~/.
2008-02-25 Alexander Larsson <alexl@redhat.com> * gunixmounts.c: (g_unix_mount_guess_should_display): Remove type guessing, instead just display mounts in /media and in ~/. svn path=/trunk/; revision=6582
This commit is contained in:
parent
493cbfa607
commit
4a1cf45793
@ -1,3 +1,10 @@
|
|||||||
|
2008-02-25 Alexander Larsson <alexl@redhat.com>
|
||||||
|
|
||||||
|
* gunixmounts.c:
|
||||||
|
(g_unix_mount_guess_should_display):
|
||||||
|
Remove type guessing, instead just display
|
||||||
|
mounts in /media and in ~/.
|
||||||
|
|
||||||
2008-02-25 Alexander Larsson <alexl@redhat.com>
|
2008-02-25 Alexander Larsson <alexl@redhat.com>
|
||||||
|
|
||||||
* glocalfile.c:
|
* glocalfile.c:
|
||||||
|
@ -1866,25 +1866,27 @@ gboolean
|
|||||||
g_unix_mount_guess_should_display (GUnixMountEntry *mount_entry)
|
g_unix_mount_guess_should_display (GUnixMountEntry *mount_entry)
|
||||||
{
|
{
|
||||||
GUnixMountType guessed_type;
|
GUnixMountType guessed_type;
|
||||||
|
const char *mount_path;
|
||||||
|
|
||||||
/* Never display internal mountpoints */
|
/* Never display internal mountpoints */
|
||||||
if (g_unix_mount_is_system_internal (mount_entry))
|
if (g_unix_mount_is_system_internal (mount_entry))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
/* Only display things that look "removable" or
|
/* Only display things in /media (which are generally user mountable)
|
||||||
things in /media (which are generally user mountable) */
|
and home dir (fuse stuff) */
|
||||||
guessed_type = g_unix_mount_guess_type (mount_entry);
|
mount_path = mount_entry->mount_path;
|
||||||
if (guessed_type == G_UNIX_MOUNT_TYPE_IPOD ||
|
if (mount_path != NULL)
|
||||||
guessed_type == G_UNIX_MOUNT_TYPE_CDROM ||
|
{
|
||||||
guessed_type == G_UNIX_MOUNT_TYPE_FLOPPY ||
|
if (strstr (mount_path, "/.gvfs") != NULL)
|
||||||
guessed_type == G_UNIX_MOUNT_TYPE_ZIP ||
|
|
||||||
guessed_type == G_UNIX_MOUNT_TYPE_JAZ ||
|
|
||||||
guessed_type == G_UNIX_MOUNT_TYPE_CAMERA ||
|
|
||||||
guessed_type == G_UNIX_MOUNT_TYPE_MEMSTICK ||
|
|
||||||
(mount_entry->mount_path != NULL &&
|
|
||||||
g_str_has_prefix (mount_entry->mount_path, "/media")))
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
|
if (g_str_has_prefix (mount_path, "/media/"))
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
|
if (g_str_has_prefix (mount_path, g_get_home_dir ()))
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user