[evolution-data-server] EDataCal: Attach to ECalBackend during initialization.



commit 7ab4593d3fd923b519252b4b07ebb78bfa4f2a66
Author: Matthew Barnes <mbarnes redhat com>
Date:   Mon Mar 25 12:47:47 2013 -0400

    EDataCal: Attach to ECalBackend during initialization.
    
    The EDataCal will automatically attach itself to the ECalBackend,
    like a parasite at birth.  This ensures the ECalBackend is able to
    invoke class methods earlier during EDataCal initialization.

 calendar/libedata-cal/e-data-cal-factory.c |    5 ++---
 calendar/libedata-cal/e-data-cal.c         |    3 +++
 2 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/calendar/libedata-cal/e-data-cal-factory.c b/calendar/libedata-cal/e-data-cal-factory.c
index 53d3246..80d383a 100644
--- a/calendar/libedata-cal/e-data-cal-factory.c
+++ b/calendar/libedata-cal/e-data-cal-factory.c
@@ -334,14 +334,13 @@ data_cal_factory_open (EDataCalFactory *factory,
        } else {
                object_path = construct_cal_factory_path ();
 
+               /* The EDataCal will attach itself to ECalBackend,
+                * so no need to call e_cal_backend_set_data_cal(). */
                data_cal = e_data_cal_new (
                        E_CAL_BACKEND (backend),
                        connection, object_path, error);
 
                if (data_cal != NULL) {
-                       e_cal_backend_set_data_cal (
-                               E_CAL_BACKEND (backend), data_cal);
-
                        data_cal_factory_watched_names_add (
                                factory, connection, sender);
 
diff --git a/calendar/libedata-cal/e-data-cal.c b/calendar/libedata-cal/e-data-cal.c
index 7a72331..018cabc 100644
--- a/calendar/libedata-cal/e-data-cal.c
+++ b/calendar/libedata-cal/e-data-cal.c
@@ -2339,6 +2339,9 @@ data_cal_constructed (GObject *object)
        backend = e_data_cal_ref_backend (cal);
        g_warn_if_fail (backend != NULL);
 
+       /* Attach ourselves to the ECalBackend. */
+       e_cal_backend_set_data_cal (backend, cal);
+
        g_object_bind_property (
                backend, "cache-dir",
                cal->priv->dbus_interface, "cache-dir",


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