From 4fd6c59d453fd305aef077cff76fee715a44a7a7 Mon Sep 17 00:00:00 2001 From: Rodney Dawes Date: Tue, 13 Jul 2004 20:47:27 +0000 Subject: [ fixes #56657 ] 2004-07-13 Rodney Dawes [ fixes #56657 ] * gui/component/addressbook-migrate.c (get_source_by_uri): Replace this call with get_source_by_name () (migrate_completion_folders): Fix the non-local folder migration to look up sources for the migrated folders based on name, instead of using the URI svn path=/trunk/; revision=26643 --- addressbook/gui/component/addressbook-migrate.c | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) (limited to 'addressbook/gui') diff --git a/addressbook/gui/component/addressbook-migrate.c b/addressbook/gui/component/addressbook-migrate.c index 39ff162457..230dc8dd51 100644 --- a/addressbook/gui/component/addressbook-migrate.c +++ b/addressbook/gui/component/addressbook-migrate.c @@ -698,7 +698,7 @@ migrate_ldap_servers (MigrationContext *context, ESourceGroup *on_ldap_servers) } static ESource* -get_source_by_uri (ESourceList *source_list, const char *uri) +get_source_by_name (ESourceList *source_list, const char *name) { GSList *groups; GSList *g; @@ -718,14 +718,9 @@ get_source_by_uri (ESourceList *source_list, const char *uri) for (s = sources; s; s = s->next) { ESource *source = E_SOURCE (s->data); - char *source_uri = e_source_get_uri (source); - gboolean found = FALSE; + const char *source_name = e_source_peek_name (source); - if (!strcmp (uri, source_uri)) - found = TRUE; - - g_free (source_uri); - if (found) + if (!strcmp (name, source_name)) return source; } } @@ -782,16 +777,11 @@ migrate_completion_folders (MigrationContext *context) source = e_source_list_peek_source_by_uid (context->source_list, uid); } else { - char *uri; - char *semi = strchr (physical_uri, ';'); - if (semi) - uri = g_strndup (physical_uri, semi - physical_uri); - else - uri = g_strdup (physical_uri); + char *name = e_xml_get_string_prop_by_name (child, "display-name"); - source = get_source_by_uri (context->source_list, uri); + source = get_source_by_name (context->source_list, name); - g_free (uri); + g_free (name); } if (source) { -- cgit v1.2.3