aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2011-06-01 17:06:28 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2011-06-01 17:48:49 +0800
commitdb6773ebf31853608353b1bb156156879b303569 (patch)
treef5f14546828f7ffdf42a11fc40a34f1e05ac437c /src
parentcc6c2b5423c3a1906b5f484c157bc67dd9ee9d86 (diff)
downloadgsoc2013-empathy-db6773ebf31853608353b1bb156156879b303569.tar.gz
gsoc2013-empathy-db6773ebf31853608353b1bb156156879b303569.tar.zst
gsoc2013-empathy-db6773ebf31853608353b1bb156156879b303569.zip
allow user to search for contacts using their full identifier
Diffstat (limited to 'src')
-rw-r--r--src/empathy-invite-participant-dialog.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/empathy-invite-participant-dialog.c b/src/empathy-invite-participant-dialog.c
index 7dfb338d0..a28c513ef 100644
--- a/src/empathy-invite-participant-dialog.c
+++ b/src/empathy-invite-participant-dialog.c
@@ -35,6 +35,7 @@ struct _EmpathyInviteParticipantDialogPrivate
GtkWidget *invite_button;
GPtrArray *search_words;
+ gchar *search_str;
};
static void
@@ -87,6 +88,7 @@ invite_participant_dialog_dispose (GObject *object)
tp_clear_object (&self->priv->tp_chat);
tp_clear_object (&self->priv->store);
tp_clear_pointer (&self->priv->search_words, g_ptr_array_unref);
+ tp_clear_pointer (&self->priv->search_str, g_free);
G_OBJECT_CLASS (empathy_invite_participant_dialog_parent_class)->dispose (
object);
@@ -189,8 +191,8 @@ filter_func (GtkTreeModel *model,
}
else
{
- if (!empathy_individual_match_words (individual,
- self->priv->search_words))
+ if (!empathy_individual_match_string (individual,
+ self->priv->search_str, self->priv->search_words))
goto out;
}
@@ -237,10 +239,15 @@ static void
search_text_changed (GtkEntry *entry,
EmpathyInviteParticipantDialog *self)
{
+ const gchar *id;
+
tp_clear_pointer (&self->priv->search_words, g_ptr_array_unref);
+ tp_clear_pointer (&self->priv->search_str, g_free);
+
+ id = gtk_entry_get_text (entry);
- self->priv->search_words = empathy_live_search_strip_utf8_string (
- gtk_entry_get_text (entry));
+ self->priv->search_words = empathy_live_search_strip_utf8_string (id);
+ self->priv->search_str = g_strdup (id);
empathy_individual_view_refilter (self->priv->view);
}