summaryrefslogtreecommitdiff
path: root/gweather
diff options
context:
space:
mode:
authorRay Strode <rstrode@redhat.com>2009-10-16 15:24:07 -0400
committerRay Strode <rstrode@redhat.com>2009-10-16 15:24:07 -0400
commit330dd851f79521b0340ab7b7bea559f1ec9ee7e2 (patch)
tree6905cffe90fddc2c33bed063ad6c93e2ccb6757f /gweather
parent9ff5b57d27bed58fd08f148fceec58957e773ace (diff)
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.
Diffstat (limited to 'gweather')
-rw-r--r--gweather/gweather-pref.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gweather/gweather-pref.c b/gweather/gweather-pref.c
index 4d8465ea7..4fee96e3e 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;
}
}