From: Thomas Thurman Date: Sun, 30 Aug 2009 21:18:34 +0000 (-0400) Subject: second half of the few/many change X-Git-Url: http://vcs.maemo.org/git/?a=commitdiff_plain;h=1c40ac1cb21723bdd70b357994808e8f5883e04d;hp=bd3d3bf32c5d9d1a5b7c9f1645171d38677e92f6;p=belltower second half of the few/many change --- diff --git a/TODO b/TODO index eb775a9..fd8e0d7 100644 --- a/TODO +++ b/TODO @@ -4,3 +4,4 @@ * Add my name to the credits list * Switch names in the buttons in the credits list around ("view..." should be subtext) * Download Dove automatically +* parse_dove should have an option to call show_towers_by_list automagically (maybe if you include a title) diff --git a/belltower.c b/belltower.c index 6787255..920e5e8 100644 --- a/belltower.c +++ b/belltower.c @@ -973,7 +973,7 @@ towers_by_subarea (gchar *area) if (gtk_dialog_run (GTK_DIALOG (dialog))==GTK_RESPONSE_OK) { GSList *matches = NULL; - cac.county = strdup (hildon_touch_selector_get_current_text (HILDON_TOUCH_SELECTOR (selector))); + cac.county = g_strdup (hildon_touch_selector_get_current_text (HILDON_TOUCH_SELECTOR (selector))); parse_dove (get_towers_by_county_cb, &matches, @@ -1084,10 +1084,27 @@ towers_by_area_with_many (gboolean countries_with_many) if (result) { - if (strcmp (result, COUNTRIES_WITH_FEW)==0) - towers_by_area_with_many (FALSE); + if (countries_with_many) + { + /* these countries have many towers, so + * show the sub-areas + */ + if (strcmp (result, COUNTRIES_WITH_FEW)==0) + towers_by_area_with_many (FALSE); + else + towers_by_subarea (result); + } else - towers_by_subarea (result); + { + country_and_county cac = { result, NULL }; + GSList *matches = NULL; + + parse_dove (get_towers_by_county_cb, + &matches, + &cac); + + show_towers_from_list (matches); + } g_free (result); }