~ubuntu-branches/ubuntu/oneiric/evolution/oneiric-proposed

« back to all changes in this revision

Viewing changes to calendar/gui/tag-calendar.c

  • Committer: Bazaar Package Importer
  • Author(s): Mathieu Trudel-Lapierre
  • Date: 2011-08-18 11:10:01 UTC
  • mfrom: (1.1.83 upstream)
  • Revision ID: james.westby@ubuntu.com-20110818111001-559uzyuqsoyj7xjg
Tags: 3.1.5-0ubuntu1
* New upstream release.
* debian/control: bump e-d-s Build-Depends to 3.1.5.
* debian/patches/03_lpi.patch: refreshed.
* debian/patches/11_remove_upstream_submit_bugreport.patch: refreshed.
* debian/patches/bogofilter_init_903b8e6.patch,
  debian/patches/evo_fbee43e_to_f4505a2.patch,
  debian/patches/spamassassin_init_4fc04af.patch: dropped, included upstream.
* debian/patches/spamd_sbin_path.patch: correct the path to spamd as
  /usr/sbin/spamd, which is the correct path in Ubuntu. (LP: #828693)

Show diffs side-by-side

added added

removed removed

Lines of Context:
145
145
 * tag_calendar_by_client:
146
146
 * @ecal: Calendar widget to tag.
147
147
 * @client: A calendar client object.
 
148
 * @cancellable: A #GCancellable; can be %NULL
148
149
 *
149
150
 * Tags an #ECalendar widget with the events that occur in its current time
150
151
 * range.  The occurrences are extracted from the specified calendar @client.
151
152
 **/
152
153
void
153
154
tag_calendar_by_client (ECalendar *ecal,
154
 
                        ECalClient *client)
 
155
                        ECalClient *client,
 
156
                        GCancellable *cancellable)
155
157
{
156
 
        struct calendar_tag_closure c;
 
158
        struct calendar_tag_closure *c;
157
159
 
158
160
        g_return_if_fail (E_IS_CALENDAR (ecal));
159
161
        g_return_if_fail (E_IS_CAL_CLIENT (client));
165
167
        if (!e_client_is_opened (E_CLIENT (client)))
166
168
                return;
167
169
 
168
 
        if (!prepare_tag (ecal, &c, NULL, TRUE))
 
170
        c = g_new0 (struct calendar_tag_closure, 1);
 
171
 
 
172
        if (!prepare_tag (ecal, c, NULL, TRUE)) {
 
173
                g_free (c);
169
174
                return;
 
175
        }
170
176
 
171
 
        c.skip_transparent_events = TRUE;
172
 
        c.recur_events_italic = get_recur_events_italic ();
 
177
        c->skip_transparent_events = TRUE;
 
178
        c->recur_events_italic = get_recur_events_italic ();
173
179
 
174
180
        e_cal_client_generate_instances (
175
 
                client, c.start_time, c.end_time, tag_calendar_cb, &c);
 
181
                client, c->start_time, c->end_time, cancellable, tag_calendar_cb, c, g_free);
176
182
}
177
183
 
178
184
/* Resolves TZIDs for the recurrence generator, for when the comp is not on
196
202
                /* FIXME: Handle errors. */
197
203
                GError *error = NULL;
198
204
 
199
 
                if (!e_cal_client_get_timezone_sync (client, tzid, &zone, NULL, &error)) {
200
 
                        g_debug ("%s: Failed to get timezone '%s': %s", G_STRFUNC, tzid, error->message);
201
 
                        if (error)
202
 
                                g_error_free (error);
 
205
                e_cal_client_get_timezone_sync (
 
206
                        client, tzid, &zone, NULL, &error);
 
207
 
 
208
                if (error != NULL) {
 
209
                        g_warning (
 
210
                                "%s: Failed to get timezone '%s': %s",
 
211
                                G_STRFUNC, tzid, error->message);
 
212
                        g_error_free (error);
203
213
                }
204
214
        }
205
215
 
227
237
                      icaltimezone *display_zone,
228
238
                      gboolean clear_first,
229
239
                      gboolean comp_is_on_server,
230
 
                      gboolean can_recur_events_italic)
 
240
                      gboolean can_recur_events_italic,
 
241
                      GCancellable *cancellable)
231
242
{
232
243
        struct calendar_tag_closure c;
233
244
 
244
255
        c.skip_transparent_events = FALSE;
245
256
        c.recur_events_italic = can_recur_events_italic && get_recur_events_italic ();
246
257
 
247
 
        if (comp_is_on_server)
 
258
        if (comp_is_on_server) {
 
259
                struct calendar_tag_closure *closure = g_new0 (struct calendar_tag_closure, 1);
 
260
 
 
261
                *closure = c;
 
262
 
248
263
                e_cal_client_generate_instances_for_object (
249
264
                        client, e_cal_component_get_icalcomponent (comp),
250
 
                        c.start_time, c.end_time, tag_calendar_cb, &c);
251
 
        else
 
265
                        c.start_time, c.end_time, cancellable, tag_calendar_cb, closure, g_free);
 
266
        } else
252
267
                e_cal_recur_generate_instances (
253
268
                        comp, c.start_time, c.end_time,
254
269
                        tag_calendar_cb, &c, resolve_tzid_cb,