~ubuntu-branches/ubuntu/raring/almanah/raring-proposed

« back to all changes in this revision

Viewing changes to src/event-factories/calendar-sources.c

  • Committer: Package Import Robot
  • Author(s): Angel Abad
  • Date: 2012-10-29 10:14:18 UTC
  • mfrom: (1.4.1) (10.1.7 sid)
  • Revision ID: package-import@ubuntu.com-20121029101418-k2c27xb0aku22zeg
Tags: 0.10.0-1~exp1
* Imported Upstream version 0.10.0
* debian/control:
  - Bump evolution Build-Depends ( >=3.6.0)
  - debian/control: Depends on evolution-common (>= 3.6.0)
* Bump Standards-Version to 3.9.4 (no changes)

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
 
30
30
#include <libintl.h>
31
31
#include <string.h>
32
 
#include <gconf/gconf-client.h>
33
32
#define HANDLE_LIBICAL_MEMORY
34
 
#include <libecal/e-cal.h>
35
 
#include <libedataserver/e-source-list.h>
36
 
#include <libedataserverui/e-passwords.h>
 
33
#include <libecal/libecal.h>
 
34
#include <libedataserver/libedataserver.h>
 
35
#include <libedataserverui/libedataserverui.h>
37
36
 
38
37
#undef CALENDAR_ENABLE_DEBUG
39
38
#include "calendar-debug.h"
48
47
 
49
48
#define CALENDAR_SOURCES_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), CALENDAR_TYPE_SOURCES, CalendarSourcesPrivate))
50
49
 
51
 
#define CALENDAR_SOURCES_EVO_DIR                          "/apps/evolution"
52
 
#define CALENDAR_SOURCES_APPOINTMENT_SOURCES_KEY          CALENDAR_SOURCES_EVO_DIR "/calendar/sources"
53
 
#define CALENDAR_SOURCES_SELECTED_APPOINTMENT_SOURCES_DIR CALENDAR_SOURCES_EVO_DIR "/calendar/display"
54
 
#define CALENDAR_SOURCES_SELECTED_APPOINTMENT_SOURCES_KEY CALENDAR_SOURCES_SELECTED_APPOINTMENT_SOURCES_DIR "/selected_calendars"
55
 
#define CALENDAR_SOURCES_TASK_SOURCES_KEY                 CALENDAR_SOURCES_EVO_DIR "/tasks/sources"
56
 
#define CALENDAR_SOURCES_SELECTED_TASK_SOURCES_DIR        CALENDAR_SOURCES_EVO_DIR "/calendar/tasks"
57
 
#define CALENDAR_SOURCES_SELECTED_TASK_SOURCES_KEY        CALENDAR_SOURCES_SELECTED_TASK_SOURCES_DIR "/selected_tasks"
58
 
 
59
50
typedef struct _CalendarSourceData CalendarSourceData;
60
51
 
61
52
struct _CalendarSourceData
62
53
{
63
 
  ECalSourceType   source_type;
 
54
  ECalClientSourceType client_type;
64
55
  CalendarSources *sources;
65
56
  guint            changed_signal;
66
57
 
67
58
  GSList          *clients;
68
 
  GSList          *selected_sources;
69
 
  ESourceList     *esource_list;
70
 
 
71
 
  guint            selected_sources_listener;
72
 
  char            *selected_sources_dir;
 
59
  ESourceSelector *esource_selector;
73
60
 
74
61
  guint            timeout_id;
75
62
 
81
68
  CalendarSourceData  appointment_sources;
82
69
  CalendarSourceData  task_sources;
83
70
 
84
 
  GConfClient        *gconf_client;
 
71
  ESourceRegistry    *esource_registry;
85
72
};
86
73
 
87
74
static void calendar_sources_class_init (CalendarSourcesClass *klass);
88
75
static void calendar_sources_init       (CalendarSources      *sources);
89
76
static void calendar_sources_finalize   (GObject             *object);
90
77
 
91
 
static void backend_died_cb (ECal *client, CalendarSourceData *source_data);
92
 
static void calendar_sources_esource_list_changed (ESourceList        *source_list,
93
 
                                                   CalendarSourceData *source_data);
 
78
static void backend_died_cb (ECalClient *client, CalendarSourceData *source_data);
 
79
static void calendar_sources_selection_changed_cb (ESourceSelector *selector, CalendarSourceData *source_data);
94
80
 
