aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--addressbook/ChangeLog7
-rw-r--r--addressbook/gui/component/addressbook-migrate.c25
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