diff options
-rw-r--r-- | addressbook/ChangeLog | 6 | ||||
-rw-r--r-- | addressbook/backend/ebook/e-card-simple.c | 21 |
2 files changed, 13 insertions, 14 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index 2fd1a3580f..03e7057fc0 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,5 +1,11 @@ 2001-10-29 Christopher James Lahey <clahey@ximian.com> + * backend/ebook/e-card-simple.c (file_as_get_style, + file_as_set_style): Use the actual ECardName in the ECard instead + of parsing the full_name here. + +2001-10-29 Christopher James Lahey <clahey@ximian.com> + * backend/ebook/e-card-simple.c, backend/ebook/e-card-simple.h (e_card_simple_set_name): New function to set the ECardName on this card and fix the file_as if necessary. diff --git a/addressbook/backend/ebook/e-card-simple.c b/addressbook/backend/ebook/e-card-simple.c index c5c9d38c8c..c7b58f275d 100644 --- a/addressbook/backend/ebook/e-card-simple.c +++ b/addressbook/backend/ebook/e-card-simple.c @@ -939,19 +939,17 @@ file_as_get_style (ECardSimple *simple) { char *filestring = e_card_simple_get(simple, E_CARD_SIMPLE_FIELD_FILE_AS); char *trystring; - char *full_name = e_card_simple_get(simple, E_CARD_SIMPLE_FIELD_FULL_NAME); char *company = e_card_simple_get(simple, E_CARD_SIMPLE_FIELD_ORG); ECardName *name = NULL; int i; int style; style = 0; - if (!full_name) - full_name = g_strdup(""); if (!company) company = g_strdup(""); if (filestring) { - - name = e_card_name_from_string(full_name); + gtk_object_get (GTK_OBJECT (simple->card), + "name", &name, + NULL); if (!name) { goto end; @@ -972,9 +970,7 @@ file_as_get_style (ECardSimple *simple) end: g_free(filestring); - g_free(full_name); g_free(company); - e_card_name_unref(name); return style; } @@ -984,23 +980,20 @@ file_as_set_style(ECardSimple *simple, int style) { if (style != -1) { char *string; - char *full_name = e_card_simple_get(simple, E_CARD_SIMPLE_FIELD_FULL_NAME); char *company = e_card_simple_get(simple, E_CARD_SIMPLE_FIELD_ORG); ECardName *name; - - if (!full_name) - full_name = g_strdup(""); + if (!company) company = g_strdup(""); - name = e_card_name_from_string(full_name); + gtk_object_get (GTK_OBJECT (simple->card), + "name", &name, + NULL); if (name) { string = name_to_style(name, company, style); e_card_simple_set(simple, E_CARD_SIMPLE_FIELD_FILE_AS, string); g_free(string); } - g_free(full_name); g_free(company); - e_card_name_unref(name); } } |