diff options
author | David Zeuthen <davidz@redhat.com> | 2012-01-18 14:06:00 -0500 |
---|---|---|
committer | David Zeuthen <davidz@redhat.com> | 2012-01-18 14:06:00 -0500 |
commit | ea1360d6ce8eee37f0290011eb9f47cf10fcccc9 (patch) | |
tree | 87b44397542633e86f2e76685c4558d4079c8541 /monitor | |
parent | c38ef360222489b564336c7a969255465445e968 (diff) | |
download | gvfs-ea1360d6ce8eee37f0290011eb9f47cf10fcccc9.tar.gz |
Use comment=gvfs-show and -hide instead of -show=1|True|0|False
This is also easier to express in the UI
http://people.freedesktop.org/~david/palimpsest-fstab-gvfs-show-option.png
Signed-off-by: David Zeuthen <davidz@redhat.com>
Diffstat (limited to 'monitor')
-rw-r--r-- | monitor/udisks2/gvfsudisks2utils.c | 4 | ||||
-rw-r--r-- | monitor/udisks2/gvfsudisks2volumemonitor.c | 17 |
2 files changed, 14 insertions, 7 deletions
diff --git a/monitor/udisks2/gvfsudisks2utils.c b/monitor/udisks2/gvfsudisks2utils.c index b5f29363..7d49b86a 100644 --- a/monitor/udisks2/gvfsudisks2utils.c +++ b/monitor/udisks2/gvfsudisks2utils.c @@ -99,7 +99,9 @@ gvfs_udisks2_utils_lookup_fstab_options_value (const gchar *fstab_options, start += strlen (key); for (n = 0; start[n] != ',' && start[n] != '\0'; n++) ; - if (n >= 1) + if (n == 0) + ret = g_strdup (""); + else if (n >= 1) ret = g_uri_unescape_segment (start, start + n, NULL); } } diff --git a/monitor/udisks2/gvfsudisks2volumemonitor.c b/monitor/udisks2/gvfsudisks2volumemonitor.c index 38b87a18..cb1cc048 100644 --- a/monitor/udisks2/gvfsudisks2volumemonitor.c +++ b/monitor/udisks2/gvfsudisks2volumemonitor.c @@ -607,16 +607,21 @@ should_include (const gchar *mount_path, g_return_val_if_fail (mount_path != NULL, FALSE); - /* The comment=gvfs-show=<val> trumps everything else */ + /* The comment=gvfs-show option trumps everything else */ if (options != NULL) { - gchar *value = gvfs_udisks2_utils_lookup_fstab_options_value (options, "comment=gvfs-show="); + gchar *value; + value = gvfs_udisks2_utils_lookup_fstab_options_value (options, "comment=gvfs-show"); if (value != NULL) { - if (g_strcmp0 (value, "1") == 0 || g_ascii_strcasecmp (value, "true") == 0) - { - ret = TRUE; - } + ret = TRUE; + g_free (value); + goto out; + } + value = gvfs_udisks2_utils_lookup_fstab_options_value (options, "comment=gvfs-hide"); + if (value != NULL) + { + ret = FALSE; g_free (value); goto out; } |