[devhelp] search: Easier check to see if case sensitivity is wanted
- From: Aleksander Morgado <aleksm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [devhelp] search: Easier check to see if case sensitivity is wanted
- Date: Tue, 14 Dec 2010 23:43:02 +0000 (UTC)
commit e3a5f07da7a3a33659626aac133ba3a698395f54
Author: Aleksander Morgado <aleksander lanedo com>
Date: Wed Dec 15 00:36:08 2010 +0100
search: Easier check to see if case sensitivity is wanted
src/dh-keyword-model.c | 21 ++++++---------------
1 files changed, 6 insertions(+), 15 deletions(-)
---
diff --git a/src/dh-keyword-model.c b/src/dh-keyword-model.c
index 71f066f..0d219b2 100644
--- a/src/dh-keyword-model.c
+++ b/src/dh-keyword-model.c
@@ -484,25 +484,16 @@ dh_keyword_model_filter (DhKeywordModel *model,
stringv = g_strsplit (processed_string, " ", -1);
- case_sensitive = FALSE;
-
- /* Search for any parameters and position search cursor to
- * the next element in the search string.
+ /* Searches are case sensitive when any uppercase
+ * letter is used in the search terms, matching vim
+ * smartcase behaviour.
*/
- for (i = 0; stringv[i] != NULL; i++) {
- gchar *lower;
-
- /* Searches are case sensitive when any uppercase
- * letter is used in the search terms, matching vim
- * smartcase behaviour.
- */
- lower = g_ascii_strdown (stringv[i], -1);
- if (strcmp (lower, stringv[i]) != 0) {
+ case_sensitive = FALSE;
+ for (i = 0; processed_string[i] != '\0'; i++) {
+ if (g_ascii_isupper (processed_string[i])) {
case_sensitive = TRUE;
- g_free (lower);
break;
}
- g_free (lower);
}
new_list = keyword_model_search (model,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]