aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/caldav/caldav-source.c
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2009-04-25 01:40:31 +0800
committerMilan Crha <mcrha@redhat.com>2009-04-25 01:40:31 +0800
commit2403bbcdd196745314786af3b6318de56ef3948e (patch)
treea40b172dec814a8f7c214979c7735a46d2c73c08 /plugins/caldav/caldav-source.c
parent23df769955ea54f756a579c19964df87ae6fd5c8 (diff)
downloadgsoc2013-evolution-2403bbcdd196745314786af3b6318de56ef3948e.tar.gz
gsoc2013-evolution-2403bbcdd196745314786af3b6318de56ef3948e.tar.zst
gsoc2013-evolution-2403bbcdd196745314786af3b6318de56ef3948e.zip
Use new ESourceList API (simplifies code)
** Part of fix for bug #569652
Diffstat (limited to 'plugins/caldav/caldav-source.c')
-rw-r--r--plugins/caldav/caldav-source.c32
1 files changed, 1 insertions, 31 deletions
diff --git a/plugins/caldav/caldav-source.c b/plugins/caldav/caldav-source.c
index 00ca5acac5..46e510367f 100644
--- a/plugins/caldav/caldav-source.c
+++ b/plugins/caldav/caldav-source.c
@@ -55,43 +55,13 @@ static void
ensure_caldav_source_group (ECalSourceType source_type)
{
ESourceList *slist;
- GSList *groups, *g;
- ESourceGroup *group = NULL;
if (!e_cal_get_sources (&slist, source_type, NULL)) {
g_warning ("Could not get calendar source list from GConf!");
return;
}
- groups = e_source_list_peek_groups (slist);
- for (g = groups; g; g = g->next) {
- group = E_SOURCE_GROUP (g->data);
-
- if (group && e_source_group_peek_base_uri (group) && strncmp ("caldav://", e_source_group_peek_base_uri (group), 9) == 0)
- break;
-
- group = NULL;
- }
-
- if (group == NULL) {
- /* no such group has been found, create it */
- gboolean res;
-
- group = e_source_group_new (_("CalDAV"), "caldav://");
- res = e_source_list_add_group (slist, group, -1);
-
- if (res == FALSE) {
- g_warning ("Could not add CalDAV source group!");
- } else {
- e_source_list_sync (slist, NULL);
- }
-
- g_object_unref (group);
- } else {
- /* we found the group, change the name based on the actual language */
- e_source_group_set_name (group, _("CalDAV"));
- }
-
+ e_source_list_ensure_group (slist, _("CalDAV"), "caldav://", FALSE);
g_object_unref (slist);
}