diff options
Diffstat (limited to 'addressbook/backend/pas')
-rw-r--r-- | addressbook/backend/pas/Makefile.am | 1 | ||||
-rw-r--r-- | addressbook/backend/pas/pas-backend-file.c | 23 | ||||
-rw-r--r-- | addressbook/backend/pas/pas-book-view.c | 2 |
3 files changed, 22 insertions, 4 deletions
diff --git a/addressbook/backend/pas/Makefile.am b/addressbook/backend/pas/Makefile.am index b8e478f1b3..62207b5963 100644 --- a/addressbook/backend/pas/Makefile.am +++ b/addressbook/backend/pas/Makefile.am @@ -24,6 +24,7 @@ INCLUDES = \ -I.. \ -I$(top_builddir) \ -I$(includedir) \ + -I$(top_srcdir)/addressbook/backend/ebook \ $(GNOME_INCLUDEDIR) gnome_libs = \ diff --git a/addressbook/backend/pas/pas-backend-file.c b/addressbook/backend/pas/pas-backend-file.c index 935dab19d5..0dcf745d38 100644 --- a/addressbook/backend/pas/pas-backend-file.c +++ b/addressbook/backend/pas/pas-backend-file.c @@ -19,6 +19,7 @@ #include <pas-backend-file.h> #include <pas-book.h> #include <pas-card-cursor.h> +#include <e-card.h> #define PAS_BACKEND_FILE_VERSION_NAME "PAS-DB-VERSION" #define PAS_BACKEND_FILE_VERSION "0.1" @@ -153,11 +154,20 @@ pas_backend_file_process_create_card (PASBackend *backend, int db_error; char *id; GList *list; + ECard *card; + char *vcard; id = pas_backend_file_create_unique_id (req->vcard); string_to_dbt (id, &id_dbt); - string_to_dbt (req->vcard, &vcard_dbt); + + card = e_card_new(req->vcard); + e_card_set_id(card, id); + vcard = e_card_get_vcard(card); + gtk_object_unref(GTK_OBJECT(card)); + card = NULL; + + string_to_dbt (vcard, &vcard_dbt); db_error = db->put (db, &id_dbt, &vcard_dbt, 0); @@ -187,6 +197,7 @@ pas_backend_file_process_create_card (PASBackend *backend, } g_free (id); + g_free (vcard); g_free (req->vcard); } @@ -239,8 +250,13 @@ pas_backend_file_process_modify_card (PASBackend *backend, DBT id_dbt, vcard_dbt; int db_error; GList *list; + ECard *card; + char *id; - string_to_dbt (req->id, &id_dbt); + card = e_card_new(req->vcard); + id = e_card_get_id(card); + + string_to_dbt (id, &id_dbt); string_to_dbt (req->vcard, &vcard_dbt); db_error = db->put (db, &id_dbt, &vcard_dbt, 0); @@ -253,7 +269,7 @@ pas_backend_file_process_modify_card (PASBackend *backend, /* else if (card changes to match view->search ) pas_book_view_notify_add_1 (view->book_view, req->vcard); else if (card changes to not match view->search ) - pas_book_view_notify_remove (view->book_view, req->id); + pas_book_view_notify_remove (view->book_view, id); */ } @@ -271,6 +287,7 @@ pas_backend_file_process_modify_card (PASBackend *backend, Evolution_BookListener_CardNotFound); } + gtk_object_unref(GTK_OBJECT(card)); g_free (req->vcard); } diff --git a/addressbook/backend/pas/pas-book-view.c b/addressbook/backend/pas/pas-book-view.c index f712cc8ccf..e59028f88a 100644 --- a/addressbook/backend/pas/pas-book-view.c +++ b/addressbook/backend/pas/pas-book-view.c @@ -33,7 +33,7 @@ pas_book_view_notify_change (PASBookView *book_view, card_sequence._length = length; for ( i = 0; cards; cards = g_list_next(cards), i++ ) { - card_sequence._buffer[i] = (char *) cards->data; + card_sequence._buffer[i] = CORBA_string_dup((char *) cards->data); } CORBA_exception_init (&ev); |