aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/print.c
diff options
context:
space:
mode:
Diffstat (limited to 'calendar/gui/print.c')
-rw-r--r--calendar/gui/print.c31
1 files changed, 19 insertions, 12 deletions
diff --git a/calendar/gui/print.c b/calendar/gui/print.c
index 6aeb9f6566..0c0fa44886 100644
--- a/calendar/gui/print.c
+++ b/calendar/gui/print.c
@@ -522,6 +522,16 @@ format_date(time_t time, int flags, char *buffer, int bufflen)
return buffer;
}
+static gboolean
+instance_cb (CalComponent *comp, time_t instance_start, time_t instance_end, gpointer data)
+{
+ gboolean *found = data;
+
+ *found = TRUE;
+
+ return FALSE;
+}
+
/*
print out the month small, embolden any days with events.
@@ -625,16 +635,16 @@ print_month_small (GnomePrintContext *pc, GnomeCalendar *gcal, time_t month,
day = days[y * 7 + x];
if (day != 0) {
- GList *uids;
+ gboolean found = FALSE;
sprintf (buf, "%d", day);
/* this is a slow messy way to do this ... but easy ... */
- uids = cal_client_get_objects_in_range (client,
- CALOBJ_TYPE_EVENT,
- now, time_day_end_with_zone (now, zone));
- font = uids ? font_bold : font_normal;
- cal_obj_uid_list_free (uids);
+ cal_client_generate_instances (client, now, CALOBJ_TYPE_EVENT,
+ time_day_end_with_zone (now, zone),
+ instance_cb, &found);
+
+ font = found ? font_bold : font_normal;
next = time_add_day_with_zone (now, 1, zone);
if ((now >= greystart && now < greyend)
@@ -1805,7 +1815,7 @@ print_todo_details (GnomePrintContext *pc, GnomeCalendar *gcal,
comp = cal_component_new ();
cal_component_set_icalcomponent (comp, icalcomponent_new_clone (comp_data->icalcomp));
- cal_component_get_summary (comp_data->icalcomp, &summary);
+ cal_component_get_summary (comp, &summary);
if (!summary.value) {
g_object_unref (comp);
continue;
@@ -2161,11 +2171,8 @@ get_zone_from_tzid (CalClient *client, const char *tzid)
the builtin timezone with the TZID first. */
zone = icaltimezone_get_builtin_timezone_from_tzid (tzid);
if (!zone) {
- CalClientGetStatus status;
-
- status = cal_client_get_timezone (client, tzid, &zone);
- /* FIXME: Handle error better. */
- if (status != CAL_CLIENT_GET_SUCCESS)
+ if (!cal_client_get_timezone (client, tzid, &zone, NULL))
+ /* FIXME: Handle error better. */
g_warning ("Couldn't get timezone from server: %s",
tzid ? tzid : "");
}