[empathy] factor out field_value_is_empty()
- From: Guillaume Desmottes <gdesmott src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [empathy] factor out field_value_is_empty()
- Date: Wed, 29 Sep 2010 09:02:50 +0000 (UTC)
commit eb5008d66b2f55dd9c4f36d69a5a80cc48390f4e
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date: Tue Sep 28 16:01:53 2010 +0200
factor out field_value_is_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 0226f21..8734210 100644
--- a/libempathy-gtk/empathy-contact-widget.c
+++ b/libempathy-gtk/empathy-contact-widget.c
@@ -147,6 +147,15 @@ enum
COL_COUNT
};
+static gboolean
+field_value_is_empty (TpContactInfoField *field)
+{
+ if (field->field_value == NULL)
+ return TRUE;
+
+ return EMP_STR_EMPTY (field->field_value[0]);
+}
+
static void
contact_widget_save (EmpathyContactWidget *information)
{
@@ -161,7 +170,7 @@ contact_widget_save (EmpathyContactWidget *information)
TpContactInfoField *field = l->data;
next = l->next;
- if (field->field_value == NULL || EMP_STR_EMPTY (field->field_value[0]))
+ if (field_value_is_empty (field))
{
DEBUG ("Drop empty field: %s", field->field_name);
tp_contact_info_field_free (field);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]