[vlc-commits] xcb_app: no longer use SD item category

Rémi Denis-Courmont git at videolan.org
Sun May 14 18:37:52 CEST 2017


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun May 14 10:43:17 2017 +0300| [87ae58d7906ebf916337d369003eadfaa13e656e] | committer: Rémi Denis-Courmont

xcb_app: no longer use SD item category

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=87ae58d7906ebf916337d369003eadfaa13e656e
---

 modules/services_discovery/xcb_apps.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/modules/services_discovery/xcb_apps.c b/modules/services_discovery/xcb_apps.c
index da13db12aa..4e8eddc527 100644
--- a/modules/services_discovery/xcb_apps.c
+++ b/modules/services_discovery/xcb_apps.c
@@ -65,6 +65,7 @@ struct services_discovery_sys_t
     xcb_atom_t        net_wm_name;
     xcb_window_t      root_window;
     void             *apps;
+    input_item_t     *apps_root;
 };
 
 static void *Run (void *);
@@ -163,6 +164,11 @@ static int Open (vlc_object_t *obj)
     }
 
     p_sys->apps = NULL;
+    p_sys->apps_root = input_item_NewExt("vlc://nop", _("Applications"), -1,
+                                         ITEM_TYPE_NODE, ITEM_LOCAL);
+    if (likely(p_sys->apps_root != NULL))
+        services_discovery_AddItem(sd, p_sys->apps_root);
+
     UpdateApps (sd);
 
     if (vlc_clone (&p_sys->thread, Run, sd, VLC_THREAD_PRIORITY_LOW))
@@ -172,6 +178,8 @@ static int Open (vlc_object_t *obj)
 error:
     xcb_disconnect (p_sys->conn);
     tdestroy (p_sys->apps, DelApp);
+    if (p_sys->apps_root != NULL)
+        input_item_Release(p_sys->apps_root);
     free (p_sys);
     return VLC_EGENERIC;
 }
@@ -189,6 +197,8 @@ static void Close (vlc_object_t *obj)
     vlc_join (p_sys->thread, NULL);
     xcb_disconnect (p_sys->conn);
     tdestroy (p_sys->apps, DelApp);
+    if (p_sys->apps_root != NULL)
+        input_item_Release(p_sys->apps_root);
     free (p_sys);
 }
 
@@ -272,7 +282,7 @@ static struct app *AddApp (services_discovery_t *sd, xcb_window_t xid)
     app->xid = xid;
     app->item = item;
     app->owner = sd;
-    services_discovery_AddItemCat(sd, item, _("Applications"));
+    input_item_PostSubItem(p_sys->apps_root, item);
     return app;
 }
 



More information about the vlc-commits mailing list