[empathy: 3/8] field_value_is_empty: check that all the values are empty
- From: Guillaume Desmottes <gdesmott src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [empathy: 3/8] field_value_is_empty: check that all the values are empty
- Date: Thu, 4 Nov 2010 08:17:04 +0000 (UTC)
commit 897caa5f59139e690778f006ce69518cc484a25a
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date: Wed Oct 20 12:55:38 2010 +0200
field_value_is_empty: check that all the values are empty
libempathy-gtk/empathy-contact-widget.c | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/libempathy-gtk/empathy-contact-widget.c b/libempathy-gtk/empathy-contact-widget.c
index 6f9b9c6..947fbfa 100644
--- a/libempathy-gtk/empathy-contact-widget.c
+++ b/libempathy-gtk/empathy-contact-widget.c
@@ -149,10 +149,19 @@ enum
static gboolean
field_value_is_empty (TpContactInfoField *field)
{
+ guint i;
+
if (field->field_value == NULL)
return TRUE;
- return field->field_value[0] == NULL;
+ /* Field is empty if all its values are empty */
+ for (i = 0; field->field_value[i] != NULL; i++)
+ {
+ if (!tp_str_empty (field->field_value[i]))
+ return FALSE;
+ }
+
+ return TRUE;
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]