From 330dd851f79521b0340ab7b7bea559f1ec9ee7e2 Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Fri, 16 Oct 2009 19:24:07 +0000 Subject: Fix weather applet preferences find function If you type "Barcelona" into the find entry then it will take you to Barcelona, Venezuela. Clicking "Find Next" doesn't jump to the next entry (the one in Spain), however. The problem is the code only looks at the direct parent of the first match when searching for the second match. Since there aren't any more countries in Central America after Venezuela the search stops. This commit recursively searches all ancestors for matches. See bug 424639 for more details. --- diff --git a/gweather/gweather-pref.c b/gweather/gweather-pref.c index 4d8465e..4fee96e 100644 --- a/gweather/gweather-pref.c +++ b/gweather/gweather-pref.c @@ -642,8 +642,10 @@ find_location (GtkTreeModel *model, GtkTreeIter *iter, const gchar *location, gb if (go_parent) { iter_parent = *iter; - if (gtk_tree_model_iter_parent (model, iter, &iter_parent) && gtk_tree_model_iter_next (model, iter)) { - return find_location (model, iter, location, TRUE); + while (gtk_tree_model_iter_parent (model, iter, &iter_parent)) { + if (gtk_tree_model_iter_next (model, iter)) + return find_location (model, iter, location, TRUE); + iter_parent = *iter; } } -- cgit v0.8.2