@@ -203,11 +203,14 @@ void TimeZoneLocationModel::setCountry(const QString &country)
203 if (m_country == country)
203 if (m_country == country)
206 m_country = country;
208 m_country = country;
208 Q_FOREACH(GeonamesCity *city, m_countryLocations) {
210 Q_FOREACH(GeonamesCity *city, m_countryLocations) {
209 geonames_city_free(city);
211 geonames_city_free(city);
213+ m_countryLocations.clear();
212 gint num_cities = geonames_get_n_cities();
215 gint num_cities = geonames_get_n_cities();
213 for (gint i = 0; i < num_cities; i++) {
216 for (gint i = 0; i < num_cities; i++) {
@@ -219,6 +222,8 @@ void TimeZoneLocationModel::setCountry(const QString &country)
220 std::sort(m_countryLocations.begin(), m_countryLocations.end(), citycmp);
223 std::sort(m_countryLocations.begin(), m_countryLocations.end(), citycmp);
222 Q_EMIT countryChanged(country);
227 Q_EMIT countryChanged(country);