summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Alan <alan@debian.local>2017-07-10 22:29:01 +0100
committerGravatar Alan <alan@debian.local>2017-07-10 22:29:01 +0100
commit20a1832618849df958ecf8e6392dd34af02dc850 (patch)
tree6ad7db7ccac55a2d0a3ba8cbd83aa1709e5e927c
parent810d589610ef851096d5a4c1e711725afe817f92 (diff)
parentf0f522b20744bf32252bb18b92a11249ede935ce (diff)
git push origin masterMerge branch 'Elinvention-master'
-rw-r--r--src/trg-files-tree-view.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/trg-files-tree-view.c b/src/trg-files-tree-view.c
index 70147f7..2b739c9 100644
--- a/src/trg-files-tree-view.c
+++ b/src/trg-files-tree-view.c
@@ -180,6 +180,18 @@ view_onButtonPressed(GtkWidget * treeview,
return handled;
}
+static gboolean
+search_func (GtkTreeModel *model, gint column,
+ const gchar *key, GtkTreeIter *iter,
+ gpointer search_data)
+{
+ gchar *iter_string = NULL;
+ gtk_tree_model_get(model, iter, column, &iter_string, -1);
+ gboolean result = g_strrstr(g_utf8_strdown(iter_string, -1), key) == NULL;
+ g_free(iter_string);
+ return result;
+}
+
static void trg_files_tree_view_init(TrgFilesTreeView * self)
{
TrgTreeView *ttv = TRG_TREE_VIEW(self);
@@ -200,6 +212,11 @@ static void trg_files_tree_view_init(TrgFilesTreeView * self)
gtk_tree_view_set_search_column(GTK_TREE_VIEW(self), FILESCOL_NAME);
+ gtk_tree_view_set_search_equal_func(GTK_TREE_VIEW(self),
+ (GtkTreeViewSearchEqualFunc) search_func,
+ gtk_tree_view_get_model(GTK_TREE_VIEW(self)),
+ NULL);
+
g_signal_connect(self, "button-press-event",
G_CALLBACK(view_onButtonPressed), NULL);
g_signal_connect(self, "popup-menu",