aboutsummaryrefslogtreecommitdiff
path: root/src/planner.c
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2013-09-06 12:51:45 -0500
committerTed Gould <ted@gould.cx>2013-09-06 12:51:45 -0500
commitf5746cfe118abf74fd2ef75ed4fb03d9a92cfa14 (patch)
treedc406c0e6d7cf106288c1048beedea1ae1fe69b0 /src/planner.c
parent55ed2b1b22607f3b9618640294d233eee15db767 (diff)
parentddebe3c47040869cb8fe94729c43f10f2b763550 (diff)
downloadayatana-indicator-datetime-f5746cfe118abf74fd2ef75ed4fb03d9a92cfa14.tar.gz
ayatana-indicator-datetime-f5746cfe118abf74fd2ef75ed4fb03d9a92cfa14.tar.bz2
ayatana-indicator-datetime-f5746cfe118abf74fd2ef75ed4fb03d9a92cfa14.zip
Merge trunk
Diffstat (limited to 'src/planner.c')
-rw-r--r--src/planner.c31
1 files changed, 29 insertions, 2 deletions
diff --git a/src/planner.c b/src/planner.c
index 6cbf80c..17cc55b 100644
--- a/src/planner.c
+++ b/src/planner.c
@@ -178,19 +178,46 @@ compare_appointments_by_start_time (gconstpointer ga, gconstpointer gb)
return g_date_time_compare (a->begin, b->begin);
}
+void
+indicator_datetime_planner_get_appointments (IndicatorDatetimePlanner * self,
+ GDateTime * begin,
+ GDateTime * end,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ IndicatorDatetimePlannerClass * klass;
+
+ g_return_if_fail (INDICATOR_IS_DATETIME_PLANNER (self));
+
+ klass = INDICATOR_DATETIME_PLANNER_GET_CLASS (self);
+ g_return_if_fail (klass->get_appointments != NULL);
+ klass->get_appointments (self, begin, end, callback, user_data);
+}
+
GSList *
-indicator_datetime_planner_get_appointments (IndicatorDatetimePlanner * self, GDateTime * begin, GDateTime * end)
+indicator_datetime_planner_get_appointments_finish (IndicatorDatetimePlanner * self,
+ GAsyncResult * res,
+ GError ** error)
{
+ IndicatorDatetimePlannerClass * klass;
GSList * appointments;
g_return_val_if_fail (INDICATOR_IS_DATETIME_PLANNER (self), NULL);
g_return_val_if_fail (begin != NULL, NULL);
g_return_val_if_fail (end != NULL, NULL);
- appointments = INDICATOR_DATETIME_PLANNER_GET_CLASS (self)->get_appointments (self, begin, end);
+ klass = INDICATOR_DATETIME_PLANNER_GET_CLASS (self);
+ g_return_val_if_fail (klass->get_appointments_finish != NULL, NULL);
+ appointments = klass->get_appointments_finish (self, res, error);
return g_slist_sort (appointments, compare_appointments_by_start_time);
}
+void
+indicator_datetime_planner_free_appointments (GSList * l)
+{
+ g_slist_free_full (l, (GDestroyNotify)indicator_datetime_appt_free);
+}
+
gboolean
indicator_datetime_planner_is_configured (IndicatorDatetimePlanner * self)
{