From: Kaj-Michael Lang Date: Wed, 19 Mar 2008 14:14:00 +0000 (+0200) Subject: Store succesfull search strings in search_model and list X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1790cf765772385653f837d57df0ee7868acc117;p=mapper Store succesfull search strings in search_model and list --- diff --git a/src/search.c b/src/search.c index 59ae62d..4b2be29 100644 --- a/src/search.c +++ b/src/search.c @@ -68,6 +68,7 @@ struct _search_dialog { }; static search_dialog sd; +static GSList *search_list=NULL; static GtkListStore *search_model=NULL; static gboolean @@ -118,6 +119,11 @@ switch (s->stype) { } if (sres==TRUE) { + if (!g_slist_find_custom(search_list, st, (GCompareFunc)strcmp)) { + search_list = g_slist_prepend(search_list, g_strdup(st)); + gtk_list_store_insert_with_values(search_model, &iter, INT_MAX, 0, st, -1); + } + gtk_tree_view_set_model(GTK_TREE_VIEW(s->list), GTK_TREE_MODEL(s->store)); g_object_unref(G_OBJECT(s->store)); } else {