From 349be463c26c657eaf73037d5fa55740830a7046 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Wed, 22 Aug 2012 12:14:11 -0400 Subject: cal-config-webcal: Fix error in a tranform function. When writing a GBindingTransformFunc for a bi-directional binding in the reverse direction, the "source" and "target" properties of the GBinding are flip-flopped wrt the transform function. That always throws me. Just pass the ESource to the tranform function to avoid this confusion. --- modules/cal-config-webcal/evolution-cal-config-webcal.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'modules/cal-config-webcal') diff --git a/modules/cal-config-webcal/evolution-cal-config-webcal.c b/modules/cal-config-webcal/evolution-cal-config-webcal.c index 2ca3550f00..70eb06caf5 100644 --- a/modules/cal-config-webcal/evolution-cal-config-webcal.c +++ b/modules/cal-config-webcal/evolution-cal-config-webcal.c @@ -78,7 +78,6 @@ cal_config_webcal_text_to_uri (GBinding *binding, GValue *target_value, gpointer user_data) { - GObject *target; ESource *source; SoupURI *soup_uri; ESourceAuthentication *extension; @@ -92,9 +91,7 @@ cal_config_webcal_text_to_uri (GBinding *binding, if (soup_uri == NULL) return FALSE; - target = g_binding_get_target (binding); - source = e_source_extension_get_source (E_SOURCE_EXTENSION (target)); - + source = E_SOURCE (user_data); extension_name = E_SOURCE_EXTENSION_AUTHENTICATION; extension = e_source_get_extension (source, extension_name); user = e_source_authentication_get_user (extension); @@ -151,7 +148,8 @@ cal_config_webcal_insert_widgets (ESourceConfigBackend *backend, G_BINDING_SYNC_CREATE, cal_config_webcal_uri_to_text, cal_config_webcal_text_to_uri, - NULL, (GDestroyNotify) NULL); + g_object_ref (scratch_source), + (GDestroyNotify) g_object_unref); } static gboolean -- cgit v1.2.3