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 | |
parent | 09b2239379c2020c354b4f591f437499a6440bd4 (diff) | |
download | gsoc2013-evolution-776ddff67439e876b48dc1dfd0545288b42b2498.tar gsoc2013-evolution-776ddff67439e876b48dc1dfd0545288b42b2498.tar.gz gsoc2013-evolution-776ddff67439e876b48dc1dfd0545288b42b2498.tar.bz2 gsoc2013-evolution-776ddff67439e876b48dc1dfd0545288b42b2498.tar.lz gsoc2013-evolution-776ddff67439e876b48dc1dfd0545288b42b2498.tar.xz 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')
-rw-r--r-- | addressbook/ChangeLog | 7 | ||||
-rw-r--r-- | addressbook/gui/component/addressbook-migrate.c | 25 |
2 files changed, 32 insertions, 0 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index ee2c4356b3..5071293cc4 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,5 +1,12 @@ 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. + +2004-06-07 Hans Petter Jansson <hpj@ximian.com> + * gui/Makefile.am (SUBDIRS): Fix order of dependencies. 2004-06-07 H P Nadig <hpnadig@pacific.net.in> 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 |