[libgweather] API break: remove deprecated constructors and properties for GWeatherInfo



commit 2e3ae2b410af07c7eedb7ef16dce684d012a80f8
Author: Giovanni Campagna <gcampagna src gnome org>
Date:   Sat Jun 15 15:27:53 2013 +0200

    API break: remove deprecated constructors and properties for GWeatherInfo
    
    Reporting unstructured and untraslated weather forecasts was a hack
    that we no longer need. We can also remove the world property, as
    the world location is fixed for the lifetime of the application.

 doc/libgweather-sections.txt   |    3 -
 libgweather/Makefile.am        |    5 +-
 libgweather/gweather-enums.h   |    6 --
 libgweather/gweather-weather.h |    7 +--
 libgweather/weather-bom.c      |   76 -----------------
 libgweather/weather-iwin.c     |  125 ++++-----------------------
 libgweather/weather-met.c      |  182 ----------------------------------------
 libgweather/weather-owm.c      |    3 +-
 libgweather/weather-priv.h     |    5 -
 libgweather/weather-yahoo.c    |   11 ---
 libgweather/weather-yrno.c     |    6 +-
 libgweather/weather.c          |  100 ++--------------------
 12 files changed, 33 insertions(+), 496 deletions(-)
---
diff --git a/doc/libgweather-sections.txt b/doc/libgweather-sections.txt
index ca7c320..1db419b 100644
--- a/doc/libgweather-sections.txt
+++ b/doc/libgweather-sections.txt
@@ -96,9 +96,7 @@ GWEATHER_TYPE_INFO
 GWeatherInfoPrivate
 
 <SUBSECTION>
-GWeatherForecastType
 gweather_info_new
-gweather_info_new_for_world
 gweather_info_update
 gweather_info_abort
 gweather_info_is_valid
@@ -134,7 +132,6 @@ gweather_info_get_visibility
 gweather_info_get_apparent
 gweather_info_get_sunrise
 gweather_info_get_sunset
-gweather_info_get_forecast
 gweather_info_get_radar
 
 <SUBSECTION>
diff --git a/libgweather/Makefile.am b/libgweather/Makefile.am
index bb05ef0..0ea7152 100644
--- a/libgweather/Makefile.am
+++ b/libgweather/Makefile.am
@@ -24,9 +24,8 @@ libgweatherinc_HEADERS = \
 
 libgweather_internal_3_la_SOURCES = \
        weather.c weather-priv.h \
-       weather-metar.c weather-iwin.c weather-met.c \
-       weather-bom.c weather-yahoo.c weather-wx.c \
-       weather-yrno.c weather-owm.c \
+       weather-metar.c weather-iwin.c weather-yahoo.c \
+       weather-wx.c weather-yrno.c weather-owm.c \
        weather-sun.c weather-moon.c \
        gweather-enum-types.c \
        gweather-location.c gweather-location.h \
diff --git a/libgweather/gweather-enums.h b/libgweather/gweather-enums.h
index 1191cd6..57a34e1 100644
--- a/libgweather/gweather-enums.h
+++ b/libgweather/gweather-enums.h
@@ -21,12 +21,6 @@
 #ifndef __GWEATHER_ENUMS_H_
 #define __GWEATHER_ENUMS_H_
 
