[evolution] cal-config-webcal: Fix error in a tranform function.
- From: Matthew Barnes <mbarnes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution] cal-config-webcal: Fix error in a tranform function.
- Date: Fri, 24 Aug 2012 19:08:38 +0000 (UTC)
commit 349be463c26c657eaf73037d5fa55740830a7046
Author: Matthew Barnes <mbarnes redhat com>
Date: Wed Aug 22 12:14:11 2012 -0400
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.
.../evolution-cal-config-webcal.c | 8 +++-----
1 files changed, 3 insertions(+), 5 deletions(-)
---
diff --git a/modules/cal-config-webcal/evolution-cal-config-webcal.c b/modules/cal-config-webcal/evolution-cal-config-webcal.c
index 2ca3550..70eb06c 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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]