aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-contact-widget.c
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-09-28 22:01:53 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-09-29 17:00:51 +0800
commiteb5008d66b2f55dd9c4f36d69a5a80cc48390f4e (patch)
tree8e6c24b5b97dac800593918ca76635e83164e881 /libempathy-gtk/empathy-contact-widget.c
parent90d9f4f454d2612643f1e17703df02661649ca12 (diff)
downloadgsoc2013-empathy-eb5008d66b2f55dd9c4f36d69a5a80cc48390f4e.tar
gsoc2013-empathy-eb5008d66b2f55dd9c4f36d69a5a80cc48390f4e.tar.gz
gsoc2013-empathy-eb5008d66b2f55dd9c4f36d69a5a80cc48390f4e.tar.bz2
gsoc2013-empathy-eb5008d66b2f55dd9c4f36d69a5a80cc48390f4e.tar.lz
gsoc2013-empathy-eb5008d66b2f55dd9c4f36d69a5a80cc48390f4e.tar.xz
gsoc2013-empathy-eb5008d66b2f55dd9c4f36d69a5a80cc48390f4e.tar.zst
gsoc2013-empathy-eb5008d66b2f55dd9c4f36d69a5a80cc48390f4e.zip
factor out field_value_is_empty()
Diffstat (limited to 'libempathy-gtk/empathy-contact-widget.c')
-rw-r--r--libempathy-gtk/empathy-contact-widget.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/libempathy-gtk/empathy-contact-widget.c b/libempathy-gtk/empathy-contact-widget.c
index 0226f21bd..8734210c8 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);