=?utf-8?q?=5Bevolution-data-server=5D_Bug_661033_=E2=80=94_Add_support_fo?= =?utf-8?q?r_E=5FCONTACT=5FFILE=5FAS_field?=
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] Bug 661033 â Add support for E_CONTACT_FILE_AS field
- Date: Mon, 14 Nov 2011 23:00:42 +0000 (UTC)
commit 31e12b510a566fc4467fc0f46ea32fc5c7d93f37
Author: Philip Withnall <philip tecnocode co uk>
Date: Thu Oct 27 14:02:20 2011 +0100
Bug 661033 â Add support for E_CONTACT_FILE_AS field
Add support for E_CONTACT_FILE_AS to the Google Contacts address book backend
if libgdata â 0.11.0 is available. This doesn't bump EDSâ required libgdata
version.
Closes: bgo#661033
.../backends/google/e-book-backend-google.c | 43 +++++++++++++++++++-
1 files changed, 42 insertions(+), 1 deletions(-)
---
diff --git a/addressbook/backends/google/e-book-backend-google.c b/addressbook/backends/google/e-book-backend-google.c
index 1369e06..927f82c 100644
--- a/addressbook/backends/google/e-book-backend-google.c
+++ b/addressbook/backends/google/e-book-backend-google.c
@@ -1,7 +1,7 @@
/* e-book-backend-google.c - Google contact backendy.
*
* Copyright (C) 2008 Joergen Scheibengruber
- * Copyright (C) 2010 Philip Withnall
+ * Copyright (C) 2010, 2011 Philip Withnall
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by the
@@ -2336,7 +2336,16 @@ e_book_backend_google_get_backend_property (EBookBackend *backend,
E_CONTACT_NOTE,
E_CONTACT_PHOTO,
E_CONTACT_CATEGORIES,
+#if defined(GDATA_CHECK_VERSION)
+#if GDATA_CHECK_VERSION(0, 11, 0)
+ E_CONTACT_CATEGORY_LIST,
+ E_CONTACT_FILE_AS
+#else
E_CONTACT_CATEGORY_LIST
+#endif
+#else
+ E_CONTACT_CATEGORY_LIST
+#endif
};
/* Add all the fields above to the list */
@@ -2651,6 +2660,12 @@ _gdata_entry_update_from_e_contact (EBookBackend *backend,
EContactDate *bdate;
const gchar *url;
+#if defined(GDATA_CHECK_VERSION)
+#if GDATA_CHECK_VERSION(0, 11, 0)
+ const gchar *file_as;
+#endif
+#endif
+
attributes = e_vcard_get_attributes (E_VCARD (contact));
/* N and FN */
@@ -2677,6 +2692,17 @@ _gdata_entry_update_from_e_contact (EBookBackend *backend,
g_object_unref (name);
}
+#if defined(GDATA_CHECK_VERSION)
+#if GDATA_CHECK_VERSION(0, 11, 0)
+ /* File as */
+ file_as = e_contact_get (contact, E_CONTACT_FILE_AS);
+ if (file_as && *file_as)
+ gdata_contacts_contact_set_file_as (GDATA_CONTACTS_CONTACT (entry), file_as);
+ else
+ gdata_contacts_contact_set_file_as (GDATA_CONTACTS_CONTACT (entry), NULL);
+#endif
+#endif
+
/* NOTE */
note = e_contact_get (contact, E_CONTACT_NOTE);
if (note)
@@ -2997,6 +3023,12 @@ _e_contact_new_from_gdata_entry (EBookBackend *backend,
gboolean bdate_has_year;
gboolean have_uri_home = FALSE, have_uri_blog = FALSE;
+#if defined(GDATA_CHECK_VERSION)
+#if GDATA_CHECK_VERSION(0, 11, 0)
+ const gchar *file_as;
+#endif
+#endif
+
uid = gdata_entry_get_id (entry);
if (NULL == uid)
return NULL;
@@ -3026,6 +3058,15 @@ _e_contact_new_from_gdata_entry (EBookBackend *backend,
e_contact_set (E_CONTACT (vcard), E_CONTACT_NAME, &name_struct);
}
+#if defined(GDATA_CHECK_VERSION)
+#if GDATA_CHECK_VERSION(0, 11, 0)
+ /* File as */
+ file_as = gdata_contacts_contact_get_file_as (GDATA_CONTACTS_CONTACT (entry));
+ if (file_as && *file_as)
+ e_contact_set (E_CONTACT (vcard), E_CONTACT_FILE_AS, file_as);
+#endif
+#endif
+
/* NOTE */
note = gdata_entry_get_content (entry);
if (note)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]