-typedef enum { /*< underscore_name=gweather_forecast_type >*/
-    GWEATHER_FORECAST_STATE,
-    GWEATHER_FORECAST_ZONE,
-    GWEATHER_FORECAST_LIST
-} GWeatherForecastType;
-
 typedef enum { /*< underscore_name=gweather_temperature_unit >*/
     GWEATHER_TEMP_UNIT_INVALID = 0,
     GWEATHER_TEMP_UNIT_DEFAULT,
diff --git a/libgweather/gweather-weather.h b/libgweather/gweather-weather.h
index 4a4eca4..e05e304 100644
--- a/libgweather/gweather-weather.h
+++ b/libgweather/gweather-weather.h
@@ -77,11 +77,7 @@ struct _GWeatherInfoClass {
 };
 
 GType                    gweather_info_get_type            (void) G_GNUC_CONST;
-GWeatherInfo *           gweather_info_new                 (GWeatherLocation *location,
-                                                           GWeatherForecastType forecast_type);
-GWeatherInfo *           gweather_info_new_for_world       (GWeatherLocation *world,
-                                                           GWeatherLocation *location,
-                                                           GWeatherForecastType forecast_type);
+GWeatherInfo *           gweather_info_new                 (GWeatherLocation *location);
 void                     gweather_info_update              (GWeatherInfo *info);
 void                    gweather_info_abort               (GWeatherInfo *info);
 void                     gweather_info_store_cache         (void);
@@ -111,7 +107,6 @@ gchar *              gweather_info_get_visibility      (GWeatherInfo *info);
 gchar *                 gweather_info_get_apparent        (GWeatherInfo *info);
 gchar *                 gweather_info_get_sunrise         (GWeatherInfo *info);
 gchar *                 gweather_info_get_sunset          (GWeatherInfo *info);
-gchar *                 gweather_info_get_forecast        (GWeatherInfo *info);
 GSList *                gweather_info_get_forecast_list   (GWeatherInfo *info);
 GdkPixbufAnimation *    gweather_info_get_radar           (GWeatherInfo *info);
 const gchar             *gweather_info_get_attribution     (GWeatherInfo *info);
diff --git a/libgweather/weather-iwin.c b/libgweather/weather-iwin.c
index eb55939..5961878 100644
--- a/libgweather/weather-iwin.c
+++ b/libgweather/weather-iwin.c
@@ -29,47 +29,6 @@
 #define GWEATHER_I_KNOW_THIS_IS_UNSTABLE
 #include "weather-priv.h"
 
-/*
- *  Humans don't deal well with .MONDAY...SUNNY AND BLAH BLAH.TUESDAY...THEN THIS AND THAT.WEDNESDAY...RAINY 
BLAH BLAH.
- *  This function makes it easier to read.
- */
-static gchar *
-formatWeatherMsg (gchar *forecast)
-{
-    gchar *ptr = forecast;
-    gchar *startLine = NULL;
-
-    while (0 != *ptr) {
-        if (ptr[0] == '\n' && ptr[1] == '.') {
-          /* This removes the preamble by shifting the relevant data
-           * down to the start of the buffer. */
-            if (NULL == startLine) {
-                memmove (forecast, ptr, strlen (ptr) + 1);
-                ptr = forecast;
-                ptr[0] = ' ';
-            }
-            ptr[1] = '\n';
-            ptr += 2;
-            startLine = ptr;
-        } else if (ptr[0] == '.' && ptr[1] == '.' && ptr[2] == '.' && NULL != startLine) {
-            memmove (startLine + 2, startLine, (ptr - startLine) * sizeof (gchar));
-            startLine[0] = ' ';
-            startLine[1] = '\n';
-            ptr[2] = '\n';
-
-            ptr += 3;
-
-        } else if (ptr[0] == '$' && ptr[1] == '$') {
-            ptr[0] = ptr[1] = ' ';
-
-        } else {
-            ptr++;
-        }
-    }
-
-    return forecast;
-}
-
 static gboolean
 hasAttr (xmlNode *node, const char *attr_name, const char *attr_value)
 {
@@ -279,8 +238,6 @@ parseForecastXml (const char *buff, GWeatherInfo *master_info)
                                         };
 
                                         priv->valid = TRUE;
-                                        g_free (priv->forecast);
-                                        priv->forecast = g_strdup ((const char *)val);
 
                                         for (i = 0; i < G_N_ELEMENTS (ph_list); i++) {
                                             if (strstr ((const char *)val, ph_list [i].name)) {
@@ -372,11 +329,7 @@ iwin_finish (SoupSession *session, SoupMessage *msg, gpointer data)
     }
 
     priv = info->priv;
-
-    if (priv->forecast_type == GWEATHER_FORECAST_LIST)
-        priv->forecast_list = parseForecastXml (msg->response_body->data, info);
-    else
-        priv->forecast = formatWeatherMsg (g_strdup (msg->response_body->data));
+    priv->forecast_list = parseForecastXml (msg->response_body->data, info);
 
     _gweather_info_request_done (info);
 }
@@ -386,81 +339,41 @@ gboolean
 iwin_start_open (GWeatherInfo *info)
 {
     GWeatherInfoPrivate *priv;
-    gchar *url, *state, *zone;
+    gchar *url;
     WeatherLocation *loc;
     SoupMessage *msg;
 
-    g_return_val_if_fail (info != NULL, FALSE);
+    g_assert (info != NULL);
 
     priv = info->priv;
     loc = &priv->location;
-    g_return_val_if_fail (loc != NULL, FALSE);
 
-    /* No zone (or -) means no weather information from national offices */
-    if ((!loc->zone || loc->zone[0] == '-'))
+    /* No zone (or -) means no weather information from national offices.
+       We don't actually use zone, but it's a good indicator of a US location.
+       (@ and : prefixes were used in the past for Australia and UK) */
+    if (!loc->zone || loc->zone[0] == '-' || loc->zone[0] == '@' || loc->zone[0] == ':')
         return FALSE;
 
-    /* Zones starting with : are for the UK Met Office, @ is for Austrialian
-       Bureau of Metereology. GWEATHER_FORECAST_LIST only works for US, so bail
-       out early if the location is outside.
-    */
-    if (priv->forecast_type == GWEATHER_FORECAST_LIST &&
-       (loc->zone[0] == ':' || loc->zone[0] == '@'))
+    if (!loc->latlon_valid)
        return FALSE;
 
-    /* We also need a pair of coordinates for GWEATHER_FORECAST_LIST */
-    if (priv->forecast_type == GWEATHER_FORECAST_LIST &&
-       !loc->latlon_valid)
-       return FALSE;
-
-    if (priv->forecast_type == GWEATHER_FORECAST_LIST) {
-        /* see the description here: http://www.weather.gov/forecasts/xml/ */
-        struct tm tm;
-        time_t now;
-        gchar latstr[G_ASCII_DTOSTR_BUF_SIZE], lonstr[G_ASCII_DTOSTR_BUF_SIZE];
-
-        now = time (NULL);
-        localtime_r (&now, &tm);
-
-       g_ascii_dtostr (latstr, sizeof(latstr), RADIANS_TO_DEGREES (loc->latitude));
-       g_ascii_dtostr (lonstr, sizeof(lonstr), RADIANS_TO_DEGREES (loc->longitude));
-       url = g_strdup_printf 
("http://www.weather.gov/forecasts/xml/sample_products/browser_interface/ndfdBrowserClientByDay.php?&lat=%s&lon=%s&format=24+hourly&startDate=%04d-%02d-%02d&numDays=7";,
-                              latstr, lonstr, 1900 + tm.tm_year, 1 + tm.tm_mon, tm.tm_mday);
-       msg = soup_message_new ("GET", url);
-       g_free (url);
-       soup_session_queue_message (priv->session, msg, iwin_finish, info);
-
-        priv->requests_pending++;
-        return TRUE;
-    }
-
-    if (loc->zone[0] == ':') {
-        /* Met Office Region Names */
-        metoffice_start_open (info);
-        return TRUE;
-    } else if (loc->zone[0] == '@') {
-        /* Australian BOM forecasts */
-        bom_start_open (info);
-        return TRUE;
-    }
-
-    /* The zone for Pittsburgh (for example) is given as PAZ021 in the locations
-    ** file (the PA stands for the state pennsylvania). The url used wants the state
-    ** as pa, and the zone as lower case paz021.
-    */
-    zone = g_ascii_strdown (loc->zone, -1);
-    state = g_strndup (zone, 2);
+    /* see the description here: http://www.weather.gov/forecasts/xml/ */
+    struct tm tm;
+    time_t now;
+    gchar latstr[G_ASCII_DTOSTR_BUF_SIZE], lonstr[G_ASCII_DTOSTR_BUF_SIZE];
 
-    url = g_strdup_printf ("http://weather.noaa.gov/pub/data/forecasts/zone/%s/%s.txt";, state, zone);
+    now = time (NULL);
+    localtime_r (&now, &tm);
 
-    g_free (zone);
-    g_free (state);
-    
+    g_ascii_dtostr (latstr, sizeof(latstr), RADIANS_TO_DEGREES (loc->latitude));
+    g_ascii_dtostr (lonstr, sizeof(lonstr), RADIANS_TO_DEGREES (loc->longitude));
+    url = g_strdup_printf 
("http://www.weather.gov/forecasts/xml/sample_products/browser_interface/ndfdBrowserClientByDay.php?&lat=%s&lon=%s&format=24+hourly&startDate=%04d-%02d-%02d&numDays=7";,
+                          latstr, lonstr, 1900 + tm.tm_year, 1 + tm.tm_mon, tm.tm_mday);
     msg = soup_message_new ("GET", url);
-    g_free (url);
     soup_session_queue_message (priv->session, msg, iwin_finish, info);
 
     priv->requests_pending++;
+    g_free (url);
 
     return TRUE;
 }
diff --git a/libgweather/weather-owm.c b/libgweather/weather-owm.c
index 3b524bc..40a8832 100644
--- a/libgweather/weather-owm.c
+++ b/libgweather/weather-owm.c
@@ -423,8 +423,7 @@ owm_start_open (GWeatherInfo *info)
     priv = info->priv;
     loc = &priv->location;
 
-    if (!loc->latlon_valid ||
-       priv->forecast_type != GWEATHER_FORECAST_LIST)
+    if (!loc->latlon_valid)
        return FALSE;
 
     /* see the description here: http://bugs.openweathermap.org/projects/api/wiki/Api_2_5_forecast */
diff --git a/libgweather/weather-priv.h b/libgweather/weather-priv.h
index 29f1d64..bfa7912 100644
--- a/libgweather/weather-priv.h
+++ b/libgweather/weather-priv.h
@@ -90,7 +90,6 @@ typedef gdouble GWeatherVisibility;
 typedef time_t GWeatherUpdate;
 
 struct _GWeatherInfoPrivate {
-    GWeatherForecastType forecast_type;
     GWeatherProvider providers;
 
     GSettings *settings;
@@ -112,7 +111,6 @@ struct _GWeatherInfoPrivate {
     gboolean hasHumidity;
 
     WeatherLocation location;
-    GWeatherLocation *world;
     GWeatherLocation *glocation;
     GWeatherUpdate update;
     GWeatherUpdate current_time;
@@ -131,7 +129,6 @@ struct _GWeatherInfoPrivate {
     GWeatherUpdate sunset;
     GWeatherMoonPhase moonphase;
     GWeatherMoonLatitude moonlatitude;
-    gchar *forecast;
     GSList *forecast_list; /* list of GWeatherInfo* for the forecast, NULL if not available */
     gchar *forecast_attribution;
     gchar *radar_buffer;
@@ -188,8 +185,6 @@ struct _GWeatherInfoPrivate {
 
 void           metar_start_open        (GWeatherInfo *info);
 gboolean       iwin_start_open         (GWeatherInfo *info);
-void           metoffice_start_open    (GWeatherInfo *info);
-void           bom_start_open          (GWeatherInfo *info);
 void           wx_start_open           (GWeatherInfo *info);
 gboolean        yahoo_start_open        (GWeatherInfo *info);
 gboolean        yrno_start_open         (GWeatherInfo *info);
diff --git a/libgweather/weather-yahoo.c b/libgweather/weather-yahoo.c
index 98401ed..778169e 100644
--- a/libgweather/weather-yahoo.c
+++ b/libgweather/weather-yahoo.c
@@ -188,10 +188,6 @@ make_info_from_node (GWeatherInfo *master_info,
     priv->tempMinMaxValid = priv->tempMinMaxValid || (priv->temp_max > -999.0 && priv->temp_min > -999.0);
     priv->valid = priv->tempMinMaxValid;
 
-    val = xmlGetProp (node, XC("text"));
-    priv->forecast = g_strdup ((const char*) val);
-    xmlFree (val);
-
     val = xmlGetProp (node, XC("code"));
     code = strtol((const char*) val, NULL, 0);
     if (code >= 0 && code < G_N_ELEMENTS (condition_codes)) {
@@ -277,13 +273,6 @@ yahoo_start_open (GWeatherInfo *info)
     if (!loc->yahoo_id)
        return FALSE;
 
-    /* Yahoo! Weather only supports forecast list
-       (and really, the other types only make sense with national
-       weather offices that cannot return structured data)
-    */
-    if (!priv->forecast_type != GWEATHER_FORECAST_LIST)
-       return FALSE;
-
     /* u=f means that the values are in imperial system (which is what
        weather.c expects). They're converted to user preferences before
        displaying.
diff --git a/libgweather/weather-yrno.c b/libgweather/weather-yrno.c
index ec61af2..6f07e16 100644
--- a/libgweather/weather-yrno.c
+++ b/libgweather/weather-yrno.c
@@ -482,9 +482,6 @@ yrno_start_open_old (GWeatherInfo *info)
 
     priv = info->priv;
 
-    if (priv->forecast_type != GWEATHER_FORECAST_LIST)
-       return FALSE;
-
     url = build_yrno_url_geonames (priv->glocation, "forecast.xml");
     if (url == NULL)
        return FALSE;
@@ -531,8 +528,7 @@ yrno_start_open_new (GWeatherInfo *info)
     priv = info->priv;
     loc = &priv->location;
 
-    if (!loc->latlon_valid ||
-       priv->forecast_type != GWEATHER_FORECAST_LIST)
+    if (!loc->latlon_valid)
        return FALSE;
 
     /* see the description here: http://api.yr.no/weatherapi/ */
diff --git a/libgweather/weather.c b/libgweather/weather.c
index e4aedf2..78ae93e 100644
--- a/libgweather/weather.c
+++ b/libgweather/weather.c
@@ -64,9 +64,7 @@
 
 enum {
     PROP_0,
-    PROP_WORLD,
     PROP_LOCATION,
-    PROP_TYPE,
     PROP_ENABLED_PROVIDERS,
     PROP_LAST
 };
@@ -386,9 +384,6 @@ gweather_info_reset (GWeatherInfo *info)
 {
     GWeatherInfoPrivate *priv = info->priv;
 
-    g_free (priv->forecast);
-    priv->forecast = NULL;
-
     g_free (priv->forecast_attribution);
     priv->forecast_attribution = NULL;
 
@@ -422,7 +417,6 @@ gweather_info_reset (GWeatherInfo *info)
     priv->sunset = 0;
     priv->moonphase = 0;
     priv->moonlatitude = 0;
-    priv->forecast = NULL;
     priv->forecast_list = NULL;
     priv->radar = NULL;
 }
@@ -449,6 +443,7 @@ gweather_info_init (GWeatherInfo *info)
 
     priv = info->priv = G_TYPE_INSTANCE_GET_PRIVATE (info, GWEATHER_TYPE_INFO, GWeatherInfoPrivate);
 
+    priv->providers = GWEATHER_PROVIDER_METAR | GWEATHER_PROVIDER_IWIN;
     priv->settings = g_settings_new ("org.gnome.GWeather");
 
     g_signal_connect_object (priv->settings, "changed",
@@ -626,12 +621,6 @@ gweather_info_finalize (GObject *object)
     if (priv->glocation)
        gweather_location_unref (priv->glocation);
 
-    if (priv->world)
-       gweather_location_unref (priv->world);
-
-    g_free (priv->forecast);
-    priv->forecast = NULL;
-
     g_free (priv->radar_url);
     priv->radar_url = NULL;
 
@@ -1135,13 +1124,6 @@ gweather_info_get_sunset (GWeatherInfo *info)
     return buf;
 }
 
-gchar *
-gweather_info_get_forecast (GWeatherInfo *info)
-{
-    g_return_val_if_fail (GWEATHER_IS_INFO (info), NULL);
-    return g_strdup (info->priv->forecast);
-}
-
 /**
  * gweather_info_get_forecast_list:
  * @info: a #GWeatherInfo
@@ -2056,6 +2038,8 @@ gweather_info_set_location_internal (GWeatherInfo     *info,
  * @location: (allow-none): a location for which weather is desired
  *
  * Changes @info to report weather for @location.
+ * Note that this will clear any forecast or current conditions from
+ * @info, you must call gweather_info_update() to obtain the new data.
  */
 void
 gweather_info_set_location (GWeatherInfo     *info,
@@ -2064,7 +2048,7 @@ gweather_info_set_location (GWeatherInfo     *info,
     g_return_if_fail (GWEATHER_IS_INFO (info));
 
     gweather_info_set_location_internal (info, location);
-    gweather_info_update (info);
+    gweather_info_reset (info);
 }
 
 GWeatherProvider
@@ -2100,22 +2084,14 @@ gweather_info_set_property (GObject *object,
                            GParamSpec *pspec)
 {
     GWeatherInfo *self = GWEATHER_INFO (object);
-    GWeatherInfoPrivate *priv = self->priv;
 
     switch (property_id) {
-    case PROP_WORLD:
-       priv->world = g_value_dup_boxed (value);
-       break;
     case PROP_LOCATION:
        gweather_info_set_location_internal (self, (GWeatherLocation*) g_value_get_boxed (value));
        break;
-    case PROP_TYPE:
-       priv->forecast_type = g_value_get_enum (value);
-       break;
     case PROP_ENABLED_PROVIDERS:
        gweather_info_set_enabled_providers (self, g_value_get_flags (value));
        break;
-
     default:
        G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
     }
@@ -2131,15 +2107,9 @@ gweather_info_get_property (GObject    *object,
     GWeatherInfoPrivate *priv = self->priv;
 
     switch (property_id) {
-    case PROP_WORLD:
-       g_value_set_boxed (value, priv->world);
-       break;
     case PROP_LOCATION:
        g_value_set_boxed (value, priv->glocation);
        break;
-    case PROP_TYPE:
-       g_value_set_enum (value, priv->forecast_type);
-       break;
     case PROP_ENABLED_PROVIDERS:
        g_value_set_flags (value, priv->providers);
        break;
@@ -2160,13 +2130,6 @@ gweather_info_class_init (GWeatherInfoClass *klass)
     gobject_class->set_property = gweather_info_set_property;
     gobject_class->get_property = gweather_info_get_property;
 
-    pspec = g_param_spec_boxed ("world",
-                               "World",
-                               "The hierarchy of locations containing the desired location",
-                               GWEATHER_TYPE_LOCATION,
-                               G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | 
G_PARAM_DEPRECATED);
-    g_object_class_install_property (gobject_class, PROP_WORLD, pspec);
-
     pspec = g_param_spec_boxed ("location",
                                "Location",
                                "The location this info represents",
@@ -2174,14 +2137,6 @@ gweather_info_class_init (GWeatherInfoClass *klass)
                                G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE | G_PARAM_CONSTRUCT);
     g_object_class_install_property (gobject_class, PROP_LOCATION, pspec);
 
-    pspec = g_param_spec_enum ("forecast-type",
-                              "Forecast type",
-                              "The type of forecast desired (list, zone or state)",
-                              GWEATHER_TYPE_FORECAST_TYPE,
-                              GWEATHER_FORECAST_LIST,
-                              G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);
-    g_object_class_install_property (gobject_class, PROP_TYPE, pspec);
-
     pspec = g_param_spec_flags ("enabled-providers",
                                "Enabled providers",
                                "A bitmask of enabled weather service providers",
@@ -2210,59 +2165,22 @@ gweather_info_class_init (GWeatherInfoClass *klass)
 
 /**
  * gweather_info_new:
- * @location: (allow-none): the desidered #GWeatherLocation (NULL for default)
- * @forecast_type: the type of forecast requested
+ * @location: (allow-none): the desidered #GWeatherLocation (%NULL for default)
  *
  * Builds a new #GWeatherInfo that will provide weather information about
  * @location.
- * Note that, as compared to g_object_new(), this will call gweather_info_update()
- * on the resulting info, which will not be ready until the #GWeatherInfo::updated
- * signal is emitted.
  *
  * Returns: (transfer full): a new #GWeatherInfo
  */
 GWeatherInfo *
-gweather_info_new (GWeatherLocation    *location,
-                  GWeatherForecastType forecast_type)
-{
-    GWeatherInfo *self;
-
-    if (location != NULL)
-       self = g_object_new (GWEATHER_TYPE_INFO, "location", location, "forecast-type", forecast_type, NULL);
-    else
-       self = g_object_new (GWEATHER_TYPE_INFO, "forecast-type", forecast_type, NULL);
-    gweather_info_update (self);
-
-    return self;
-}
-
-/**
- * gweather_info_new_for_world:
- * @world: a #GWeatherLocation representing the whole world
- * @location: (allow-none): the desidered #GWeatherLocation (NULL for default)
- * @forecast_type: the type of forecast requested
- *
- * Similar to gweather_info_new(), but also has a @world parameter, that allow controlling
- * the hierarchy of #GWeatherLocation to which @location (or the default one taken from
- * GSettings) belongs.
- *
- * Returns: (transfer full): a new #GWeatherInfo
- *
- * Deprecated: there is only one world-level #GWeatherLocation at any time, so
- *             this is the same as gweather_info_new().
- */
-GWeatherInfo *
-gweather_info_new_for_world (GWeatherLocation    *world,
-                            GWeatherLocation    *location,
-                            GWeatherForecastType forecast_type)
+gweather_info_new (GWeatherLocation    *location)
 {
     GWeatherInfo *self;
 
     if (location != NULL)
-       self = g_object_new (GWEATHER_TYPE_INFO, "world", world, "location", location, "forecast-type", 
forecast_type, NULL);
+       self = g_object_new (GWEATHER_TYPE_INFO, "location", location, NULL);
     else
-       self = g_object_new (GWEATHER_TYPE_INFO, "world", world, "forecast-type", forecast_type, NULL);
-    gweather_info_update (self);
+       self = g_object_new (GWEATHER_TYPE_INFO, NULL);
 
     return self;
 }
@@ -2270,5 +2188,5 @@ gweather_info_new_for_world (GWeatherLocation    *world,
 GWeatherInfo *
 _gweather_info_new_clone (GWeatherInfo *other)
 {
-    return g_object_new (GWEATHER_TYPE_INFO, "location", other->priv->glocation, "forecast-type", 
other->priv->forecast_type, NULL);
+    return g_object_new (GWEATHER_TYPE_INFO, "location", other->priv->glocation, NULL);
 }


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