[vlc-commits] zsh completion: use public module interface

Sebastian Ramacher git at videolan.org
Tue Oct 3 17:23:28 CEST 2017


vlc | branch: master | Sebastian Ramacher <sramacher at debian.org> | Mon Oct  2 01:11:14 2017 +0200| [38763a6b6e5743ed7d4f4a3fa73ab3f9d6c94d47] | committer: Hugo Beauzée-Luyssen

zsh completion: use public module interface

Signed-off-by: Sebastian Ramacher <sramacher at debian.org>
Signed-off-by: Hugo Beauzée-Luyssen <hugo at beauzee.fr>

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

 extras/analyser/zsh.cpp | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/extras/analyser/zsh.cpp b/extras/analyser/zsh.cpp
index 1cfcc0640f..0c99a7b6e0 100644
--- a/extras/analyser/zsh.cpp
+++ b/extras/analyser/zsh.cpp
@@ -36,7 +36,6 @@
 #include <vlc_common.h>
 #include <vlc_modules.h>
 #include <vlc_plugin.h>
-#include "../src/modules/modules.h" /* evil hack */
 
 typedef std::pair<std::string, std::string> mpair;
 typedef std::multimap<std::string, std::string> mumap;
@@ -193,12 +192,14 @@ static void ParseOption(const module_config_t *item)
 
 static void PrintModule(const module_t *mod)
 {
-    const char *name = mod->pp_shortcuts[0];
-    if (!strcmp(name, "main"))
+    if (module_is_main(mod))
         return;
 
-    if (mod->psz_capability)
-        capabilities.insert(mpair(mod->psz_capability, name));
+    const char *name = module_get_object(mod);
+    const char *cap = module_get_capability(mod);
+
+    if (strcmp(cap, "none"))
+        capabilities.insert(mpair(cap, name));
 
     unsigned int cfg_size = 0;
     module_config_t *cfg_list = module_config_get(mod, &cfg_size);



More information about the vlc-commits mailing list