]> git.sesse.net Git - vlc/blobdiff - src/modules/entry.c
Fix compilation of set_text_domain() macro
[vlc] / src / modules / entry.c
index a9a7e7d269e7f613bf14c14be550f2058c3cdfc7..c97739dbd8ca7c69622dd4d9305814692ab84bac 100644 (file)
 #include "config/configuration.h"
 #include "libvlc.h"
 
-static const char *mdgettext (const char *domain, const char *msg)
-{
-    assert (msg);
-#ifdef ENABLE_NLS
-    if (*msg) /* Do not translate ""! */
-        return dgettext (domain, msg);
-#endif
-    return msg;
-}
-
 static void vlc_module_destruct (gc_object_t *obj)
 {
     module_t *module = vlc_priv (obj, module_t);
@@ -117,8 +107,9 @@ module_t *vlc_submodule_create (module_t *module)
     module->submodule_count++;
 
     /* Muahahaha! Heritage! Polymorphism! Ugliness!! */
-    memcpy (submodule->pp_shortcuts, module->pp_shortcuts,
-            sizeof (submodule->pp_shortcuts));
+    submodule->pp_shortcuts[0] = module->pp_shortcuts[0]; /* object name */
+    for (unsigned i = 1; i < MODULE_SHORTCUT_MAX; i++)
+        submodule->pp_shortcuts[i] = NULL;
 
     submodule->psz_object_name = strdup( module->psz_object_name );
     submodule->psz_shortname = module->psz_shortname;
@@ -235,31 +226,21 @@ int vlc_plugin_set (module_t *module, module_config_t *item, int propid, ...)
         }
 
         case VLC_MODULE_SHORTNAME:
-        {
-            const char *domain = va_arg (ap, const char *);
-            if (domain == NULL)
-                domain = PACKAGE;
-            module->psz_shortname = mdgettext (domain, va_arg (ap, char *));
+            module->psz_shortname = va_arg (ap, char *);
             break;
-        }
 
         case VLC_MODULE_DESCRIPTION:
-        {
-            const char *domain = va_arg (ap, const char *);
-            if (domain == NULL)
-                domain = PACKAGE;
-            module->psz_longname = mdgettext (domain, va_arg (ap, char *));
+            module->psz_longname = va_arg (ap, char *);
             break;
-        }
 
         case VLC_MODULE_HELP:
-        {
-            const char *domain = va_arg (ap, const char *);
-            if (domain == NULL)
-                domain = PACKAGE;
-            module->psz_help = mdgettext (domain, va_arg (ap, char *));
+            module->psz_help = va_arg (ap, char *);
+            break;
+
+        case VLC_MODULE_TEXTDOMAIN:
+            (void) va_arg (ap, const char *);
+            /* FIXME: not implemented */
             break;
-        }
 
         case VLC_CONFIG_NAME:
         {
@@ -362,21 +343,16 @@ int vlc_plugin_set (module_t *module, module_config_t *item, int propid, ...)
 
         case VLC_CONFIG_DESC:
         {
-            const char *domain = va_arg (ap, const char *);
             const char *text = va_arg (ap, const char *);
             const char *longtext = va_arg (ap, const char *);
 
-            if (domain == NULL)
-                domain = PACKAGE;
-            item->psz_text = text ? strdup (mdgettext (domain, text)) : NULL;
-            item->psz_longtext =
-                longtext ? strdup (mdgettext (domain, longtext)) : NULL;
+            item->psz_text = text ? strdup (text) : NULL;
+            item->psz_longtext = longtext ? strdup (longtext) : NULL;
             break;
         }
 
         case VLC_CONFIG_LIST:
         {
-            const char *domain = va_arg (ap, const char *);
             size_t len = va_arg (ap, size_t);
 
             /* Copy values */
@@ -410,9 +386,6 @@ int vlc_plugin_set (module_t *module, module_config_t *item, int propid, ...)
                 break;
 
             /* Copy textual descriptions */
-            if (domain == NULL)
-                domain = PACKAGE;
-
             const char *const *text = va_arg (ap, const char *const *);
             if (text != NULL)
             {
@@ -420,9 +393,7 @@ int vlc_plugin_set (module_t *module, module_config_t *item, int propid, ...)
                 if( dtext != NULL )
                 {
                     for (size_t i = 0; i < len; i++)
-                        dtext[i] = text[i] ?
-                                        strdup (mdgettext( domain, text[i] )) :
-                                        NULL;
+                        dtext[i] = text[i] ? strdup (text[i]) : NULL;
                     dtext[len] = NULL;
                 }
                 item->ppsz_list_text = dtext;
@@ -437,7 +408,6 @@ int vlc_plugin_set (module_t *module, module_config_t *item, int propid, ...)
 
         case VLC_CONFIG_ADD_ACTION:
         {
-            const char *domain = va_arg (ap, const char *);
             vlc_callback_t cb = va_arg (ap, vlc_callback_t), *tabcb;
             const char *name = va_arg (ap, const char *);
             char **tabtext;
@@ -456,10 +426,8 @@ int vlc_plugin_set (module_t *module, module_config_t *item, int propid, ...)
                 break;
             item->ppsz_action_text = tabtext;
 
-            if (domain == NULL)
-                domain = PACKAGE;
             if (name)
-                tabtext[item->i_action] = strdup (mdgettext (domain, name));
+                tabtext[item->i_action] = strdup (name);
             else
                 tabtext[item->i_action] = NULL;
             tabtext[item->i_action + 1] = NULL;