summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2021-11-09 17:42:59 +0000
committerEmmanuele Bassi <ebassi@gmail.com>2021-11-17 21:53:05 +0000
commitcad69b404e155b297ae19b45885e66ed98e9d7f9 (patch)
tree8fceb8ed6b0c730ce6563160405f1f1c693a31e6
parentf588c3b32e0624e406f40559111a7d85f71ad948 (diff)
downloadlibgweather-cad69b404e155b297ae19b45885e66ed98e9d7f9.tar.gz
Remove GWeatherLocation reference wrappers
Document that GWeatherLocation is a full GObject type, and that you should use the GObject API to acquire and release references.
-rw-r--r--doc/migrating-3to4.md13
-rw-r--r--libgweather/gweather-location.c33
-rw-r--r--libgweather/gweather-location.h4
3 files changed, 12 insertions, 38 deletions
diff --git a/doc/migrating-3to4.md b/doc/migrating-3to4.md
index 686b0b0..e9a36a3 100644
--- a/doc/migrating-3to4.md
+++ b/doc/migrating-3to4.md
@@ -35,7 +35,7 @@ while ((iter = gweather_location_next_child (location, iter)) != NULL) {
**Note**: Unlike `gweather_location_get_children()`, the `next_child()`
method will consume the reference of the iterated child; if you are keeping
a reference to each child `GWeatherLocation` you should acquire a strong
-reference to it, using [method@GWeather.Location.ref].
+reference to it, using [method@GObject.Object.ref].
### Stop using `gweather_info_get_radar()`
@@ -45,3 +45,14 @@ method has been returning `NULL` since then.
### Stop using `GWEATHER_PROVIDER_YAHOO`
The Yahoo! provider was removed in libgweather 3.28.
+
+### `GWeatherLocation` is a GObject
+
+[class@GWeather.Location] has been promoted to a full `GObject` type. This
+means that properties using `GWeatherLocation` should be defined using
+[`func@GObject.param_spec_object`], and `GValue`s should be accessed using
+[`method@GObject.Value.set_object`] and [`method@GObject.Value.get_object`].
+If you are using `gweather_location_ref()` to acquire a reference on a location
+instance, you should now use [`method@GObject.Object.ref`]; if you are using
+`gweather_location_unref()` to release a reference on a location instance,
+you should now use [`method@GObject.Object.unref`].
diff --git a/libgweather/gweather-location.c b/libgweather/gweather-location.c
index 89f9693..d31bba8 100644
--- a/libgweather/gweather-location.c
+++ b/libgweather/gweather-location.c
@@ -279,39 +279,6 @@ gweather_location_get_world (void)
}
/**
- * gweather_location_ref:
- * @loc: a location
- *
- * Acquires a reference to the location.
- *
- * Return value: (transfer full): the location, with an additional reference
- *
- * Deprecated: 4.0: Use [method@GObject.Object.ref] instead
- **/
-GWeatherLocation *
-gweather_location_ref (GWeatherLocation *loc)
-{
- return g_object_ref (loc);
-}
-
-/**
- * gweather_location_unref:
- * @loc: (transfer full): a location
- *
- * Releases a reference on the location.
- *
- * If the reference was the last one held, this function will free
- * the resources allocated by the location.
- *
- * Deprecated: 4.0: Use [method@GObject.Object.unref] instead
- **/
-void
-gweather_location_unref (GWeatherLocation *loc)
-{
- g_object_unref (loc);
-}
-
-/**
* gweather_location_get_name:
* @loc: a #GWeatherLocation
*
diff --git a/libgweather/gweather-location.h b/libgweather/gweather-location.h
index 0166025..374c926 100644
--- a/libgweather/gweather-location.h
+++ b/libgweather/gweather-location.h
@@ -89,10 +89,6 @@ G_DECLARE_FINAL_TYPE (GWeatherLocation, gweather_location, GWEATHER, LOCATION, G
GWEATHER_AVAILABLE_IN_ALL
GWeatherLocation * gweather_location_get_world (void);
-GWEATHER_AVAILABLE_IN_ALL
-GWeatherLocation * gweather_location_ref (GWeatherLocation *loc);
-GWEATHER_AVAILABLE_IN_ALL
-void gweather_location_unref (GWeatherLocation *loc);
GWEATHER_AVAILABLE_IN_ALL
const char * gweather_location_get_name (GWeatherLocation *loc);