[gnome-software/mwleeds/fix-unique-id-docs] gs-app: Fix docs for gs_app_{get, set}_unique_id()




commit 34da65325f079e8eb68413b5300d4697b8648100
Author: Phaedrus Leeds <mwleeds protonmail com>
Date:   Thu Jun 2 12:19:43 2022 -0700

    gs-app: Fix docs for gs_app_{get,set}_unique_id()
    
    Fix a few inaccuracies

 lib/gs-app.c | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)
---
diff --git a/lib/gs-app.c b/lib/gs-app.c
index 125a5e008..26eaa9c6e 100644
--- a/lib/gs-app.c
+++ b/lib/gs-app.c
@@ -1422,9 +1422,13 @@ gs_app_set_kind (GsApp *app, AsComponentKind kind)
  * @app: a #GsApp
  *
  * Gets the unique application ID used for de-duplication.
- * If nothing has been set the value from gs_app_get_id() will be used.
  *
- * Returns: The unique ID, e.g. `system/package/fedora/desktop/gimp.desktop/i386/master`, or %NULL
+ * The format is "<scope>/<kind>/<origin>/<id>/<branch>". Any unset fields will
+ * appear as "*". This string can be used with libappstream's functions for
+ * handling data IDs, e.g.
+ * https://www.freedesktop.org/software/appstream/docs/api/appstream-as-utils.html#as-utils-data-id-valid
+ *
+ * Returns: The unique ID, e.g. `user/fedora/\*\/gimp.desktop/\*`, or %NULL
  *
  * Since: 3.22
  **/
@@ -1441,11 +1445,12 @@ gs_app_get_unique_id (GsApp *app)
 /**
  * gs_app_set_unique_id:
  * @app: a #GsApp
- * @unique_id: a unique application ID, e.g. `system/package/fedora/desktop/gimp.desktop/i386/master`
+ * @unique_id: a unique application ID, e.g. `user/fedora/\*\/gimp.desktop/\*`
  *
- * Sets the unique application ID. Any #GsApp using the same ID will be
- * deduplicated. This means that applications that can exist from more than
- * one plugin should use this method.
+ * Sets the unique application ID used for de-duplication. See
+ * gs_app_get_unique_id() for information about the format. Normally you should
+ * not have to use this function since the unique ID can be constructed from
+ * other fields, but it can be useful for unit tests.
  */
 void
 gs_app_set_unique_id (GsApp *app, const gchar *unique_id)


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