[Commits] [SCM] claws branch, master, updated. 3.9.2-130-g7f03f03

ticho at claws-mail.org ticho at claws-mail.org
Thu Dec 12 12:20:26 CET 2013


The branch master of project "claws" (Claws Mail) has been updated
       via  7f03f0360ead1c138b3a0b8be649ad592aeeb46a (commit)
      from  52b48f6cc7a7b0c4e2f51b75e4249a1647ccd896 (commit)


- Log -----------------------------------------------------------------
commit 7f03f0360ead1c138b3a0b8be649ad592aeeb46a
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Thu Dec 12 12:17:59 2013 +0100

    In folder select dialog, allow type-search to match any part of folder names, not just beginning.

diff --git a/src/foldersel.c b/src/foldersel.c
index ef29fc0..ab512dc 100644
--- a/src/foldersel.c
+++ b/src/foldersel.c
@@ -198,6 +198,24 @@ FolderItem *foldersel_folder_sel(Folder *cur_folder, FolderSelectionType type,
 		return NULL;
 }
 
+static gboolean foldersel_search_name_func(GtkTreeModel *model, gint column,
+		const gchar *key, GtkTreeIter *iter, gpointer search_data)
+{
+	gchar *store_string;
+	gboolean retval;
+
+	gtk_tree_model_get(model, iter, column, &store_string, -1);
+
+	if (!store_string || !key)
+		return FALSE;
+
+	retval = (strcasestr(store_string, key) == NULL);
+
+	g_free(store_string);
+
+	return retval;
+}
+
 static void foldersel_size_allocate_cb(GtkWidget *widget,
 					 GtkAllocation *allocation)
 {
@@ -262,6 +280,8 @@ static void foldersel_create(void)
 	gtk_tree_view_set_enable_tree_lines(GTK_TREE_VIEW(treeview), FALSE);
 	gtk_tree_view_set_search_column(GTK_TREE_VIEW(treeview),
 					FOLDERSEL_FOLDERNAME);
+	gtk_tree_view_set_search_equal_func(GTK_TREE_VIEW(treeview),
+			foldersel_search_name_func, NULL, NULL);
 
 	selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(treeview));
 	gtk_tree_selection_set_mode(selection, GTK_SELECTION_BROWSE);

-----------------------------------------------------------------------

Summary of changes:
 src/foldersel.c |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list