From 79672bdb3b4388763cf08367fc64805138edb4b3 Mon Sep 17 00:00:00 2001 From: Christopher James Lahey Date: Mon, 29 Oct 2001 14:01:57 +0000 Subject: Use the actual ECardName in the ECard instead of parsing the full_name 2001-10-29 Christopher James Lahey * 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. svn path=/trunk/; revision=14338 --- addressbook/ChangeLog | 6 ++++++ addressbook/backend/ebook/e-card-simple.c | 21 +++++++-------------- 2 files changed, 13 insertions(+), 14 deletions(-) (limited to 'addressbook') diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index 2fd1a3580f..03e7057fc0 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,3 +1,9 @@ +2001-10-29 Christopher James Lahey + + * 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 * backend/ebook/e-card-simple.c, backend/ebook/e-card-simple.h 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); } } -- cgit v1.2.3