aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDiego Escalante Urrelo <descalante@igalia.com>2011-02-25 06:47:48 +0800
committerDiego Escalante Urrelo <descalante@igalia.com>2011-02-25 06:55:26 +0800
commit0c799b8e9de67440b1c3bc976fa63685367f295e (patch)
tree7d281b63cf39e2fcf180328d0c258a64cce7977b /src
parent13eac99b2dcd76ad7bfaa13e4c8c4e0bbc5baa2c (diff)
downloadgsoc2013-epiphany-0c799b8e9de67440b1c3bc976fa63685367f295e.tar
gsoc2013-epiphany-0c799b8e9de67440b1c3bc976fa63685367f295e.tar.gz
gsoc2013-epiphany-0c799b8e9de67440b1c3bc976fa63685367f295e.tar.bz2
gsoc2013-epiphany-0c799b8e9de67440b1c3bc976fa63685367f295e.tar.lz
gsoc2013-epiphany-0c799b8e9de67440b1c3bc976fa63685367f295e.tar.xz
gsoc2013-epiphany-0c799b8e9de67440b1c3bc976fa63685367f295e.tar.zst
gsoc2013-epiphany-0c799b8e9de67440b1c3bc976fa63685367f295e.zip
prefs-dialog: use GtkBuildable id instead of name
Using the widget name is error prone because Glade removes the name property of objects. This makes cookie configuration work again.
Diffstat (limited to 'src')
-rw-r--r--src/prefs-dialog.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/src/prefs-dialog.c b/src/prefs-dialog.c
index 74637a365..7392450db 100644
--- a/src/prefs-dialog.c
+++ b/src/prefs-dialog.c
@@ -977,18 +977,15 @@ cookies_get_mapping (GValue *value,
gpointer user_data)
{
const char *setting;
- char *name;
+ const char *name;
setting = g_variant_get_string (variant, NULL);
-
- g_object_get (user_data, "name", &name, NULL);
+ name = gtk_buildable_get_name (GTK_BUILDABLE (user_data));
/* If the button name matches the setting, it should be active. */
if (g_strcmp0 (name, setting) == 0)
g_value_set_boolean (value, TRUE);
- g_free (name);
-
return TRUE;
}
@@ -998,17 +995,15 @@ cookies_set_mapping (const GValue *value,
gpointer user_data)
{
GVariant *variant = NULL;
- char *name;
+ const char *name;
/* Don't act unless the button has been activated (turned ON). */
if (!g_value_get_boolean (value))
return NULL;
- g_object_get (user_data, "name", &name, NULL);
+ name = gtk_buildable_get_name (GTK_BUILDABLE (user_data));
variant = g_variant_new_string (name);
- g_free (name);
-
return variant;
}
@@ -1076,13 +1071,13 @@ static const PrefsDialogPreference preferences[] =
G_SETTINGS_BIND_DEFAULT, NULL, NULL },
/* Has mapping */
- { "cookies_always_radiobutton", "active",
+ { "always", "active",
EPHY_PREFS_WEB_SCHEMA, EPHY_PREFS_WEB_COOKIES_POLICY,
G_SETTINGS_BIND_DEFAULT, cookies_get_mapping, cookies_set_mapping },
- { "cookies_no_third_party_radiobutton", "active",
+ { "no-third-party", "active",
EPHY_PREFS_WEB_SCHEMA, EPHY_PREFS_WEB_COOKIES_POLICY,
G_SETTINGS_BIND_DEFAULT, cookies_get_mapping, cookies_set_mapping },
- { "cookies_never_radiobutton", "active",
+ { "never", "active",
EPHY_PREFS_WEB_SCHEMA, EPHY_PREFS_WEB_COOKIES_POLICY,
G_SETTINGS_BIND_DEFAULT, cookies_get_mapping, cookies_set_mapping },
};