~ubuntu-branches/ubuntu/precise/evolution/precise

« back to all changes in this revision

Viewing changes to modules/calendar/e-task-shell-backend.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:
84
84
        shell = e_shell_backend_get_shell (shell_backend);
85
85
        shell_settings = e_shell_get_shell_settings (shell);
86
86
 
87
 
        if (!e_cal_client_get_sources (
 
87
        e_cal_client_get_sources (
88
88
                &task_shell_backend->priv->source_list,
89
 
                E_CAL_CLIENT_SOURCE_TYPE_TASKS, &error)) {
90
 
                g_debug ("%s: Could not get task sources: %s", G_STRFUNC, error ? error->message : "Unknown error");
91
 
                g_clear_error (&error);
 
89
                E_CAL_CLIENT_SOURCE_TYPE_TASKS, &error);
 
90
 
 
91
        if (error != NULL) {
 
92
                g_warning (
 
93
                        "%s: Could not get task sources: %s",
 
94
                        G_STRFUNC, error->message);
 
95
                g_error_free (error);
92
96
                return;
93
97
        }
94
98
 
172
176
        CompEditor *editor;
173
177
        GError *error = NULL;
174
178
 
175
 
        if (!e_client_utils_open_new_finish (source, result, &client, &error))
176
 
                client = NULL;
 
179
        e_client_utils_open_new_finish (source, result, &client, &error);
177
180
 
178
181
        /* XXX Handle errors better. */
179
 
        if (!client) {
180
 
                g_debug ("%s: Failed to open '%s': %s", G_STRFUNC, e_source_peek_name (source), error ? error->message : "Unknown error");
181
 
                g_clear_error (&error);
 
182
        if (error != NULL) {
 
183
                g_warn_if_fail (client == NULL);
 
184
                g_warning (
 
185
                        "%s: Failed to open '%s': %s",
 
186
                        G_STRFUNC, e_source_peek_name (source),
 
187
                        error->message);
 
188
                g_error_free (error);
182
189
                return;
183
190
        }
184
191
 
196
203
}
197
204
 
198
205
static void
199
 
task_shell_backend_task_new_cb (GObject *source_object, GAsyncResult *result, gpointer shell)
 
206
task_shell_backend_task_new_cb (GObject *source_object,
 
207
                                GAsyncResult *result,
 
208
                                gpointer shell)
200
209
{
201
210
        CompEditorFlags flags = 0;
202
211
 
203
212
        flags |= COMP_EDITOR_NEW_ITEM;
204
213
 
205
 
        task_shell_backend_new_task (E_SOURCE (source_object), result, shell, flags);
 
214
        task_shell_backend_new_task (
 
215
                E_SOURCE (source_object), result, shell, flags);
206
216
 
207
217
        g_object_unref (shell);
208
218
}
209
219
 
210
220
static void
211
 
task_shell_backend_task_assigned_new_cb (GObject *source_object, GAsyncResult *result, gpointer shell)
 
221
task_shell_backend_task_assigned_new_cb (GObject *source_object,
 
222
                                         GAsyncResult *result,
 
223
                                         gpointer shell)
212
224
{
213
225
        CompEditorFlags flags = 0;
214
226
 
216
228
        flags |= COMP_EDITOR_IS_ASSIGNED;
217
229
        flags |= COMP_EDITOR_USER_ORG;
218
230
 
219
 
        task_shell_backend_new_task (E_SOURCE (source_object), result, shell, flags);
 
231
        task_shell_backend_new_task (
 
232
                E_SOURCE (source_object), result, shell, flags);
220
233
 
221
234
        g_object_unref (shell);
222
235
}
379
392
         * we successfully open it is another matter... */
380
393
        handled = TRUE;
381
394
 
382
 
        if (!e_cal_client_get_sources (&source_list, source_type, &error)) {
383
 
                g_debug ("%s: Could not get task sources: %s", G_STRFUNC, error ? error->message : "Unknown error");
384
 
                g_clear_error (&error);
 
395
        e_cal_client_get_sources (&source_list, source_type, &error);
 
396
 
 
397
        if (error != NULL) {
 
398
                g_warning (
 
399
                        "%s: Could not get task sources: %s",
 
400
                        G_STRFUNC, error->message);
 
401
                g_error_free (error);
385
402
                goto exit;
386
403
        }
387
404
 
393
410
        }
394
411
 
395
412
        client = e_cal_client_new (source, source_type, &error);
396
 
        if (client)
397
 
                g_signal_connect (client, "authenticate", G_CALLBACK (e_client_utils_authenticate_handler), NULL);
398
 
 
399
 
        if (client == NULL || !e_client_open_sync (E_CLIENT (client), TRUE, NULL, &error)) {
400
 
                g_debug ("%s: Failed to create/open client: %s", G_STRFUNC, error ? error->message : "Unknown error");
401
 
                g_clear_error (&error);
 
413
 
 
414
        if (client != NULL) {
 
415
                g_signal_connect (
 
416
                        client, "authenticate",
 
417
                        G_CALLBACK (e_client_utils_authenticate_handler), NULL);
 
418
                e_client_open_sync (E_CLIENT (client), TRUE, NULL, &error);
 
419
        }
 
420
 
 
421
        if (error != NULL) {
 
422
                g_warning (
 
423
                        "%s: Failed to create/open client: %s",
 
424
                        G_STRFUNC, error->message);
402
425
                g_object_unref (source_list);
 
426
                g_error_free (error);
403
427
                goto exit;
404
428
        }
405
429
 
411
435
        if (editor != NULL)
412
436
                goto present;
413
437
 
414
 
        if (!e_cal_client_get_object_sync (client, comp_uid, comp_rid, &icalcomp, NULL, &error)) {
415
 
                g_debug ("%s: Failed to get object: %s", G_STRFUNC, error ? error->message : "Unknown error");
 
438
        e_cal_client_get_object_sync (
 
439
                client, comp_uid, comp_rid, &icalcomp, NULL, &error);
 
440
 
 
441
        if (error != NULL) {
 
442
                g_warning (
 
443
                        "%s: Failed to get object: %s",
 
444
                        G_STRFUNC, error->message);
416
445
                g_object_unref (source_list);
417
446
                g_error_free (error);
418
447
                goto exit;
420
449
 
421
450
        comp = e_cal_component_new ();
422
451
        if (!e_cal_component_set_icalcomponent (comp, icalcomp)) {
423
 
                g_debug ("%s: Failed to set icalcomp to comp\n", G_STRFUNC);
 
452
                g_warning ("%s: Failed to set icalcomp to comp\n", G_STRFUNC);
424
453
                icalcomponent_free (icalcomp);
425
454
                icalcomp = NULL;
426
455
        }