[evolution-ews] EBookBackendSqliteDB: add e_book_backend_sqlitedb_get_contact
- From: Chenthill Palanisamy <pchen src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-ews] EBookBackendSqliteDB: add e_book_backend_sqlitedb_get_contact
- Date: Thu, 19 May 2011 10:34:56 +0000 (UTC)
commit 068107dd3258d1b7ce4a3b6c7a359efd477d1a11
Author: Sean Finney <seanius seanius net>
Date: Thu May 19 15:55:23 2011 +0530
EBookBackendSqliteDB: add e_book_backend_sqlitedb_get_contact
src/addressbook/e-book-backend-sqlitedb.c | 17 +++++++++++++++++
src/addressbook/e-book-backend-sqlitedb.h | 5 +++++
2 files changed, 22 insertions(+), 0 deletions(-)
---
diff --git a/src/addressbook/e-book-backend-sqlitedb.c b/src/addressbook/e-book-backend-sqlitedb.c
index 3a0a38f..4b66cbd 100644
--- a/src/addressbook/e-book-backend-sqlitedb.c
+++ b/src/addressbook/e-book-backend-sqlitedb.c
@@ -748,6 +748,23 @@ get_vcard_cb (gpointer ref, gint col, gchar **cols, gchar **name)
return 0;
}
+EContact *
+e_book_backend_sqlitedb_get_contact (EBookBackendSqliteDB *ebsdb,
+ const gchar *folderid,
+ const gchar *uid,
+ GError **error) {
+ GError *err = NULL;
+ EContact *contact = NULL;
+ gchar *vcard = e_book_backend_sqlitedb_get_vcard_string (ebsdb, folderid, uid, &err);
+ if (!err) {
+ contact = e_contact_new_from_vcard(vcard);
+ g_free (vcard);
+ } else
+ g_propagate_error (error, err);
+
+ return contact;
+}
+
gchar *
e_book_backend_sqlitedb_get_vcard_string (EBookBackendSqliteDB *ebsdb,
const gchar *folderid,
diff --git a/src/addressbook/e-book-backend-sqlitedb.h b/src/addressbook/e-book-backend-sqlitedb.h
index d179a70..a632df0 100644
--- a/src/addressbook/e-book-backend-sqlitedb.h
+++ b/src/addressbook/e-book-backend-sqlitedb.h
@@ -95,6 +95,11 @@ gboolean e_book_backend_sqlitedb_has_contact (EBookBackendSqliteDB *ebsdb,
const gchar *uid,
gboolean *partial_content,
GError **error);
+EContact * e_book_backend_sqlitedb_get_contact
+ (EBookBackendSqliteDB *ebsdb,
+ const gchar *folderid,
+ const gchar *uid,
+ GError **error);
gchar * e_book_backend_sqlitedb_get_vcard_string
(EBookBackendSqliteDB *ebsdb,
const gchar *folderid,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]