diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2013-02-19 03:50:01 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2013-02-19 03:50:01 +0800 |
commit | 92a3fce79c8acb244bcaf23d22e38e3f21f80c36 (patch) | |
tree | 77ae0b13721c71f4fa4dc0c914048c29f34062dc /calendar | |
parent | 61e2e0005520a20913d8271b5bc80ca94a594671 (diff) | |
download | gsoc2013-evolution-92a3fce79c8acb244bcaf23d22e38e3f21f80c36.tar gsoc2013-evolution-92a3fce79c8acb244bcaf23d22e38e3f21f80c36.tar.gz gsoc2013-evolution-92a3fce79c8acb244bcaf23d22e38e3f21f80c36.tar.bz2 gsoc2013-evolution-92a3fce79c8acb244bcaf23d22e38e3f21f80c36.tar.lz gsoc2013-evolution-92a3fce79c8acb244bcaf23d22e38e3f21f80c36.tar.xz gsoc2013-evolution-92a3fce79c8acb244bcaf23d22e38e3f21f80c36.tar.zst gsoc2013-evolution-92a3fce79c8acb244bcaf23d22e38e3f21f80c36.zip |
EMemoListSelector: Inherit from EClientSelector.
Use e_client_selector_get_client() to obtain an EClient.
Diffstat (limited to 'calendar')
-rw-r--r-- | calendar/gui/e-memo-list-selector.c | 32 | ||||
-rw-r--r-- | calendar/gui/e-memo-list-selector.h | 6 |
2 files changed, 25 insertions, 13 deletions
diff --git a/calendar/gui/e-memo-list-selector.c b/calendar/gui/e-memo-list-selector.c index b5fd4216e0..f52a2a6bcf 100644 --- a/calendar/gui/e-memo-list-selector.c +++ b/calendar/gui/e-memo-list-selector.c @@ -38,7 +38,7 @@ struct _EMemoListSelectorPrivate { G_DEFINE_TYPE ( EMemoListSelector, e_memo_list_selector, - E_TYPE_SOURCE_SELECTOR) + E_TYPE_CLIENT_SELECTOR) static gboolean memo_list_selector_update_single_object (ECalClient *client, @@ -128,7 +128,8 @@ client_connect_cb (GObject *source_object, g_return_if_fail (uid != 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 ( @@ -204,8 +205,8 @@ memo_list_selector_process_data (ESourceSelector *selector, source = e_source_registry_ref_source (registry, source_uid); if (source != NULL) { - e_cal_client_connect ( - source, E_CAL_CLIENT_SOURCE_TYPE_MEMOS, NULL, + e_client_selector_get_client ( + E_CLIENT_SELECTOR (selector), source, NULL, client_connect_cb, g_strdup (old_uid)); g_object_unref (source); } @@ -236,7 +237,8 @@ client_connect_for_drop_cb (GObject *source_object, g_return_if_fail (dd != 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 ( @@ -314,8 +316,8 @@ memo_list_selector_data_dropped (ESourceSelector *selector, dd->action = action; dd->list = cal_comp_selection_get_string_list (selection_data); - e_cal_client_connect ( - destination, E_CAL_CLIENT_SOURCE_TYPE_MEMOS, NULL, + e_client_selector_get_client ( + E_CLIENT_SELECTOR (selector), destination, NULL, client_connect_for_drop_cb, dd); return TRUE; @@ -349,12 +351,22 @@ e_memo_list_selector_init (EMemoListSelector *selector) } GtkWidget * -e_memo_list_selector_new (ESourceRegistry *registry) +e_memo_list_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_MEMO_LIST_SELECTOR, + "client-cache", client_cache, "extension-name", E_SOURCE_EXTENSION_MEMO_LIST, "registry", registry, NULL); + + g_object_unref (registry); + + return widget; } diff --git a/calendar/gui/e-memo-list-selector.h b/calendar/gui/e-memo-list-selector.h index 532fd312c6..e29bfb3133 100644 --- a/calendar/gui/e-memo-list-selector.h +++ b/calendar/gui/e-memo-list-selector.h @@ -54,16 +54,16 @@ typedef struct _EMemoListSelectorClass EMemoListSelectorClass; typedef struct _EMemoListSelectorPrivate EMemoListSelectorPrivate; struct _EMemoListSelector { - ESourceSelector parent; + EClientSelector parent; EMemoListSelectorPrivate *priv; }; struct _EMemoListSelectorClass { - ESourceSelectorClass parent_class; + EClientSelectorClass parent_class; }; GType e_memo_list_selector_get_type (void); -GtkWidget * e_memo_list_selector_new (ESourceRegistry *registry); +GtkWidget * e_memo_list_selector_new (EClientCache *client_cache); G_END_DECLS |