aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/backend
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@helixcode.com>2000-05-09 13:34:02 +0800
committerChris Lahey <clahey@src.gnome.org>2000-05-09 13:34:02 +0800
commit32d76b8032a8c42b6fda2ccdded568b8bdea2eeb (patch)
treef2043e2b6e28b5a209525eb472fbe695903de5e1 /addressbook/backend
parentc6de9ace9fe9b4a438583ed143f9b3b99211091d (diff)
downloadgsoc2013-evolution-32d76b8032a8c42b6fda2ccdded568b8bdea2eeb.tar
gsoc2013-evolution-32d76b8032a8c42b6fda2ccdded568b8bdea2eeb.tar.gz
gsoc2013-evolution-32d76b8032a8c42b6fda2ccdded568b8bdea2eeb.tar.bz2
gsoc2013-evolution-32d76b8032a8c42b6fda2ccdded568b8bdea2eeb.tar.lz
gsoc2013-evolution-32d76b8032a8c42b6fda2ccdded568b8bdea2eeb.tar.xz
gsoc2013-evolution-32d76b8032a8c42b6fda2ccdded568b8bdea2eeb.tar.zst
gsoc2013-evolution-32d76b8032a8c42b6fda2ccdded568b8bdea2eeb.zip
Fixed the string duplication problem. Fixed the business/home address
2000-05-09 Christopher James Lahey <clahey@helixcode.com> * backend/ebook/e-card-simple.c: Fixed the string duplication problem. Fixed the business/home address string mix up. * gui/component/addressbook.c: Made the minicard view the default view. svn path=/trunk/; revision=2932
Diffstat (limited to 'addressbook/backend')
-rw-r--r--addressbook/backend/ebook/e-card-simple.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/addressbook/backend/ebook/e-card-simple.c b/addressbook/backend/ebook/e-card-simple.c
index e6a043ab9e..14b4719c33 100644
--- a/addressbook/backend/ebook/e-card-simple.c
+++ b/addressbook/backend/ebook/e-card-simple.c
@@ -80,8 +80,8 @@ static ECardSimpleFieldData field_data[] =
{ E_CARD_SIMPLE_FIELD_PHONE_BUSINESS, "", "Business", "Bus", E_CARD_SIMPLE_PHONE_ID_BUSINESS, E_CARD_SIMPLE_INTERNAL_TYPE_PHONE },
{ E_CARD_SIMPLE_FIELD_PHONE_HOME, "", "Home", "Home", E_CARD_SIMPLE_PHONE_ID_HOME, E_CARD_SIMPLE_INTERNAL_TYPE_PHONE },
{ E_CARD_SIMPLE_FIELD_ORG, "org", "Organization", "Org", 0, E_CARD_SIMPLE_INTERNAL_TYPE_STRING },
- { E_CARD_SIMPLE_FIELD_ADDRESS_BUSINESS, "", "Business", "Bus", E_CARD_SIMPLE_ADDRESS_ID_HOME, E_CARD_SIMPLE_INTERNAL_TYPE_ADDRESS },
- { E_CARD_SIMPLE_FIELD_ADDRESS_HOME, "", "Home", "Home", E_CARD_SIMPLE_ADDRESS_ID_BUSINESS, E_CARD_SIMPLE_INTERNAL_TYPE_ADDRESS },
+ { E_CARD_SIMPLE_FIELD_ADDRESS_BUSINESS, "", "Business", "Bus", E_CARD_SIMPLE_ADDRESS_ID_BUSINESS, E_CARD_SIMPLE_INTERNAL_TYPE_ADDRESS },
+ { E_CARD_SIMPLE_FIELD_ADDRESS_HOME, "", "Home", "Home", E_CARD_SIMPLE_ADDRESS_ID_HOME, E_CARD_SIMPLE_INTERNAL_TYPE_ADDRESS },
{ E_CARD_SIMPLE_FIELD_PHONE_MOBILE, "", "Mobile", "Mobile", E_CARD_SIMPLE_PHONE_ID_MOBILE, E_CARD_SIMPLE_INTERNAL_TYPE_PHONE },
{ E_CARD_SIMPLE_FIELD_PHONE_CAR, "", "Car", "Car", E_CARD_SIMPLE_PHONE_ID_CAR, E_CARD_SIMPLE_INTERNAL_TYPE_PHONE },
{ E_CARD_SIMPLE_FIELD_PHONE_BUSINESS_FAX, "", "Business Fax", "Bus Fax", E_CARD_SIMPLE_PHONE_ID_BUSINESS_FAX, E_CARD_SIMPLE_INTERNAL_TYPE_PHONE },
@@ -634,6 +634,7 @@ fill_in_info(ECardSimple *simple)
const ECardPhone *phone;
const char *email;
const ECardAddrLabel *address;
+ int i;
ECardIterator *iterator;
@@ -642,8 +643,11 @@ fill_in_info(ECardSimple *simple)
"phone", &phone_list,
"email", &email_list,
NULL);
+ for (i = 0; i < E_CARD_SIMPLE_PHONE_ID_LAST; i++) {
+ e_card_phone_free(simple->phone[i]);
+ simple->phone[i] = NULL;
+ }
for (iterator = e_card_list_get_iterator(phone_list); e_card_iterator_is_valid(iterator); e_card_iterator_next(iterator)) {
- int i;
phone = e_card_iterator_get(iterator);
for (i = 0; i < E_CARD_SIMPLE_PHONE_ID_LAST; i ++) {
if (((phone->flags & phone_correspondences[i]) == phone_correspondences[i]) && (simple->phone[i] == NULL)) {
@@ -654,8 +658,11 @@ fill_in_info(ECardSimple *simple)
}
gtk_object_unref(GTK_OBJECT(iterator));
+ for (i = 0; i < E_CARD_SIMPLE_EMAIL_ID_LAST; i++) {
+ g_free(simple->email[i]);
+ simple->email[i] = NULL;
+ }
for (iterator = e_card_list_get_iterator(email_list); e_card_iterator_is_valid(iterator); e_card_iterator_next(iterator)) {
- int i;
email = e_card_iterator_get(iterator);
for (i = 0; i < E_CARD_SIMPLE_EMAIL_ID_LAST; i ++) {
if ((simple->email[i] == NULL)) {
@@ -666,8 +673,11 @@ fill_in_info(ECardSimple *simple)
}
gtk_object_unref(GTK_OBJECT(iterator));
+ for (i = 0; i < E_CARD_SIMPLE_ADDRESS_ID_LAST; i++) {
+ e_card_address_label_free(simple->address[i]);
+ simple->address[i] = NULL;
+ }
for (iterator = e_card_list_get_iterator(address_list); e_card_iterator_is_valid(iterator); e_card_iterator_next(iterator)) {
- int i;
address = e_card_iterator_get(iterator);
for (i = 0; i < E_CARD_SIMPLE_ADDRESS_ID_LAST; i ++) {
if (((address->flags & addr_correspondences[i]) == addr_correspondences[i]) && (simple->address[i] == NULL)) {
@@ -790,6 +800,7 @@ e_card_simple_sync_card(ECardSimple *simple)
simple->address[i] = NULL;
}
}
+ fill_in_info(simple);
}
}