[gupnp/wip/gi-docgen: 54/61] doc: Update Context docs




commit 391cc0d4ea780240e5613a5adf3a52eeaae1f34b
Author: Jens Georg <mail jensge org>
Date:   Thu Dec 30 13:35:34 2021 +0100

    doc: Update Context docs

 libgupnp/gupnp-context-filter.c  | 17 +++++++++--------
 libgupnp/gupnp-context-manager.c |  4 ++--
 libgupnp/gupnp-context.c         | 12 +++++-------
 3 files changed, 16 insertions(+), 17 deletions(-)
---
diff --git a/libgupnp/gupnp-context-filter.c b/libgupnp/gupnp-context-filter.c
index ecc32a9..4770689 100644
--- a/libgupnp/gupnp-context-filter.c
+++ b/libgupnp/gupnp-context-filter.c
@@ -19,15 +19,15 @@ typedef struct _GUPnPContextFilterPrivate GUPnPContextFilterPrivate;
 /**
  * GUPnPContextFilter:
  *
- * Class for network context filtering.
+ * Network context filter, used by [class@GUPnP.ContextManager]
  *
  * #GUPnPContextFilter handles network filtering. It provides API to manage a
  * list of entries that will be used to filter networks. The #GUPnPContextFilter
  * could be enabled or not. If it's enabled but the entries list is empty, it
- * behaves as disabled.
+ * behaves as if being disabled.
  *
  * The GUPnPContextFilter is used with the [class@GUPnP.ContextManager]
- * to narrow down the contexts that notified by it.
+ * to narrow down the contexts that are notified by it.
  *
  * Contexts can be filtered by the following criteria:
  *
@@ -41,7 +41,7 @@ typedef struct _GUPnPContextFilterPrivate GUPnPContextFilterPrivate;
  * By default, a context filter is empty and disabled.
  *
  * For example, to only react to contexts that are appearing on eth0 or when being in the WiFi network with
- * the SSID "HomeNetwork", you should do:
+ * the SSID "HomeNetwork", and on IPv6 localhost, you should do:
  *
  *
  * ```c
@@ -51,6 +51,7 @@ typedef struct _GUPnPContextFilterPrivate GUPnPContextFilterPrivate;
  * const char *filter_entries[] = {
  *     "eth0",
  *     "HomeNetwork",
+ *     "::1",
  *     NULL
  * };
  * gupnp_context_filter_add_entryv (filter, filter_entries);
@@ -316,8 +317,8 @@ gupnp_context_filter_add_entry (GUPnPContextFilter *context_filter,
  * @entries: (array zero-terminated=1): A %NULL-terminated list of strings
  *
  * Add a list of entries to a #GUPnPContextFilter. This is a helper function to
- * directly add a %NULL-terminated array of string usually aquired from
- * commandline args.
+ * directly add a %NULL-terminated array of string usually acquired from
+ * command line arguments.
  *
  * Since: 1.4.0
  */
@@ -419,11 +420,11 @@ gupnp_context_filter_clear (GUPnPContextFilter *context_filter)
  * @context: A #GUPnPContext to test.
  *
  * It will check if the @context is allowed or not. The @context_filter will
- * check all its entries againt #GUPnPContext interface, host ip and network
+ * check all its entries against #GUPnPContext interface, host IP and network
  * fields information. This function doesn't take into account the
  * @context_filter status (enabled or not).
  *
- * Return value: %TRUE if @context is matching the @context_filter criterias,
+ * Return value: %TRUE if @context is matching the @context_filter criteria,
  * %FALSE otherwise.
  *
  * Since: 1.4.0
diff --git a/libgupnp/gupnp-context-manager.c b/libgupnp/gupnp-context-manager.c
index bf22d57..918cd50 100644
--- a/libgupnp/gupnp-context-manager.c
+++ b/libgupnp/gupnp-context-manager.c
@@ -57,9 +57,9 @@ typedef struct _GUPnPContextManagerPrivate GUPnPContextManagerPrivate;
 /**
  * GUPnPContextManager:
  *
- * Manages GUPnPContext objects.
+ * A manager for [class@GUPnP.Context] instances.
  *
- * An utility class that takes care of dynamic creation and destruction of
+ * This utility class that takes care of dynamic creation and destruction of
  * #GUPnPContext objects for all available network interfaces as they go up
  * (connect) and down (disconnect), respectively.
  *
diff --git a/libgupnp/gupnp-context.c b/libgupnp/gupnp-context.c
index 906f396..bef53f8 100644
--- a/libgupnp/gupnp-context.c
+++ b/libgupnp/gupnp-context.c
@@ -614,8 +614,9 @@ gupnp_context_new (const char   *iface,
                                NULL);
 }
 
+\
 /**
- * gupnp_context_get_port:(attributes org.gtk.Method.get_property=port)
+ * gupnp_context_get_port:
  * @context: A #GUPnPContext
  *
  * Get the port that the SOAP server is running on.
@@ -625,15 +626,12 @@ gupnp_context_new (const char   *iface,
 guint
 gupnp_context_get_port (GUPnPContext *context)
 {
-        GUPnPContextPrivate *priv;
-
         g_return_val_if_fail (GUPNP_IS_CONTEXT (context), 0);
-        priv = gupnp_context_get_instance_private (context);
 
-        if (priv->server_uri == NULL)
-                priv->server_uri = make_server_uri (context);
+        GUri *uri = _gupnp_context_get_server_uri (context);
+        g_uri_unref (uri);
 
-        return g_uri_get_port (priv->server_uri);
+        return g_uri_get_port (uri);
 }
 
 /**


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