[gitg] Search repositories ignoring case



commit 1c3a2c82e68b09f6ff28df669896f0e4a0206baa
Author: Alberto Fanjul <albertofanjul gmail com>
Date:   Sun Oct 14 19:13:42 2018 +0200

    Search repositories ignoring case

 libgitg/gitg-repository-list-box.vala | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/libgitg/gitg-repository-list-box.vala b/libgitg/gitg-repository-list-box.vala
index 41072557..df7ca63f 100644
--- a/libgitg/gitg-repository-list-box.vala
+++ b/libgitg/gitg-repository-list-box.vala
@@ -392,9 +392,14 @@ namespace Gitg
                        row.set_header(before != null ? new Gtk.Separator(Gtk.Orientation.HORIZONTAL) : null);
                }
 
+               private string normalize(string s)
+               {
+                       return s.normalize(-1, NormalizeMode.ALL).casefold();
+               }
+
                private bool filter(Gtk.ListBoxRow row)
                {
-                       return d_filter_text != null ? ((Row)row).repository_name.contains(d_filter_text) : 
true;
+                       return d_filter_text != null ? 
normalize(((Row)row).repository_name).contains(normalize(d_filter_text)) : true;
                }
 
                private int compare_widgets(Gtk.ListBoxRow a, Gtk.ListBoxRow b)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]