summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBilal Elmoussaoui <bil.elmoussaoui@gmail.com>2022-01-11 11:45:13 +0100
committerBilal Elmoussaoui <bil.elmoussaoui@gmail.com>2022-01-11 11:46:06 +0100
commit69deee06c344812073837fd4b054bf25ff8d367f (patch)
tree5fa1b8fdd2380a49efedc6081739fc8f2087137c
parentdf071a060190de925628afd0aa2e9ec739bf90d8 (diff)
GClueSimple: provide a _finish variant for the new_with_tresholds
Otherwise most of the bindings will fail because they expect a corresponding _finish function. There is currently no annotation to specify a different _finish function which could avoid us duplicating the function here. Fixes #159
-rw-r--r--demo/where-am-i.c2
-rw-r--r--libgeoclue/gclue-simple.c20
-rw-r--r--libgeoclue/gclue-simple.h2
3 files changed, 22 insertions, 2 deletions
diff --git a/demo/where-am-i.c b/demo/where-am-i.c
index eaf0f65..aa873a4 100644
--- a/demo/where-am-i.c
+++ b/demo/where-am-i.c
@@ -146,7 +146,7 @@ on_simple_ready (GObject *source_object,
{
GError *error = NULL;
- simple = gclue_simple_new_finish (res, &error);
+ simple = gclue_simple_new_with_thresholds_finish (res, &error);
if (error != NULL) {
g_critical ("Failed to connect to GeoClue2 service: %s", error->message);
diff --git a/libgeoclue/gclue-simple.c b/libgeoclue/gclue-simple.c
index 12c6061..fb299c0 100644
--- a/libgeoclue/gclue-simple.c
+++ b/libgeoclue/gclue-simple.c
@@ -776,6 +776,24 @@ gclue_simple_new_finish (GAsyncResult *result,
return NULL;
}
+/**
+ * gclue_simple_new_with_thresholds_finish:
+ * @result: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to
+ * #gclue_simple_new_with_thresholds().
+ * @error: Return location for error or %NULL.
+ *
+ * Finishes an operation started with #gclue_simple_new_with_thresholds().
+ *
+ * Returns: (transfer full) (type GClueSimple): The constructed proxy
+ * object or %NULL if @error is set.
+ */
+GClueSimple *
+gclue_simple_new_with_thresholds_finish (GAsyncResult *result,
+ GError **error)
+{
+ return gclue_simple_new_finish (result, error);
+}
+
static void
on_simple_ready (GObject *source_object,
GAsyncResult *res,
@@ -854,7 +872,7 @@ gclue_simple_new_sync (const char *desktop_id,
* @user_data: User data to pass to @callback.
*
* Asynchronously creates a #GClueSimple instance. Use
- * #gclue_simple_new_finish() to get the created #GClueSimple instance.
+ * #gclue_simple_new_with_thresholds_finish() to get the created #GClueSimple instance.
*
* See #gclue_simple_new_with_thresholds_sync() for the synchronous,
* blocking version of this function.
diff --git a/libgeoclue/gclue-simple.h b/libgeoclue/gclue-simple.h
index 97fe27b..566db3c 100644
--- a/libgeoclue/gclue-simple.h
+++ b/libgeoclue/gclue-simple.h
@@ -79,6 +79,8 @@ void gclue_simple_new_with_thresholds
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
+GClueSimple * gclue_simple_new_with_thresholds_finish (GAsyncResult *result,
+ GError **error);
GClueSimple * gclue_simple_new_with_thresholds_sync
(const char *desktop_id,
GClueAccuracyLevel accuracy_level,