aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2013-02-19 03:58:48 +0800
committerMatthew Barnes <mbarnes@redhat.com>2013-02-19 03:58:48 +0800
commitac7c1d3c75d67bfd365af0547e0a63571d6270c9 (patch)
treea681998805eb40a543ca0f97d29c2cc68303f807 /calendar
parent92a3fce79c8acb244bcaf23d22e38e3f21f80c36 (diff)
downloadgsoc2013-evolution-ac7c1d3c75d67bfd365af0547e0a63571d6270c9.tar.gz
gsoc2013-evolution-ac7c1d3c75d67bfd365af0547e0a63571d6270c9.tar.zst
gsoc2013-evolution-ac7c1d3c75d67bfd365af0547e0a63571d6270c9.zip
ETaskListSelector: Inherit from EClientSelector.
Use e_client_selector_get_client() to obtain an EClient.
Diffstat (limited to 'calendar')
-rw-r--r--calendar/gui/e-task-list-selector.c32
-rw-r--r--calendar/gui/e-task-list-selector.h6
2 files changed, 25 insertions, 13 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