]> err.no Git - mapper/commitdiff
Store succesfull search strings in search_model and list
authorKaj-Michael Lang <milang@tal.org>
Wed, 19 Mar 2008 14:14:00 +0000 (16:14 +0200)
committerKaj-Michael Lang <milang@tal.org>
Wed, 19 Mar 2008 14:14:00 +0000 (16:14 +0200)
src/search.c

index 59ae62dbf3f177bac3418948873b753775ae7dbd..4b2be29670eea3438fa10e62d2243e03ea74c432 100644 (file)
@@ -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 {