diff options
author | Matthew Barnes <mbarnes@src.gnome.org> | 2009-02-01 03:03:12 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@src.gnome.org> | 2009-02-01 03:03:12 +0800 |
commit | fee5916b60c605ff5086d8fdc2a85c5ea21351f6 (patch) | |
tree | 4feaede1cf070448a32bd0ab846908e47747ceb7 /plugins/webdav-account-setup/webdav-contacts-source.c | |
parent | cd5ff486fb02451645f8b4b39608edca2da5e4a2 (diff) | |
download | gsoc2013-evolution-fee5916b60c605ff5086d8fdc2a85c5ea21351f6.tar gsoc2013-evolution-fee5916b60c605ff5086d8fdc2a85c5ea21351f6.tar.gz gsoc2013-evolution-fee5916b60c605ff5086d8fdc2a85c5ea21351f6.tar.bz2 gsoc2013-evolution-fee5916b60c605ff5086d8fdc2a85c5ea21351f6.tar.lz gsoc2013-evolution-fee5916b60c605ff5086d8fdc2a85c5ea21351f6.tar.xz gsoc2013-evolution-fee5916b60c605ff5086d8fdc2a85c5ea21351f6.tar.zst gsoc2013-evolution-fee5916b60c605ff5086d8fdc2a85c5ea21351f6.zip |
Merge revisions 37108:37199 from trunk.
svn path=/branches/kill-bonobo/; revision=37200
Diffstat (limited to 'plugins/webdav-account-setup/webdav-contacts-source.c')
-rw-r--r-- | plugins/webdav-account-setup/webdav-contacts-source.c | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/plugins/webdav-account-setup/webdav-contacts-source.c b/plugins/webdav-account-setup/webdav-contacts-source.c index d85ffa79b6..2242b9050d 100644 --- a/plugins/webdav-account-setup/webdav-contacts-source.c +++ b/plugins/webdav-account-setup/webdav-contacts-source.c @@ -54,6 +54,28 @@ plugin_webdav_contacts(EPlugin *epl, EConfigHookItemFactoryData *data); int e_plugin_lib_enable(EPluginLib *ep, int enable); +static ESourceGroup * +find_webdav_group (ESourceList *slist) +{ + GSList *groups, *g; + ESourceGroup *group = NULL; + + g_return_val_if_fail (slist != NULL, NULL); + + 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) && + g_ascii_strncasecmp (BASE_URI, e_source_group_peek_base_uri (group), strlen (BASE_URI)) == 0) + break; + + group = NULL; + } + + return group; +} + static void ensure_webdav_contacts_source_group(void) { @@ -66,7 +88,7 @@ ensure_webdav_contacts_source_group(void) return; } - group = e_source_list_peek_group_by_name(source_list, _("WebDAV")); + group = find_webdav_group (source_list); if (group == NULL) { gboolean res; @@ -81,7 +103,10 @@ ensure_webdav_contacts_source_group(void) } g_object_unref(group); + } else { + e_source_group_set_name (group, _("WebDAV")); } + g_object_unref(source_list); } @@ -97,7 +122,7 @@ remove_webdav_contacts_source_group(void) return; } - group = e_source_list_peek_group_by_name(source_list, _("WebDAV")); + group = find_webdav_group (source_list); if (group) { GSList *sources; |