95
81
enum
96
82
{
170
156
static void
171
157
calendar_sources_init (CalendarSources *sources)
172
158
{
 
159
  GError *error = NULL;
 
160
 
173
161
  sources->priv = CALENDAR_SOURCES_GET_PRIVATE (sources);
174
162
 
175
 
  sources->priv->appointment_sources.source_type    = E_CAL_SOURCE_TYPE_EVENT;
 
163
  sources->priv->appointment_sources.client_type    = E_CAL_CLIENT_SOURCE_TYPE_EVENTS;
176
164
  sources->priv->appointment_sources.sources        = sources;
177
165
  sources->priv->appointment_sources.changed_signal = signals [APPOINTMENT_SOURCES_CHANGED];
178
166
  sources->priv->appointment_sources.timeout_id     = 0;
179
167
 
180
 
  sources->priv->task_sources.source_type    = E_CAL_SOURCE_TYPE_TODO;
 
168
  sources->priv->task_sources.client_type    = E_CAL_CLIENT_SOURCE_TYPE_TASKS;
181
169
  sources->priv->task_sources.sources        = sources;
182
170
  sources->priv->task_sources.changed_signal = signals [TASK_SOURCES_CHANGED];
183
171
  sources->priv->task_sources.timeout_id     = 0;
184
172
 
185
 
  sources->priv->gconf_client = gconf_client_get_default ();
 
173
  sources->priv->esource_registry = e_source_registry_new_sync (NULL, &error);
 
174
 
 
175
  if (error) {
 
176
    g_warning ("%s: Failed to create ESourceRegistry: %s", G_STRFUNC, error->message);
 
177
    g_clear_error (&error);
 
178
  }
186
179
}
187
180
 
188
181
static void
193
186
    {
194
187
      GSList *l;
195
188
 
196
 
      if (source_data->selected_sources_dir)
197
 
        {
198
 
          gconf_client_remove_dir (sources->priv->gconf_client,
199
 
                                   source_data->selected_sources_dir,
200
 
                                   NULL);
201
 
 
202
 
          g_free (source_data->selected_sources_dir);
203
 
          source_data->selected_sources_dir = NULL;
204
 
        }
205
 
 
206
 
      if (source_data->selected_sources_listener)
207
 
        {
208
 
          gconf_client_notify_remove (sources->priv->gconf_client,
209
 
                                      source_data->selected_sources_listener);
210
 
          source_data->selected_sources_listener = 0;
211
 
        }
212
 
 
213
189
      for (l = source_data->clients; l; l = l->next)
214
190
        {
215
191
          g_signal_handlers_disconnect_by_func (G_OBJECT (l->data),
220
196
      g_slist_free (source_data->clients);
221
197
      source_data->clients = NULL;
222
198
 
223
 
      if (source_data->esource_list)
 
199
      if (source_data->esource_selector)
224
200
        {
225
 
          g_signal_handlers_disconnect_by_func (source_data->esource_list,
226
 
                                                G_CALLBACK (calendar_sources_esource_list_changed),
 
201
          g_signal_handlers_disconnect_by_func (source_data->esource_selector,
 
202
                                                G_CALLBACK (calendar_sources_selection_changed_cb),
227
203
                                                source_data);
228
 
          g_object_unref (source_data->esource_list);
 
204
          g_object_unref (source_data->esource_selector);
229
205
        }
230
 
      source_data->esource_list = NULL;
231
 
 
232
 
      for (l = source_data->selected_sources; l; l = l->next)
233
 
        g_free (l->data);
234
 
      g_slist_free (source_data->selected_sources);
235
 
      source_data->selected_sources = NULL;
 
206
      source_data->esource_selector = NULL;
236
207
 
237
208
      if (source_data->timeout_id != 0)
238
209
        {
252
223
  calendar_sources_finalize_source_data (sources, &sources->priv->appointment_sources);
253
224
  calendar_sources_finalize_source_data (sources, &sources->priv->task_sources);
254
225
 
255
 
  if (sources->priv->gconf_client)
256
 
    g_object_unref (sources->priv->gconf_client);
257
 
  sources->priv->gconf_client = NULL;
 
226
  if (sources->priv->esource_registry)
 
227
    g_object_unref (sources->priv->esource_registry);
 
228
  sources->priv->esource_registry = NULL;
258
229
 
259
230
  if (G_OBJECT_CLASS (parent_class)->finalize)
260
231
    G_OBJECT_CLASS (parent_class)->finalize (object);
275
246
  return calendar_sources_singleton;
276
247
}
277
248
 
278
 
static gboolean
279
 
is_source_selected (ESource *esource,
280
 
                    GSList  *selected_sources)
281
 
{
282
 
  const char *uid;
283
 
  GSList     *l;
284
 
 
285
 
  uid = e_source_peek_uid (esource);
286
 
 
287
 
  for (l = selected_sources; l; l = l->next)
288
 
    {
289
 
      const char *source = l->data;
290
 
 
291
 
      if (!strcmp (source, uid))
292
 
        return TRUE;
293
 
    }
294
 
 
295
 
  return FALSE;
296
 
}
297
 
 
298
 
static char *
299
 
auth_func_cb (ECal       *ecal,
300
 
              const char *prompt,
301
 
              const char *key,
302
 
              gpointer    user_data)
303
 
{
304
 
        ESource *source;
305
 
        const gchar *auth_domain;
306
 
        const gchar *component_name;
307
 
 
308
 
        source = e_cal_get_source (ecal);
309
 
        auth_domain = e_source_get_property (source, "auth-domain");
310
 
        component_name = auth_domain ? auth_domain : "Calendar";
311
 
 
312
 
        return e_passwords_get_password (component_name, key);
313
 
}
314
 
 
315
249
/* The clients are just created here but not loaded */
316
 
static ECal *
317
 
get_ecal_from_source (ESource        *esource,
318
 
                      ECalSourceType  source_type,
319
 
                      GSList         *existing_clients)
 
250
static ECalClient *
 
251
get_ecal_from_source (ESource             *esource,
 
252
                      ECalClientSourceType client_type,
 
253
                      GSList              *existing_clients)
320
254
{
321
 
  ECal *retval;
 
255
  ECalClient *retval;
 
256
  GError *error = NULL;
322
257
 
323
258
  if (existing_clients)
324
259
    {
326
261
 
327
262
      for (l = existing_clients; l; l = l->next)
328
263
        {
329
 
          ECal *client = E_CAL (l->data);
 
264
          ECalClient *client = E_CAL_CLIENT (l->data);
330
265
 
331
 
          if (e_source_equal (esource, e_cal_get_source (client)))
 
266
          if (g_strcmp0 (e_source_get_uid (esource), e_source_get_uid (e_client_get_source (E_CLIENT (client)))))
332
267
            {
333
268
              dprintf ("        load_esource: found existing source ... returning that\n");
334
269
 
337
272
        }
338
273
    }
339
274
 
340
 
  retval = e_cal_new (esource, source_type);
 
275
  retval = e_cal_client_new (esource, client_type, &error);
341
276
  if (!retval)
342
277
    {
343
 
      g_warning ("Could not load source '%s' from '%s'\n",
344
 
                 e_source_peek_name (esource),
345
 
                 e_source_peek_relative_uri (esource));
 
278
      g_warning ("Could not load source '%s' from '%s': %s",
 
279
                 e_source_get_display_name (esource),
 
280
                 e_source_get_uid (esource),
 
281
                 error ? error->message : "Unknown error");
346
282
      return NULL;
347
283
    }
348
284
 
349
 
  e_cal_set_auth_func (retval, auth_func_cb, NULL);
350
 
 
351
285
  return retval;
352
286
}
353
287
 
374
308
}
375
309
 
376
310
static inline void
377
 
debug_dump_selected_sources (GSList *selected_sources)
378
 
{
379
 
#ifdef CALENDAR_ENABLE_DEBUG
380
 
  GSList *l;
381
 
 
382
 
  dprintf ("Selected sources:\n");
383
 
  for (l = selected_sources; l; l = l->next)
384
 
    {
385
 
      char *source = l->data;
386
 
 
387
 
      dprintf ("  %s\n", source);
388
 
    }
389
 
  dprintf ("\n");
390
 
#endif
391
 
}
392
 
 
393
 
static inline void
394
311
debug_dump_ecal_list (GSList *ecal_list)
395
312
{
396
313
#ifdef CALENDAR_ENABLE_DEBUG
399
316
  dprintf ("Loaded clients:\n");
400
317
  for (l = ecal_list; l; l = l->next)
401
318
    {
402
 
      ECal    *client = l->data;
403
 
      ESource *source = e_cal_get_source (client);
 
319
      ECalClient *client = l->data;
 
320
      ESource *source = e_client_get_source (E_CLIENT (client));
404
321
 
405
 
      dprintf ("  %s %s %s\n",
406
 
               e_source_peek_uid (source),
407
 
               e_source_peek_name (source),
408
 
               e_cal_get_uri (client));
 
322
      dprintf ("  %s %s\n",
 
323
               e_source_get_uid (source),
 
324
               e_source_get_display_name (source));
409
325
    }
410
326
#endif
411
327
}
412
328
 
413
329
static void
414
 
calendar_sources_load_esource_list (CalendarSourceData *source_data);
 
330
calendar_sources_load_esources (CalendarSourceData *source_data);
415
331
 
416
332
static gboolean
417
333
backend_restart (gpointer data)
418
334
{
419
335
  CalendarSourceData *source_data = data;
420
336
 
421
 
  calendar_sources_load_esource_list (source_data);
 
337
  calendar_sources_load_esources (source_data);
422
338
 
423
339
  source_data->timeout_id = 0;
424
340
    
426
342
}
427
343
 
428
344
static void
429
 
backend_died_cb (ECal *client, CalendarSourceData *source_data)
 
345
backend_died_cb (ECalClient *client, CalendarSourceData *source_data)
430
346
{
431
 
  const char *uristr;
 
347
  ESource *source;
432
348
 
433
349
  source_data->clients = g_slist_remove (source_data->clients, client);
434
350
  if (g_slist_length (source_data->clients) < 1) 
436
352
      g_slist_free (source_data->clients);
437
353
      source_data->clients = NULL;
438
354
    }
439
 
  uristr = e_cal_get_uri (client);
440
 
  g_warning ("The calendar backend for %s has crashed.", uristr);
 
355
  source = e_client_get_source (E_CLIENT (client));
 
356
  g_warning ("The calendar backend for '%s/%s' has crashed.", e_source_get_uid (source), e_source_get_display_name (source));
441
357
 
442
358
  if (source_data->timeout_id != 0)
443
359
    {
450
366
}
451
367
 
452
368
static void
453
 
calendar_sources_load_esource_list (CalendarSourceData *source_data)
 
369
calendar_sources_load_esources (CalendarSourceData *source_data)
454
370
{
455
371
  GSList  *clients = NULL;
456
 
  GSList  *groups, *l;
 
372
  GSList  *sources, *s;
457
373
  gboolean emit_signal = FALSE;
458
374
 
459
 
  g_return_if_fail (source_data->esource_list != NULL);
460
 
 
461
 
  debug_dump_selected_sources (source_data->selected_sources);
462
 
 
463
 
  dprintf ("Source groups:\n");
464
 
  groups = e_source_list_peek_groups (source_data->esource_list);
465
 
  for (l = groups; l; l = l->next)
 
375
  g_return_if_fail (source_data->esource_selector != NULL);
 
376
 
 
377
  dprintf ("Sources:\n");
 
378
  sources = e_source_selector_get_selection (source_data->esource_selector);
 
379
  for (s = sources; s; s = s->next)
466
380
    {
467
 
      GSList *esources, *s;
468
 
 
469
 
      dprintf ("  %s\n", e_source_group_peek_uid (l->data));
470
 
      dprintf ("    sources:\n");
471
 
 
472
 
      esources = e_source_group_peek_sources (l->data);
473
 
      for (s = esources; s; s = s->next)
474
 
        {
475
 
          ESource *esource = E_SOURCE (s->data);
476
 
          ECal    *client;
477
 
 
478
 
          dprintf ("      type = '%s' uid = '%s', name = '%s', relative uri = '%s': \n",
479
 
                   source_data->source_type == E_CAL_SOURCE_TYPE_EVENT ? "appointment" : "task",
480
 
                   e_source_peek_uid (esource),
481
 
                   e_source_peek_name (esource),
482
 
                   e_source_peek_relative_uri (esource));
483
 
 
484
 
          if (is_source_selected (esource, source_data->selected_sources) &&
485
 
              (client = get_ecal_from_source (esource, source_data->source_type, source_data->clients)))
486
 
            {
487
 
              clients = g_slist_prepend (clients, client);
488
 
            }
489
 
        }
 
381
       ESource *esource = E_SOURCE (s->data);
 
382
       ECalClient *client;
 
383
  
 
384
       dprintf ("   type = '%s' uid = '%s', name = '%s': \n",
 
385
                source_data->client_type == E_CAL_CLIENT_SOURCE_TYPE_EVENTS ? "appointment" : "task",
 
386
                e_source_get_uid (esource),
 
387
                e_source_get_display_name (esource));
 
388
 
 
389
       if ((client = get_ecal_from_source (esource, source_data->client_type, source_data->clients)) != NULL)
 
390
          {
 
391
            clients = g_slist_prepend (clients, client);
 
392
          }
490
393
    }
491
394
  dprintf ("\n");
492
395
 
 
396
  e_source_selector_free_selection (sources);
 
397
 
493
398
  if (source_data->loaded && 
494
399
      !compare_ecal_lists (source_data->clients, clients))
495
400
    emit_signal = TRUE;
496
401
 
497
 
  for (l = source_data->clients; l; l = l->next)
 
402
  for (s = source_data->clients; s; s = s->next)
498
403
    {
499
 
      g_signal_handlers_disconnect_by_func (G_OBJECT (l->data),
 
404
      g_signal_handlers_disconnect_by_func (G_OBJECT (s->data),
500
405
                                            G_CALLBACK (backend_died_cb),
501
406
                                            source_data);
502
407
 
503
 
      g_object_unref (l->data);
 
408
      g_object_unref (s->data);
504
409
    }
505
410
  g_slist_free (source_data->clients);
506
411
  source_data->clients = g_slist_reverse (clients);
508
413
  /* connect to backend_died after we disconnected the previous signal
509
414
   * handlers. If we do it before, we'll lose some handlers (for clients that
510
415
   * were already there before) */
511
 
  for (l = source_data->clients; l; l = l->next)
 
416
  for (s = source_data->clients; s; s = s->next)
512
417
    {
513
 
      g_signal_connect (G_OBJECT (l->data), "backend_died",
 
418
      g_signal_connect (G_OBJECT (s->data), "backend-died",
514
419
                        G_CALLBACK (backend_died_cb), source_data);
515
420
    }
516
421
 
517
422
  if (emit_signal) 
518
423
    {
519
424
      dprintf ("Emitting %s-sources-changed signal\n",
520
 
               source_data->source_type == E_CAL_SOURCE_TYPE_EVENT ? "appointment" : "task");
 
425
               source_data->client_type == E_CAL_CLIENT_SOURCE_TYPE_EVENTS ? "appointment" : "task");
521
426
      g_signal_emit (source_data->sources, source_data->changed_signal, 0);
522
427
    }
523
428
 
525
430
}
526
431
 
527
432
static void
528
 
calendar_sources_esource_list_changed (ESourceList        *source_list,
 
433
calendar_sources_selection_changed_cb (ESourceSelector    *source_selector,
529
434
                                       CalendarSourceData *source_data)
530
435
                                       
531
436
{
532
 
  dprintf ("ESourceList changed, reloading\n");
533
 
 
534
 
  calendar_sources_load_esource_list (source_data);
535
 
}
536
 
 
537
 
static void
538
 
calendar_sources_selected_sources_notify (GConfClient        *client,
539
 
                                          guint               cnx_id,
540
 
                                          GConfEntry         *entry,
541
 
                                          CalendarSourceData *source_data)
542
 
{
543
 
  GSList *l;
544
 
 
545
 
  if (!entry->value ||
546
 
      entry->value->type != GCONF_VALUE_LIST ||
547
 
      gconf_value_get_list_type (entry->value) != GCONF_VALUE_STRING)
548
 
    return;
549
 
 
550
 
  dprintf ("Selected sources key (%s) changed, reloading\n", entry->key);
551
 
 
552
 
  for (l = source_data->selected_sources; l; l = l->next)
553
 
    g_free (l->data);
554
 
  source_data->selected_sources = NULL;
555
 
 
556
 
  for (l = gconf_value_get_list (entry->value); l; l = l->next)
557
 
    {
558
 
      const char *source = gconf_value_get_string (l->data);
559
 
 
560
 
      source_data->selected_sources = 
561
 
        g_slist_prepend (source_data->selected_sources,
562
 
                         g_strdup (source));
563
 
    }
564
 
  source_data->selected_sources =
565
 
    g_slist_reverse (source_data->selected_sources);
566
 
 
567
 
  calendar_sources_load_esource_list (source_data);
 
437
  dprintf ("ESourceSelector selection-changed, reloading\n");
 
438
 
 
439
  calendar_sources_load_esources (source_data);
568
440
}
569
441
 
570
442
static void
571
443
calendar_sources_load_sources (CalendarSources    *sources,
572
444
                               CalendarSourceData *source_data,
573
 
                               const char         *sources_key,
574
 
                               const char         *selected_sources_key,
575
 
                               const char         *selected_sources_dir)
 
445
                               const char         *sources_extension)
576
446
{
577
 
  GConfClient *gconf_client;
578
 
  GError      *error;
 
447
  g_return_if_fail (sources->priv->esource_registry != NULL);
579
448
 
580
449
  dprintf ("---------------------------\n");
581
450
  dprintf ("Loading sources:\n");
582
 
  dprintf ("  sources_key: %s\n", sources_key);
583
 
  dprintf ("  selected_sources_key: %s\n", selected_sources_key);
584
 
  dprintf ("  selected_sources_dir: %s\n", selected_sources_dir);
585
 
 
586
 
  gconf_client = sources->priv->gconf_client;
587
 
 
588
 
  error = NULL;
589
 
  source_data->selected_sources = gconf_client_get_list (gconf_client,
590
 
                                                         selected_sources_key,
591
 
                                                         GCONF_VALUE_STRING,
592
 
                                                         &error);
593
 
  if (error)
594
 
    {
595
 
      g_warning ("Failed to get selected sources from '%s': %s\n",
596
 
                 selected_sources_key,
597
 
                 error->message);
598
 
      g_error_free (error);
599
 
      return;
600
 
    }
601
 
 
602
 
  gconf_client_add_dir (gconf_client,
603
 
                        selected_sources_dir,
604
 
                        GCONF_CLIENT_PRELOAD_NONE,
605
 
                        NULL);
606
 
  source_data->selected_sources_dir = g_strdup (selected_sources_dir);
607
 
 
608
 
  source_data->selected_sources_listener =
609
 
    gconf_client_notify_add (gconf_client,
610
 
                             selected_sources_dir,
611
 
                             (GConfClientNotifyFunc) calendar_sources_selected_sources_notify,
612
 
                             source_data, NULL, NULL);
613
 
 
614
 
  source_data->esource_list = e_source_list_new_for_gconf (gconf_client, sources_key);
615
 
  g_signal_connect (source_data->esource_list, "changed",
616
 
                    G_CALLBACK (calendar_sources_esource_list_changed),
 
451
  dprintf ("  sources_extension: %s\n", sources_extension);
 
452
 
 
453
  source_data->esource_selector = E_SOURCE_SELECTOR (e_source_selector_new (sources->priv->esource_registry, sources_extension));
 
454
  g_signal_connect (source_data->esource_selector, "selection-changed",
 
455
                    G_CALLBACK (calendar_sources_selection_changed_cb),
617
456
                    source_data);
618
457
 
619
 
  calendar_sources_load_esource_list (source_data);
 
458
  calendar_sources_load_esources (source_data);
620
459
 
621
460
  source_data->loaded = TRUE;
622
461
 
632
471
    {
633
472
      calendar_sources_load_sources (sources,
634
473
                                     &sources->priv->appointment_sources,
635
 
                                     CALENDAR_SOURCES_APPOINTMENT_SOURCES_KEY,
636
 
                                     CALENDAR_SOURCES_SELECTED_APPOINTMENT_SOURCES_KEY,
637
 
                                     CALENDAR_SOURCES_SELECTED_APPOINTMENT_SOURCES_DIR);
 
474
                                     E_SOURCE_EXTENSION_CALENDAR);
638
475
    }
639
476
  
640
477
  return sources->priv->appointment_sources.clients;
649
486
    {
650
487
      calendar_sources_load_sources (sources,
651
488
                                     &sources->priv->task_sources,
652
 
                                     CALENDAR_SOURCES_TASK_SOURCES_KEY,
653
 
                                     CALENDAR_SOURCES_SELECTED_TASK_SOURCES_KEY,
654
 
                                     CALENDAR_SOURCES_SELECTED_TASK_SOURCES_DIR);
 
489
                                     E_SOURCE_EXTENSION_TASK_LIST);
655
490
    }
656
491
 
657
492
  return sources->priv->task_sources.clients;