aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/backend/pas/pas-backend-file.c
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@helixcode.com>2000-04-10 23:46:25 +0800
committerChris Lahey <clahey@src.gnome.org>2000-04-10 23:46:25 +0800
commit99700ad43dcbf0bf95b335a9fc8f95934080d63c (patch)
treed325feef8319087bb323f592da432884d03b6e92 /addressbook/backend/pas/pas-backend-file.c
parentc4f6086c2948f3384dd95393f7ea737db6143682 (diff)
downloadgsoc2013-evolution-99700ad43dcbf0bf95b335a9fc8f95934080d63c.tar
gsoc2013-evolution-99700ad43dcbf0bf95b335a9fc8f95934080d63c.tar.gz
gsoc2013-evolution-99700ad43dcbf0bf95b335a9fc8f95934080d63c.tar.bz2
gsoc2013-evolution-99700ad43dcbf0bf95b335a9fc8f95934080d63c.tar.lz
gsoc2013-evolution-99700ad43dcbf0bf95b335a9fc8f95934080d63c.tar.xz
gsoc2013-evolution-99700ad43dcbf0bf95b335a9fc8f95934080d63c.tar.zst
gsoc2013-evolution-99700ad43dcbf0bf95b335a9fc8f95934080d63c.zip
Fixed a bug where I was sending the wrong information to some callbacks.
2000-04-10 Christopher James Lahey <clahey@helixcode.com> * addressbook/backend/ebook/e-book-view.c: Fixed a bug where I was sending the wrong information to some callbacks. * addressbook/backend/ebook/e-card.c, addressbook/backend/ebook/e-card.h: Added an e_card_duplicate function. Made ids get stored in vcards. Made sure to delete the url if it exists. * addressbook/backend/pas/Makefile.am: Made pas include addressbook/backend/ebook/ in the search path. * addressbook/backend/pas/pas-backend-file.c: Fixed some bugs and made the create card function store the generated id in the card being saved. * addressbook/backend/pas/pas-book-view.c: Fixed a double free bug. * addressbook/contact-editor/e-contact-editor.c: Fixed some bugs. Made the contact editor actually return a valid card when gtk_object_get(editor, "card", ...) is called. * addressbook/contact-editor/e-contact-editor.h: Fixed a copy and paste error. * addressbook/gui/component/addressbook.c: Made this get the card properly. * addressbook/gui/minicard/Makefile.am: Made this include contact-editor directory in the search path and link against libecontacteditor so that double clicking can open a dialog. * addressbook/gui/minicard/e-minicard.c: Fixed some small bugs. Made double clicking open a contact editor dialog if this minicard is contained in a minicard view. (It needs the minicard view to get the EBook to save to. * wombat/Makefile.am: Link wombat against libebook, since pas-backend-file now uses ECard. svn path=/trunk/; revision=2360
Diffstat (limited to 'addressbook/backend/pas/pas-backend-file.c')
-rw-r--r--addressbook/backend/pas/pas-backend-file.c23
1 files changed, 20 insertions, 3 deletions
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);
}