diff options
-rw-r--r-- | panels/info/gsd-disk-space-helper.c | 35 |
1 files changed, 28 insertions, 7 deletions
diff --git a/panels/info/gsd-disk-space-helper.c b/panels/info/gsd-disk-space-helper.c index faa7d33ff..fe56a5132 100644 --- a/panels/info/gsd-disk-space-helper.c +++ b/panels/info/gsd-disk-space-helper.c @@ -33,6 +33,7 @@ gboolean gsd_should_ignore_unix_mount (GUnixMountEntry *mount) { const char *fs, *device; + g_autofree char *label = NULL; guint i; /* This is borrowed from GLib and used as a way to determine @@ -42,7 +43,7 @@ gsd_should_ignore_unix_mount (GUnixMountEntry *mount) */ /* We also ignore network filesystems */ - +#if !GLIB_CHECK_VERSION(2, 56, 0) const gchar *ignore_fs[] = { "adfs", "afs", @@ -50,7 +51,6 @@ gsd_should_ignore_unix_mount (GUnixMountEntry *mount) "autofs", "autofs4", "cgroup", - "cifs", "configfs", "cxfs", "debugfs", @@ -72,8 +72,6 @@ gsd_should_ignore_unix_mount (GUnixMountEntry *mount) "mfs", "mqueue", "ncpfs", - "nfs", - "nfs4", "nfsd", "nullfs", "ocfs2", @@ -86,13 +84,20 @@ gsd_should_ignore_unix_mount (GUnixMountEntry *mount) "rpc_pipefs", "securityfs", "selinuxfs", - "smbfs", "sysfs", "tmpfs", "usbfs", "zfs", NULL }; +#endif /* GLIB < 2.56.0 */ + const gchar *ignore_network_fs[] = { + "cifs", + "nfs", + "nfs4", + "smbfs", + NULL + }; const gchar *ignore_devices[] = { "none", "sunrpc", @@ -102,18 +107,34 @@ gsd_should_ignore_unix_mount (GUnixMountEntry *mount) "/dev/vn", NULL }; + const gchar *ignore_labels[] = { + "RETRODE", + NULL + }; fs = g_unix_mount_get_fs_type (mount); - device = g_unix_mount_get_device_path (mount); - +#if GLIB_CHECK_VERSION(2, 56, 0) + if (g_unix_is_system_fs_type (fs)) + return TRUE; +#else for (i = 0; ignore_fs[i] != NULL; i++) if (g_str_equal (ignore_fs[i], fs)) return TRUE; +#endif + for (i = 0; ignore_network_fs[i] != NULL; i++) + if (g_str_equal (ignore_network_fs[i], fs)) + return TRUE; + device = g_unix_mount_get_device_path (mount); for (i = 0; ignore_devices[i] != NULL; i++) if (g_str_equal (ignore_devices[i], device)) return TRUE; + label = g_unix_mount_guess_name (mount); + for (i = 0; ignore_labels[i] != NULL; i++) + if (g_str_equal (ignore_labels[i], label)) + return TRUE; + return FALSE; } |