summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasmine Hassan <[email protected]>2012-10-28 12:08:55 +0200
committerJasmine Hassan <[email protected]>2012-12-22 05:08:20 +0200
commitf5f249b7e2bb2206222ce5d0ae4ed95d8e99b8c2 (patch)
tree31747d6a44383d431adf9d9bda37c9089fbe5ba6
parentcbd664b1fb9409b6500fb36f3d051ab100ffc828 (diff)
downloadcaja-f5f249b7e2bb2206222ce5d0ae4ed95d8e99b8c2.tar.bz2
caja-f5f249b7e2bb2206222ce5d0ae4ed95d8e99b8c2.tar.xz
[fm-properties] Use G_SETTINGS_BIND_INVERT_BOOLEAN where appropriate
http://git.gnome.org/browse/nautilus/commit/?id=df382f58d0ec2a1b779cf80048ad70944c8859df
-rw-r--r--src/caja-file-management-properties.c24
1 files changed, 2 insertions, 22 deletions
diff --git a/src/caja-file-management-properties.c b/src/caja-file-management-properties.c
index ef532d72..3db0d05b 100644
--- a/src/caja-file-management-properties.c
+++ b/src/caja-file-management-properties.c
@@ -726,35 +726,15 @@ bind_builder_bool (GtkBuilder *builder,
"active", G_SETTINGS_BIND_DEFAULT);
}
-static gboolean
-inverted_get_mapping (GValue *value,
- GVariant *variant,
- gpointer user_data)
-{
- g_value_set_boolean (value, !g_variant_get_boolean (variant));
- return TRUE;
-}
-
-static GVariant *
-inverted_set_mapping (const GValue *value,
- const GVariantType *expected_type,
- gpointer user_data)
-{
- return g_variant_new_boolean (!g_value_get_boolean (value));
-}
-
static void
bind_builder_bool_inverted (GtkBuilder *builder,
GSettings *settings,
const char *widget_name,
const char *prefs)
{
- g_settings_bind_with_mapping (settings, prefs,
+ g_settings_bind (settings, prefs,
gtk_builder_get_object (builder, widget_name),
- "active", G_SETTINGS_BIND_DEFAULT,
- inverted_get_mapping,
- inverted_set_mapping,
- NULL, NULL);
+ "active", G_SETTINGS_BIND_INVERT_BOOLEAN);
}
static gboolean