[gupnp] Also disable managed RootDevices on WL change
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gupnp] Also disable managed RootDevices on WL change
- Date: Sat, 1 Feb 2014 09:49:24 +0000 (UTC)
commit 128fd741ffa874a31141b18e96b7afea99156f6f
Author: Jens Georg <mail jensge org>
Date: Sun Nov 3 15:59:02 2013 +0100
Also disable managed RootDevices on WL change
The white-list change listener only handles control points currently.
https://bugzilla.gnome.org/show_bug.cgi?id=711332
libgupnp/gupnp-context-manager.c | 27 ++++++++++++++++++---------
1 files changed, 18 insertions(+), 9 deletions(-)
---
diff --git a/libgupnp/gupnp-context-manager.c b/libgupnp/gupnp-context-manager.c
index 685e150..f28fb10 100644
--- a/libgupnp/gupnp-context-manager.c
+++ b/libgupnp/gupnp-context-manager.c
@@ -177,20 +177,19 @@ gupnp_context_manager_filter_context (GUPnPWhiteList *white_list,
GList *obj;
GList *blk;
gboolean match;
- GUPnPContext *context;
- GSSDPResourceBrowser *browser;
obj = manager->priv->objects;
blk = manager->priv->blacklisted;
while (obj != NULL) {
- if (!GUPNP_IS_CONTROL_POINT (obj->data))
- continue;
-
/* If the white list is empty, treat it as disabled */
if (check) {
- /* Filter out context */
- context = gupnp_control_point_get_context (obj->data);
+ GUPnPContext *context;
+
+ g_object_get (G_OBJECT (obj->data),
+ "context", &context,
+ NULL);
+
match = gupnp_white_list_check_context (white_list,
context);
} else {
@@ -198,8 +197,18 @@ gupnp_context_manager_filter_context (GUPnPWhiteList *white_list,
match = TRUE;
}
- browser = GSSDP_RESOURCE_BROWSER (obj->data);
- gssdp_resource_browser_set_active (browser, match);
+ if (GUPNP_IS_CONTROL_POINT (obj->data)) {
+ GSSDPResourceBrowser *browser;
+
+ browser = GSSDP_RESOURCE_BROWSER (obj->data);
+ gssdp_resource_browser_set_active (browser, match);
+ } else if (GUPNP_IS_ROOT_DEVICE (obj->data)) {
+ GSSDPResourceGroup *group;
+
+ group = GSSDP_RESOURCE_GROUP (obj->data);
+ gssdp_resource_group_set_available (group, match);
+ } else
+ g_assert_not_reached ();
obj = obj->next;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]