[gnome-applets] Fix weather applet preferences find function



commit 330dd851f79521b0340ab7b7bea559f1ec9ee7e2
Author: Ray Strode <rstrode redhat com>
Date:   Fri Oct 16 15:24:07 2009 -0400

    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.

 gweather/gweather-pref.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
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;
 		}
 	}
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]