aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@ximian.com>2001-05-12 04:28:27 +0800
committerChris Lahey <clahey@src.gnome.org>2001-05-12 04:28:27 +0800
commit10387f75191a34848c5b4657aa1ba0efdc167ce3 (patch)
tree189fef0d1bbcd8d26d9b9b4eeea6dde29548fcf4
parent8b6b6f01bf60cb59124f513f4b3c7c78db46233e (diff)
downloadgsoc2013-evolution-10387f75191a34848c5b4657aa1ba0efdc167ce3.tar
gsoc2013-evolution-10387f75191a34848c5b4657aa1ba0efdc167ce3.tar.gz
gsoc2013-evolution-10387f75191a34848c5b4657aa1ba0efdc167ce3.tar.bz2
gsoc2013-evolution-10387f75191a34848c5b4657aa1ba0efdc167ce3.tar.lz
gsoc2013-evolution-10387f75191a34848c5b4657aa1ba0efdc167ce3.tar.xz
gsoc2013-evolution-10387f75191a34848c5b4657aa1ba0efdc167ce3.tar.zst
gsoc2013-evolution-10387f75191a34848c5b4657aa1ba0efdc167ce3.zip
If the name is set and the full_name or file_as haven't been yet, set
2001-05-11 Christopher James Lahey <clahey@ximian.com> * backend/ebook/e-card.c (e_card_set_arg): If the name is set and the full_name or file_as haven't been yet, set them. svn path=/trunk/; revision=9770
-rw-r--r--addressbook/ChangeLog5
-rw-r--r--addressbook/backend/ebook/e-card.c18
2 files changed, 23 insertions, 0 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index 8959f321cd..09103948ad 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,5 +1,10 @@
2001-05-11 Christopher James Lahey <clahey@ximian.com>
+ * backend/ebook/e-card.c (e_card_set_arg): If the name is set and
+ the full_name or file_as haven't been yet, set them.
+
+2001-05-11 Christopher James Lahey <clahey@ximian.com>
+
* backend/pas/pas-backend-file.c: Reordered the includes here.
(string_to_dbt): The sleepycat libdb documentation suggests
memseting the DBT to 0 so we do that here.
diff --git a/addressbook/backend/ebook/e-card.c b/addressbook/backend/ebook/e-card.c
index eb239ccd76..3845ac8227 100644
--- a/addressbook/backend/ebook/e-card.c
+++ b/addressbook/backend/ebook/e-card.c
@@ -1653,6 +1653,24 @@ e_card_set_arg (GtkObject *object, GtkArg *arg, guint arg_id)
if ( card->name )
e_card_name_free(card->name);
card->name = e_card_name_copy(GTK_VALUE_POINTER(*arg));
+ if (card->name == NULL)
+ card->name = e_card_name_new();
+ if (card->fname == NULL) {
+ card->fname = e_card_name_to_string(card->name);
+ }
+ if (card->file_as == NULL) {
+ ECardName *name = card->name;
+ char *strings[3], **stringptr;
+ char *string;
+ stringptr = strings;
+ if (name->family && *name->family)
+ *(stringptr++) = name->family;
+ if (name->given && *name->given)
+ *(stringptr++) = name->given;
+ *stringptr = NULL;
+ string = g_strjoinv(", ", strings);
+ card->file_as = string;
+ }
break;
case ARG_CATEGORIES:
if (card->categories)