diff options
author | Hans Petter Jansson <hpj@ximian.com> | 2004-06-08 10:39:00 +0800 |
---|---|---|
committer | Hans Petter <hansp@src.gnome.org> | 2004-06-08 10:39:00 +0800 |
commit | 776ddff67439e876b48dc1dfd0545288b42b2498 (patch) | |
tree | 9f12c7db11b5c3a7a48e23ae0abf84a9bc6f273f /addressbook/gui/component/addressbook-migrate.c | |
parent | 09b2239379c2020c354b4f591f437499a6440bd4 (diff) | |
download | gsoc2013-evolution-776ddff67439e876b48dc1dfd0545288b42b2498.tar.gz gsoc2013-evolution-776ddff67439e876b48dc1dfd0545288b42b2498.tar.zst gsoc2013-evolution-776ddff67439e876b48dc1dfd0545288b42b2498.zip |
Fixes #57795.
2004-06-07 Hans Petter Jansson <hpj@ximian.com>
Fixes #57795.
* gui/component/addressbook-migrate.c (migrate_contacts): Change
the "POSTAL" address in 1.4 to "OTHER" in 1.5.
svn path=/trunk/; revision=26243
Diffstat (limited to 'addressbook/gui/component/addressbook-migrate.c')
-rw-r--r-- | addressbook/gui/component/addressbook-migrate.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/addressbook/gui/component/addressbook-migrate.c b/addressbook/gui/component/addressbook-migrate.c index ae50765225..859b71103f 100644 --- a/addressbook/gui/component/addressbook-migrate.c +++ b/addressbook/gui/component/addressbook-migrate.c @@ -300,6 +300,31 @@ migrate_contacts (MigrationContext *context, EBook *old_book, EBook *new_book) "VOICE"); attr = attr->next; } + /* Replace "POSTAL" (1.4) addresses with "OTHER" (1.5) */ + else if (!strcmp ("ADR", e_vcard_attribute_get_name (a))) { + GList *params, *param; + gboolean found = FALSE; + EVCardAttributeParam *p; + + params = e_vcard_attribute_get_params (a); + for (param = params; param; param = param->next) { + p = param->data; + if (!strcmp (EVC_TYPE, e_vcard_attribute_param_get_name (p))) { + GList *v = e_vcard_attribute_param_get_values (p); + if (v && v->data && !strcmp ("POSTAL", v->data)) { + found = TRUE; + break; + } + } + } + + if (found) { + e_vcard_attribute_param_remove_values (p); + e_vcard_attribute_param_add_value (p, "OTHER"); + } + + attr = attr->next; + } /* this is kinda gross. The new vcard parser needs ';'s to be escaped by \'s. but the 1.4 vcard generator would put unescaped xml |