[epiphany] Don't try to set the wrong value for cookie policy



commit 59b65f3d81812ab5a2eb89bae204fb32b79a41ad
Author: William Jon McCann <william jon mccann gmail com>
Date:   Mon Dec 9 19:53:07 2013 +0100

    Don't try to set the wrong value for cookie policy
    
    The builder template system wants us to to use underscores for
    the widget names but the gsettings values for these widgets
    use dashes. So, translate between then in the mapping functions.

 src/prefs-dialog.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/src/prefs-dialog.c b/src/prefs-dialog.c
index aa561d8..ae4b29b 100644
--- a/src/prefs-dialog.c
+++ b/src/prefs-dialog.c
@@ -930,6 +930,9 @@ cookies_get_mapping (GValue *value,
        setting = g_variant_get_string (variant, NULL);
        name = gtk_buildable_get_name (GTK_BUILDABLE (user_data));
 
+       if (g_strcmp0 (name, "no_third_party") == 0)
+               name = "no-third-party";
+
        /* If the button name matches the setting, it should be active. */
        if (g_strcmp0 (name, setting) == 0)
                g_value_set_boolean (value, TRUE);
@@ -950,7 +953,10 @@ cookies_set_mapping (const GValue *value,
                return NULL;
 
        name = gtk_buildable_get_name (GTK_BUILDABLE (user_data));
-       variant = g_variant_new_string (name);
+       if (g_strcmp0 (name, "no_third_party") == 0)
+               variant = g_variant_new_string ("no-third-party");
+       else
+               variant = g_variant_new_string (name);
 
        return variant;
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]