[gnome-builder] preferences: Language search should be case insensitive
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] preferences: Language search should be case insensitive
- Date: Tue, 12 May 2015 19:37:45 +0000 (UTC)
commit f7e3e75c54969d5b0aff336056cd997d2c29f4a0
Author: Dimitris Zenios <dimitris zenios gmail com>
Date: Tue May 12 15:37:31 2015 +0300
preferences: Language search should be case insensitive
src/preferences/gb-preferences-page-language.c | 25 ++++++++++++++++++-----
1 files changed, 19 insertions(+), 6 deletions(-)
---
diff --git a/src/preferences/gb-preferences-page-language.c b/src/preferences/gb-preferences-page-language.c
index 542bf03..29423b4 100644
--- a/src/preferences/gb-preferences-page-language.c
+++ b/src/preferences/gb-preferences-page-language.c
@@ -97,15 +97,28 @@ item_filter_func (GtkListBoxRow *row,
if (gb_str_empty0 (text))
return TRUE;
+ else
+ {
+ gchar *search_text;
+ gchar *language_name;
+ gchar *language_id;
+ gboolean found;
- lang = g_object_get_data (G_OBJECT (row), "GTK_SOURCE_LANGUAGE");
- g_assert (lang);
+ lang = g_object_get_data (G_OBJECT (row), "GTK_SOURCE_LANGUAGE");
+ g_assert (lang);
- if (strstr (gtk_source_language_get_id (lang), text) ||
- strstr (gtk_source_language_get_name (lang), text))
- return TRUE;
+ search_text = g_utf8_strdown (text, -1);
+ language_name = g_utf8_strdown (gtk_source_language_get_name (lang), -1);
+ language_id = g_utf8_strdown (gtk_source_language_get_id (lang), -1);
- return FALSE;
+ found = strstr (language_id, search_text) || strstr (language_name, search_text);
+
+ g_free(search_text);
+ g_free(language_name);
+ g_free(language_id);
+
+ return found;
+ }
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]