diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2013-02-19 03:35:29 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2013-02-19 03:39:08 +0800 |
commit | 61e2e0005520a20913d8271b5bc80ca94a594671 (patch) | |
tree | b1f81f339464c4c40f922755768173511180790b /calendar | |
parent | c3ea33df618adcf49fc4294454e1ea1745544a62 (diff) | |
download | gsoc2013-evolution-61e2e0005520a20913d8271b5bc80ca94a594671.tar gsoc2013-evolution-61e2e0005520a20913d8271b5bc80ca94a594671.tar.gz gsoc2013-evolution-61e2e0005520a20913d8271b5bc80ca94a594671.tar.bz2 gsoc2013-evolution-61e2e0005520a20913d8271b5bc80ca94a594671.tar.lz gsoc2013-evolution-61e2e0005520a20913d8271b5bc80ca94a594671.tar.xz gsoc2013-evolution-61e2e0005520a20913d8271b5bc80ca94a594671.tar.zst gsoc2013-evolution-61e2e0005520a20913d8271b5bc80ca94a594671.zip |
ECalendarSelector: Inherit from EClientSelector.
Use e_client_selector_get_client() to obtain an EClient.
Diffstat (limited to 'calendar')
-rw-r--r-- | calendar/gui/e-calendar-selector.c | 25 | ||||
-rw-r--r-- | calendar/gui/e-calendar-selector.h | 6 |
2 files changed, 21 insertions, 10 deletions
diff --git a/calendar/gui/e-calendar-selector.c b/calendar/gui/e-calendar-selector.c index c0bbb4cc7b..4ced766039 100644 --- a/calendar/gui/e-calendar-selector.c +++ b/calendar/gui/e-calendar-selector.c @@ -35,7 +35,7 @@ struct _ECalendarSelectorPrivate { G_DEFINE_TYPE ( ECalendarSelector, e_calendar_selector, - E_TYPE_SOURCE_SELECTOR) + E_TYPE_CLIENT_SELECTOR) static gboolean calendar_selector_update_single_object (ECalClient *client, @@ -127,7 +127,8 @@ client_connect_cb (GObject *source_object, g_return_if_fail (icalcomp != NULL); - client = e_cal_client_connect_finish (result, &error); + client = e_client_selector_get_client_finish ( + E_CLIENT_SELECTOR (source_object), result, &error); /* Sanity check. */ g_return_if_fail ( @@ -190,8 +191,8 @@ calendar_selector_data_dropped (ESourceSelector *selector, icalcomponent_set_uid (icalcomp, uid); } - e_cal_client_connect ( - destination, E_CAL_CLIENT_SOURCE_TYPE_EVENTS, NULL, + e_client_selector_get_client ( + E_CLIENT_SELECTOR (selector), destination, NULL, client_connect_cb, icalcomp); success = TRUE; @@ -234,12 +235,22 @@ e_calendar_selector_init (ECalendarSelector *selector) } GtkWidget * -e_calendar_selector_new (ESourceRegistry *registry) +e_calendar_selector_new (EClientCache *client_cache) { - g_return_val_if_fail (E_IS_SOURCE_REGISTRY (registry), NULL); + ESourceRegistry *registry; + GtkWidget *widget; + + g_return_val_if_fail (E_IS_CLIENT_CACHE (client_cache), NULL); + + registry = e_client_cache_ref_registry (client_cache); - return g_object_new ( + widget = g_object_new ( E_TYPE_CALENDAR_SELECTOR, + "client-cache", client_cache, "extension-name", E_SOURCE_EXTENSION_CALENDAR, "registry", registry, NULL); + + g_object_unref (registry); + + return widget; } diff --git a/calendar/gui/e-calendar-selector.h b/calendar/gui/e-calendar-selector.h index 50832ead2b..13d16897f9 100644 --- a/calendar/gui/e-calendar-selector.h +++ b/calendar/gui/e-calendar-selector.h @@ -49,16 +49,16 @@ typedef struct _ECalendarSelectorClass ECalendarSelectorClass; typedef struct _ECalendarSelectorPrivate ECalendarSelectorPrivate; struct _ECalendarSelector { - ESourceSelector parent; + EClientSelector parent; ECalendarSelectorPrivate *priv; }; struct _ECalendarSelectorClass { - ESourceSelectorClass parent_class; + EClientSelectorClass parent_class; }; GType e_calendar_selector_get_type (void); -GtkWidget * e_calendar_selector_new (ESourceRegistry *registry); +GtkWidget * e_calendar_selector_new (EClientCache *client_cache); G_END_DECLS |