diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2013-02-19 03:58:48 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2013-02-19 03:58:48 +0800 |
commit | ac7c1d3c75d67bfd365af0547e0a63571d6270c9 (patch) | |
tree | a681998805eb40a543ca0f97d29c2cc68303f807 | |
parent | 92a3fce79c8acb244bcaf23d22e38e3f21f80c36 (diff) | |
download | gsoc2013-evolution-ac7c1d3c75d67bfd365af0547e0a63571d6270c9.tar gsoc2013-evolution-ac7c1d3c75d67bfd365af0547e0a63571d6270c9.tar.gz gsoc2013-evolution-ac7c1d3c75d67bfd365af0547e0a63571d6270c9.tar.bz2 gsoc2013-evolution-ac7c1d3c75d67bfd365af0547e0a63571d6270c9.tar.lz gsoc2013-evolution-ac7c1d3c75d67bfd365af0547e0a63571d6270c9.tar.xz gsoc2013-evolution-ac7c1d3c75d67bfd365af0547e0a63571d6270c9.tar.zst gsoc2013-evolution-ac7c1d3c75d67bfd365af0547e0a63571d6270c9.zip |
ETaskListSelector: Inherit from EClientSelector.
Use e_client_selector_get_client() to obtain an EClient.
-rw-r--r-- | calendar/gui/e-task-list-selector.c | 32 | ||||
-rw-r--r-- | calendar/gui/e-task-list-selector.h | 6 | ||||
-rw-r--r-- | modules/calendar/e-task-shell-sidebar.c | 6 |
3 files changed, 28 insertions, 16 deletions
diff --git a/calendar/gui/e-task-list-selector.c b/calendar/gui/e-task-list-selector.c index c82ef4097c..e48b9620e7 100644 --- a/calendar/gui/e-task-list-selector.c +++ b/calendar/gui/e-task-list-selector.c @@ -38,7 +38,7 @@ struct _ETaskListSelectorPrivate { G_DEFINE_TYPE ( ETaskListSelector, e_task_list_selector, - E_TYPE_SOURCE_SELECTOR) + E_TYPE_CLIENT_SELECTOR) static gboolean task_list_selector_update_single_object (ECalClient *client, @@ -129,7 +129,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 ( @@ -206,8 +207,8 @@ task_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); } @@ -238,7 +239,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 ( @@ -316,8 +318,8 @@ task_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_TASKS, NULL, + e_client_selector_get_client ( + E_CLIENT_SELECTOR (selector), destination, NULL, client_connect_for_drop_cb, dd); return TRUE; @@ -351,12 +353,22 @@ e_task_list_selector_init (ETaskListSelector *selector) } GtkWidget * -e_task_list_selector_new (ESourceRegistry *registry) +e_task_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_TASK_LIST_SELECTOR, + "client-cache", client_cache, "extension-name", E_SOURCE_EXTENSION_TASK_LIST, "registry", registry, NULL); + + g_object_unref (registry); + + return widget; } diff --git a/calendar/gui/e-task-list-selector.h b/calendar/gui/e-task-list-selector.h index df79d5f0ab..1c0ba17a5b 100644 --- a/calendar/gui/e-task-list-selector.h +++ b/calendar/gui/e-task-list-selector.h @@ -54,16 +54,16 @@ typedef struct _ETaskListSelectorClass ETaskListSelectorClass; typedef struct _ETaskListSelectorPrivate ETaskListSelectorPrivate; struct _ETaskListSelector { - ESourceSelector parent; + EClientSelector parent; ETaskListSelectorPrivate *priv; }; struct _ETaskListSelectorClass { - ESourceSelectorClass parent_class; + EClientSelectorClass parent_class; }; GType e_task_list_selector_get_type (void); -GtkWidget * e_task_list_selector_new (ESourceRegistry *registry); +GtkWidget * e_task_list_selector_new (EClientCache *client_cache); G_END_DECLS diff --git a/modules/calendar/e-task-shell-sidebar.c b/modules/calendar/e-task-shell-sidebar.c index bdd5c4d819..143f59ac6a 100644 --- a/modules/calendar/e-task-shell-sidebar.c +++ b/modules/calendar/e-task-shell-sidebar.c @@ -495,7 +495,7 @@ task_shell_sidebar_constructed (GObject *object) EShellView *shell_view; EShellWindow *shell_window; EShellSidebar *shell_sidebar; - ESourceRegistry *registry; + EClientCache *client_cache; GtkContainer *container; GtkWidget *widget; AtkObject *a11y; @@ -523,8 +523,8 @@ task_shell_sidebar_constructed (GObject *object) container = GTK_CONTAINER (widget); - registry = e_shell_get_registry (shell); - widget = e_task_list_selector_new (registry); + client_cache = e_shell_get_client_cache (shell); + widget = e_task_list_selector_new (client_cache); e_source_selector_set_select_new (E_SOURCE_SELECTOR (widget), TRUE); gtk_container_add (container, widget); a11y = gtk_widget_get_accessible (widget); |