[evolution-data-server/gnome-3-2] Bug #652173 - EContact's file-as getter doesn't populate empty value
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server/gnome-3-2] Bug #652173 - EContact's file-as getter doesn't populate empty value
- Date: Tue, 13 Dec 2011 12:10:10 +0000 (UTC)
commit d072dd312f50e3d3444bc14977f0cd2b022f9667
Author: Milan Crha <mcrha redhat com>
Date: Tue Dec 13 13:09:35 2011 +0100
Bug #652173 - EContact's file-as getter doesn't populate empty value
addressbook/libebook/e-contact.c | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/addressbook/libebook/e-contact.c b/addressbook/libebook/e-contact.c
index b9fdf41..f938dd8 100644
--- a/addressbook/libebook/e-contact.c
+++ b/addressbook/libebook/e-contact.c
@@ -566,7 +566,15 @@ static gpointer
fileas_getter (EContact *contact,
EVCardAttribute *attr)
{
- if (!attr) {
+ GList *p = NULL;
+
+ if (attr) {
+ p = e_vcard_attribute_get_values (attr);
+ if (!p || !p->data || !*((const gchar *) p->data))
+ p = NULL;
+ }
+
+ if (!p) {
/* Generate a FILE_AS field */
EContactName *name;
gchar *new_file_as = NULL;
@@ -609,7 +617,7 @@ fileas_getter (EContact *contact,
}
if (attr) {
- GList *p = e_vcard_attribute_get_values (attr);
+ p = e_vcard_attribute_get_values (attr);
return p && p->data ? p->data : (gpointer) "";
} else {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]