aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2013-04-13 02:21:48 +0800
committerMatthew Barnes <mbarnes@redhat.com>2013-04-13 06:35:11 +0800
commit1141e231478410ecd83c78507612e57f58f2ccf1 (patch)
treefe34c86bab52d1cbf624cde02464c12e06b18742 /modules
parentebef28545a2a74d675142afd6921f5e0e65b4b76 (diff)
downloadgsoc2013-evolution-1141e231478410ecd83c78507612e57f58f2ccf1.tar
gsoc2013-evolution-1141e231478410ecd83c78507612e57f58f2ccf1.tar.gz
gsoc2013-evolution-1141e231478410ecd83c78507612e57f58f2ccf1.tar.bz2
gsoc2013-evolution-1141e231478410ecd83c78507612e57f58f2ccf1.tar.lz
gsoc2013-evolution-1141e231478410ecd83c78507612e57f58f2ccf1.tar.xz
gsoc2013-evolution-1141e231478410ecd83c78507612e57f58f2ccf1.tar.zst
gsoc2013-evolution-1141e231478410ecd83c78507612e57f58f2ccf1.zip
Add e_cal_model_list_clients().
Replaces e_cal_model_get_client_list(). Does the same thing, except the returned ECalClient instances are referenced for thread-safety.
Diffstat (limited to 'modules')
-rw-r--r--modules/calendar/e-cal-shell-view-private.c15
-rw-r--r--modules/calendar/e-task-shell-view-private.c10
2 files changed, 12 insertions, 13 deletions
diff --git a/modules/calendar/e-cal-shell-view-private.c b/modules/calendar/e-cal-shell-view-private.c
index 68b26942ce..8cafe21c49 100644
--- a/modules/calendar/e-cal-shell-view-private.c
+++ b/modules/calendar/e-cal-shell-view-private.c
@@ -1432,7 +1432,7 @@ static void
cal_iterate_searching (ECalShellView *cal_shell_view)
{
ECalShellViewPrivate *priv;
- GList *clients, *iter;
+ GList *list, *link;
ECalModel *model;
time_t new_time, range1, range2;
icaltimezone *timezone;
@@ -1517,9 +1517,9 @@ cal_iterate_searching (ECalShellView *cal_shell_view)
model = gnome_calendar_get_model (
e_cal_shell_content_get_calendar (
cal_shell_view->priv->cal_shell_content));
- clients = e_cal_model_get_client_list (model);
+ list = e_cal_model_list_clients (model);
- if (!clients) {
+ if (list == NULL) {
e_activity_set_state (
priv->searching_activity, E_ACTIVITY_COMPLETED);
g_object_unref (priv->searching_activity);
@@ -1560,19 +1560,18 @@ cal_iterate_searching (ECalShellView *cal_shell_view)
g_free (end);
cancellable = e_activity_get_cancellable (priv->searching_activity);
- g_list_foreach (clients, (GFunc) g_object_ref, NULL);
- priv->search_pending_count = g_list_length (clients);
+ priv->search_pending_count = g_list_length (list);
priv->search_time = new_time;
- for (iter = clients; iter; iter = iter->next) {
- ECalClient *client = iter->data;
+ for (link = list; link != NULL; link = g_list_next (link)) {
+ ECalClient *client = E_CAL_CLIENT (link);
e_cal_client_get_object_list (
client, sexp, cancellable,
cal_search_get_object_list_cb, cal_shell_view);
}
- g_list_free_full (clients, g_object_unref);
+ g_list_free_full (list, (GDestroyNotify) g_object_unref);
g_free (sexp);
}
diff --git a/modules/calendar/e-task-shell-view-private.c b/modules/calendar/e-task-shell-view-private.c
index b204711977..bc538c6e75 100644
--- a/modules/calendar/e-task-shell-view-private.c
+++ b/modules/calendar/e-task-shell-view-private.c
@@ -544,7 +544,7 @@ e_task_shell_view_delete_completed (ETaskShellView *task_shell_view)
{
ETaskShellContent *task_shell_content;
ECalModel *model;
- GList *list, *iter;
+ GList *list, *link;
const gchar *sexp;
g_return_if_fail (E_IS_TASK_SHELL_VIEW (task_shell_view));
@@ -557,10 +557,10 @@ e_task_shell_view_delete_completed (ETaskShellView *task_shell_view)
e_task_shell_view_set_status_message (
task_shell_view, _("Expunging"), -1.0);
- list = e_cal_model_get_client_list (model);
+ list = e_cal_model_list_clients (model);
- for (iter = list; iter != NULL; iter = iter->next) {
- ECalClient *client = E_CAL_CLIENT (iter->data);
+ for (link = list; link != NULL; link = g_list_next (link)) {
+ ECalClient *client = E_CAL_CLIENT (link->data);
GSList *objects, *obj;
GError *error = NULL;
@@ -599,7 +599,7 @@ e_task_shell_view_delete_completed (ETaskShellView *task_shell_view)
e_cal_client_free_icalcomp_slist (objects);
}
- g_list_free (list);
+ g_list_free_full (list, (GDestroyNotify) g_object_unref);
e_task_shell_view_set_status_message (task_shell_view, NULL, -1.0);
}