aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog9
-rw-r--r--addressbook/backend/ebook/e-book.c2
-rw-r--r--addressbook/backend/ebook/e-card.c19
-rw-r--r--addressbook/backend/ebook/e-card.h2
4 files changed, 30 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index b0c2c9e311..e22f47993f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2000-03-26 Christopher James Lahey <clahey@helixcode.com>
+
+ * addressbook/backend/ebook/e-book.c: Set the card id properly
+ when retrieving a card.
+
+ * addressbook/backend/ebook/e-card.c,
+ addressbook/backend/ebook/e-card.h: Added the ability to set the
+ card's id (and made getting it work correctly also.)
+
2000-03-25 Chris Toshok <toshok@laptoph.xtoph.org>
* addressbook/backend/ebook/e-book.c (e_book_pop_op): pass GList*
diff --git a/addressbook/backend/ebook/e-book.c b/addressbook/backend/ebook/e-book.c
index 6d0a3394c2..16819c334a 100644
--- a/addressbook/backend/ebook/e-book.c
+++ b/addressbook/backend/ebook/e-book.c
@@ -414,6 +414,8 @@ e_book_get_card (EBook *book,
card = e_card_new (vcard);
g_free(vcard);
+
+ e_card_set_id(card, id);
return card;
}
diff --git a/addressbook/backend/ebook/e-card.c b/addressbook/backend/ebook/e-card.c
index 88205fad53..c259ea5193 100644
--- a/addressbook/backend/ebook/e-card.c
+++ b/addressbook/backend/ebook/e-card.c
@@ -123,9 +123,18 @@ ECard *e_card_new (char *vcard)
return card;
}
-char *e_card_get_id (ECard *card)
+char *
+e_card_get_id (ECard *card)
+{
+ return card->id;
+}
+
+void
+e_card_set_id (ECard *card, char *id)
{
- return NULL;
+ if ( card->id )
+ g_free(card->id);
+ card->id = g_strdup(id);
}
char *e_card_get_vcard (ECard *card)
@@ -478,16 +487,21 @@ static void
e_card_destroy (GtkObject *object)
{
ECard *card = E_CARD(object);
+ if ( card->id )
+ g_free(card->id);
if ( card->fname )
g_free(card->fname);
if ( card->name )
e_card_name_free(card->name);
if ( card->bday )
g_free(card->bday);
+
g_list_foreach(card->email, (GFunc)g_free, NULL);
g_list_free(card->email);
+
g_list_foreach(card->phone, (GFunc)e_card_phone_free, NULL);
g_list_free(card->phone);
+
g_list_foreach(card->address, (GFunc)e_card_delivery_address_free, NULL);
g_list_free(card->address);
}
@@ -580,6 +594,7 @@ e_card_get_arg (GtkObject *object, GtkArg *arg, guint arg_id)
static void
e_card_init (ECard *card)
{
+ card->id = g_strdup("");
card->fname = NULL;
card->name = NULL;
diff --git a/addressbook/backend/ebook/e-card.h b/addressbook/backend/ebook/e-card.h
index 04c3cd2a96..b5abf34e24 100644
--- a/addressbook/backend/ebook/e-card.h
+++ b/addressbook/backend/ebook/e-card.h
@@ -28,6 +28,7 @@ typedef struct _ECardClass ECardClass;
struct _ECard {
GtkObject object;
+ char *id;
char *fname; /* The full name. */
ECardName *name; /* The structured name. */
@@ -85,6 +86,7 @@ struct _ECardClass {
ECard *e_card_new (char *vcard);
char *e_card_get_id (ECard *card);
+void e_card_set_id (ECard *card, gchar *character);
char *e_card_get_vcard (ECard *card);
/* Standard Gtk function */