summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2018-03-08 23:37:21 +0100
committerBastien Nocera <hadess@hadess.net>2018-03-09 12:10:37 +0100
commit4e7a3a99839d8e2c710c52e06d8b3f347914d431 (patch)
treef8e19782a80c15459467c1219b57db9d4004672b
parente3a12774d8a6f4e4d8b21afbb6e52af37951aa49 (diff)
downloadlibgweather-4e7a3a99839d8e2c710c52e06d8b3f347914d431.tar.gz
GWeatherLocation: Remove ADM2 sub-division
Now that nothing uses it, remove ADM2. https://bugzilla.gnome.org/show_bug.cgi?id=792328
-rw-r--r--libgweather/gweather-location-entry.c1
-rw-r--r--libgweather/gweather-location.c13
-rw-r--r--libgweather/gweather-location.h2
-rw-r--r--libgweather/weather-yrno.c3
4 files changed, 5 insertions, 14 deletions
diff --git a/libgweather/gweather-location-entry.c b/libgweather/gweather-location-entry.c
index 46b25df..22a34cd 100644
--- a/libgweather/gweather-location-entry.c
+++ b/libgweather/gweather-location-entry.c
@@ -504,7 +504,6 @@ fill_location_entry_model (GtkTreeStore *store, GWeatherLocation *loc,
switch (gweather_location_get_level (loc)) {
case GWEATHER_LOCATION_WORLD:
case GWEATHER_LOCATION_REGION:
- case GWEATHER_LOCATION_ADM2:
/* Ignore these levels of hierarchy; just recurse, passing on
* the names from the parent node.
*/
diff --git a/libgweather/gweather-location.c b/libgweather/gweather-location.c
index 7d6f922..70d1ada 100644
--- a/libgweather/gweather-location.c
+++ b/libgweather/gweather-location.c
@@ -58,10 +58,6 @@
* @GWEATHER_LOCATION_ADM1: A location representing a "first-level
* administrative division"; ie, a state, province, or similar
* division.
- * @GWEATHER_LOCATION_ADM2: A location representing a subdivision of a
- * %GWEATHER_LOCATION_ADM1 location, or a direct subdivision of
- * a country that is not represented in a #GWeatherLocationEntry. This
- * is not used.
* @GWEATHER_LOCATION_CITY: A location representing a city
* @GWEATHER_LOCATION_WEATHER_STATION: A location representing a
* weather station.
@@ -673,7 +669,7 @@ find_nearest_city (GWeatherLocation *location,
* Finds the nearest city to the passed latitude and
* longitude, among the descendants of @loc.
*
- * @loc must be at most a %GWEATHER_LOCATION_ADM2 location.
+ * @loc must be at most a %GWEATHER_LOCATION_ADM1 location.
* This restriction may be lifted in a future version.
*
* Note that this function does not check if (@lat, @lon) fall inside
@@ -728,7 +724,7 @@ gweather_location_find_nearest_city (GWeatherLocation *loc,
* Supports the use of own filter function to filter out locations.
* Geocoding should be done on the application side if needed.
*
- * @loc must be at most a %GWEATHER_LOCATION_ADM2 location.
+ * @loc must be at most a %GWEATHER_LOCATION_ADM1 location.
* This restriction may be lifted in a future version.
*
* Returns: (transfer full): the city closest to (@lat, @lon), in the
@@ -824,7 +820,7 @@ _got_place (GObject *source_object,
* Initializes geocode reversing to find place for (@lat, @lon) coordinates. Calls the callback
* function passed by user when the result is ready.
*
- * @loc must be at most a %GWEATHER_LOCATION_ADM2 location.
+ * @loc must be at most a %GWEATHER_LOCATION_ADM1 location.
* This restriction may be lifted in a future version.
*
* Since: 3.12
@@ -1295,8 +1291,7 @@ gweather_location_equal (GWeatherLocation *one,
if (level == GWEATHER_LOCATION_COUNTRY)
return g_strcmp0 (one->country_code, two->country_code);
- if (level == GWEATHER_LOCATION_ADM1 ||
- level == GWEATHER_LOCATION_ADM2) {
+ if (level == GWEATHER_LOCATION_ADM1) {
if (g_strcmp0 (one->english_sort_name, two->english_sort_name) != 0)
return FALSE;
diff --git a/libgweather/gweather-location.h b/libgweather/gweather-location.h
index a7edfb0..62a08fb 100644
--- a/libgweather/gweather-location.h
+++ b/libgweather/gweather-location.h
@@ -40,8 +40,6 @@ typedef enum { /*< underscore_name=gweather_location_level >*/
GWEATHER_LOCATION_COUNTRY,
/* ADM1 = first-order administrative division = state/province, etc */
GWEATHER_LOCATION_ADM1,
- /* ADM2 = second-order division = county, etc */
- GWEATHER_LOCATION_ADM2,
GWEATHER_LOCATION_CITY,
GWEATHER_LOCATION_WEATHER_STATION,
GWEATHER_LOCATION_DETACHED,
diff --git a/libgweather/weather-yrno.c b/libgweather/weather-yrno.c
index 39803b4..e98cad5 100644
--- a/libgweather/weather-yrno.c
+++ b/libgweather/weather-yrno.c
@@ -406,8 +406,7 @@ build_yrno_url_geonames (GWeatherLocation *glocation,
while (glocation) {
if (glocation->level == GWEATHER_LOCATION_CITY)
city_name = glocation->english_name;
- if (glocation->level == GWEATHER_LOCATION_ADM1 ||
- glocation->level == GWEATHER_LOCATION_ADM2)
+ if (glocation->level == GWEATHER_LOCATION_ADM1)
adm_division = glocation->english_name;
if (glocation->level == GWEATHER_LOCATION_COUNTRY)
country = glocation->english_name;