aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
authorDanielle Madeley <danielle.madeley@collabora.co.uk>2009-12-18 14:53:51 +0800
committerDanielle Madeley <danielle.madeley@collabora.co.uk>2009-12-19 07:48:56 +0800
commitd9406c1b700fdc1fcd4a4030b9013a4d999e8808 (patch)
tree3489bc04f73d4cd437bfddfbb2d8a76ff6abe4c0 /libempathy-gtk
parentef8f800b78bcf4795a9d9c01e21390c62663524b (diff)
downloadgsoc2013-empathy-d9406c1b700fdc1fcd4a4030b9013a4d999e8808.tar
gsoc2013-empathy-d9406c1b700fdc1fcd4a4030b9013a4d999e8808.tar.gz
gsoc2013-empathy-d9406c1b700fdc1fcd4a4030b9013a4d999e8808.tar.bz2
gsoc2013-empathy-d9406c1b700fdc1fcd4a4030b9013a4d999e8808.tar.lz
gsoc2013-empathy-d9406c1b700fdc1fcd4a4030b9013a4d999e8808.tar.xz
gsoc2013-empathy-d9406c1b700fdc1fcd4a4030b9013a4d999e8808.tar.zst
gsoc2013-empathy-d9406c1b700fdc1fcd4a4030b9013a4d999e8808.zip
[EmpathyContactSelectorDialog] normalise case in match function
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/empathy-contact-selector-dialog.c36
1 files changed, 21 insertions, 15 deletions
diff --git a/libempathy-gtk/empathy-contact-selector-dialog.c b/libempathy-gtk/empathy-contact-selector-dialog.c
index d0246e86b..2793567f1 100644
--- a/libempathy-gtk/empathy-contact-selector-dialog.c
+++ b/libempathy-gtk/empathy-contact-selector-dialog.c
@@ -167,32 +167,38 @@ contact_selector_dialog_match_func (GtkEntryCompletion *completion,
gpointer user_data)
{
GtkTreeModel *model;
- gchar *id;
- gchar *name;
+ gchar *str, *lower;
+ gboolean v = FALSE;
model = gtk_entry_completion_get_model (completion);
if (!model || !iter)
return FALSE;
- gtk_tree_model_get (model, iter, COMPLETION_COL_NAME, &name, -1);
- if (strstr (name, key))
+ gtk_tree_model_get (model, iter, COMPLETION_COL_NAME, &str, -1);
+ lower = g_utf8_strdown (str, -1);
+ if (strstr (lower, key))
{
- DEBUG ("Key %s is matching name **%s**", key, name);
- g_free (name);
- return TRUE;
+ DEBUG ("Key %s is matching name **%s**", key, str);
+ v = TRUE;
+ goto out;
}
- g_free (name);
+ g_free (str);
+ g_free (lower);
- gtk_tree_model_get (model, iter, COMPLETION_COL_ID, &id, -1);
- if (strstr (id, key))
+ gtk_tree_model_get (model, iter, COMPLETION_COL_ID, &str, -1);
+ lower = g_utf8_strdown (str, -1);
+ if (strstr (lower, key))
{
- DEBUG ("Key %s is matching ID **%s**", key, id);
- g_free (id);
- return TRUE;
+ DEBUG ("Key %s is matching ID **%s**", key, str);
+ v = TRUE;
+ goto out;
}
- g_free (id);
- return FALSE;
+out:
+ g_free (str);
+ g_free (lower);
+
+ return v;
}
static void