[gvfs/wip/udisks2] Use comment=gvfs-show and -hide instead of -show=1|True|0|False
- From: David Zeuthen <davidz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gvfs/wip/udisks2] Use comment=gvfs-show and -hide instead of -show=1|True|0|False
- Date: Wed, 18 Jan 2012 19:06:46 +0000 (UTC)
commit ea1360d6ce8eee37f0290011eb9f47cf10fcccc9
Author: David Zeuthen <davidz redhat com>
Date: Wed Jan 18 14:06:00 2012 -0500
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>
monitor/udisks2/gvfsudisks2utils.c | 4 +++-
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 b5f2936..7d49b86 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 38b87a1..cb1cc04 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;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]