[evolution-data-server/gnome-3-2] Contacts calendar - consider also other than only file-as field
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server/gnome-3-2] Contacts calendar - consider also other than only file-as field
- Date: Tue, 13 Dec 2011 12:25:38 +0000 (UTC)
commit 302e010735379c94c614c12d42a172848d621703
Author: Milan Crha <mcrha redhat com>
Date: Tue Dec 13 13:25:10 2011 +0100
Contacts calendar - consider also other than only file-as field
.../backends/contacts/e-cal-backend-contacts.c | 19 ++++++++++++++++++-
1 files changed, 18 insertions(+), 1 deletions(-)
---
diff --git a/calendar/backends/contacts/e-cal-backend-contacts.c b/calendar/backends/contacts/e-cal-backend-contacts.c
index e3994f9..dca655b 100644
--- a/calendar/backends/contacts/e-cal-backend-contacts.c
+++ b/calendar/backends/contacts/e-cal-backend-contacts.c
@@ -132,7 +132,12 @@ book_record_new (ECalBackendContacts *cbc,
}
query = e_book_query_andv (
- e_book_query_field_exists (E_CONTACT_FILE_AS),
+ e_book_query_orv (
+ e_book_query_field_exists (E_CONTACT_FILE_AS),
+ e_book_query_field_exists (E_CONTACT_FULL_NAME),
+ e_book_query_field_exists (E_CONTACT_GIVEN_NAME),
+ e_book_query_field_exists (E_CONTACT_NICKNAME),
+ NULL),
e_book_query_orv (
e_book_query_field_exists (E_CONTACT_BIRTH_DATE),
e_book_query_field_exists (E_CONTACT_ANNIVERSARY),
@@ -791,6 +796,12 @@ create_birthday (ECalBackendContacts *cbc,
cdate = e_contact_get (contact, E_CONTACT_BIRTH_DATE);
name = e_contact_get_const (contact, E_CONTACT_FILE_AS);
+ if (!name || !*name)
+ name = e_contact_get_const (contact, E_CONTACT_FULL_NAME);
+ if (!name || !*name)
+ name = e_contact_get_const (contact, E_CONTACT_NICKNAME);
+ if (!name)
+ name = "";
uid = g_strdup_printf ("%s%s", (gchar *) e_contact_get_const (contact, E_CONTACT_UID), BIRTHDAY_UID_EXT);
summary = g_strdup_printf (_("Birthday: %s"), name);
@@ -816,6 +827,12 @@ create_anniversary (ECalBackendContacts *cbc,
cdate = e_contact_get (contact, E_CONTACT_ANNIVERSARY);
name = e_contact_get_const (contact, E_CONTACT_FILE_AS);
+ if (!name || !*name)
+ name = e_contact_get_const (contact, E_CONTACT_FULL_NAME);
+ if (!name || !*name)
+ name = e_contact_get_const (contact, E_CONTACT_NICKNAME);
+ if (!name)
+ name = "";
uid = g_strdup_printf ("%s%s", (gchar *) e_contact_get_const (contact, E_CONTACT_UID), ANNIVERSARY_UID_EXT);
summary = g_strdup_printf (_("Anniversary: %s"), name);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]