[libgweather/location-object: 2/2] Remove GWeatherLocation reference wrappers




commit 2bc5eaabfea9b775e59483a1ebefb821286ef99e
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Tue Nov 9 17:42:59 2021 +0000

    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.

 doc/migrating-3to4.md           | 13 ++++++++++++-
 libgweather/gweather-location.c | 33 ---------------------------------
 libgweather/gweather-location.h |  4 ----
 3 files changed, 12 insertions(+), 38 deletions(-)
---
diff --git a/doc/migrating-3to4.md b/doc/migrating-3to4.md
index 686b0b07..e9a36a3d 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 c9702342..4abddfa3 100644
--- a/libgweather/gweather-location.c
+++ b/libgweather/gweather-location.c
@@ -278,39 +278,6 @@ gweather_location_get_world (void)
     return location_ref_for_idx (world_db, 0, NULL);
 }
 
-/**
- * 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 0166025a..374c9269 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);


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