summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2023-07-06 11:15:02 +0200
committerBastien Nocera <hadess@hadess.net>2023-07-06 11:15:02 +0200
commit67666029543f12d423619df4e8d1ad32faa928e9 (patch)
tree2d75b4773848813ed765cb1a7362e3ff3cdea486
parent07565ef6a1aa4a115f8ce51e259e408edbaed4cc (diff)
lib: Remove deprecated up_client_get_devices()
And rename up_client_get_devices2() to up_client_get_devices().
-rw-r--r--libupower-glib/up-client.c26
-rw-r--r--libupower-glib/up-client.h3
-rw-r--r--tools/up-tool.c4
3 files changed, 5 insertions, 28 deletions
diff --git a/libupower-glib/up-client.c b/libupower-glib/up-client.c
index b005a2f..1137849 100644
--- a/libupower-glib/up-client.c
+++ b/libupower-glib/up-client.c
@@ -73,28 +73,6 @@ G_DEFINE_TYPE_WITH_CODE (UpClient, up_client, G_TYPE_OBJECT,
G_IMPLEMENT_INTERFACE(G_TYPE_INITABLE, up_client_initable_iface_init)
G_IMPLEMENT_INTERFACE (G_TYPE_ASYNC_INITABLE, up_client_async_initable_iface_init))
-/**
- * up_client_get_devices:
- * @client: a #UpClient instance.
- *
- * Get a copy of the device objects. This function does not set the free
- * function for the #GPtrArray so you need use g_object_unref on all
- * elements when you are finished with the array.
- *
- * Return value: (element-type UpDevice) (transfer full): an array of #UpDevice objects or %NULL on error, free with g_ptr_array_unref()
- *
- * Since: 0.9.0
- * Deprecated: 0.99.8
- **/
-GPtrArray *
-up_client_get_devices (UpClient *client)
-{
- GPtrArray *array = up_client_get_devices2 (client);
- if (array)
- g_ptr_array_set_free_func (array, NULL);
- return array;
-}
-
static GPtrArray *
up_client_get_devices_full (UpClient *client,
GCancellable *cancellable,
@@ -131,7 +109,7 @@ up_client_get_devices_full (UpClient *client,
}
/**
- * up_client_get_devices2:
+ * up_client_get_devices:
* @client: a #UpClient instance.
*
* Get a copy of the device objects.
@@ -141,7 +119,7 @@ up_client_get_devices_full (UpClient *client,
* Since: 0.99.8
**/
GPtrArray *
-up_client_get_devices2 (UpClient *client)
+up_client_get_devices (UpClient *client)
{
g_autoptr(GError) error = NULL;
GPtrArray *ret = NULL;
diff --git a/libupower-glib/up-client.h b/libupower-glib/up-client.h
index dfc4853..360ee0e 100644
--- a/libupower-glib/up-client.h
+++ b/libupower-glib/up-client.h
@@ -84,8 +84,7 @@ UpDevice * up_client_get_display_device (UpClient *client);
char * up_client_get_critical_action (UpClient *client);
/* accessors */
-GPtrArray *up_client_get_devices (UpClient *client) G_DEPRECATED_FOR(up_client_get_devices2);
-GPtrArray *up_client_get_devices2 (UpClient *client);
+GPtrArray *up_client_get_devices (UpClient *client);
void up_client_get_devices_async (UpClient *client,
GCancellable *cancellable,
GAsyncReadyCallback callback,
diff --git a/tools/up-tool.c b/tools/up-tool.c
index e599d86..ee4553d 100644
--- a/tools/up-tool.c
+++ b/tools/up-tool.c
@@ -163,7 +163,7 @@ up_tool_do_monitor (UpClient *client)
g_signal_connect (client, "device-removed", G_CALLBACK (up_tool_device_removed_cb), NULL);
g_signal_connect (client, "notify", G_CALLBACK (up_tool_changed_cb), NULL);
- devices = up_client_get_devices2 (client);
+ devices = up_client_get_devices (client);
for (i=0; i < devices->len; i++) {
UpDevice *device;
device = g_ptr_array_index (devices, i);
@@ -239,7 +239,7 @@ main (int argc, char **argv)
if (opt_enumerate || opt_dump) {
GPtrArray *devices;
- devices = up_client_get_devices2 (client);
+ devices = up_client_get_devices (client);
if (!devices) {
g_print ("Failed to get device list\n");
goto out;