[vlc-commits] [Git][videolan/vlc][master] 2 commits: modules: add module_GetShortName shortcut/alias to match long
Hugo Beauzée-Luyssen (@chouquette)
gitlab at videolan.org
Fri Aug 6 08:03:18 UTC 2021
Hugo Beauzée-Luyssen pushed to branch master at VideoLAN / VLC
Commits:
1d408248 by Lyndon Brown at 2021-08-06T07:18:27+00:00
modules: add module_GetShortName shortcut/alias to match long
- - - - -
c17d3ae2 by Lyndon Brown at 2021-08-06T07:18:27+00:00
modules: widen use of module_Get[Long|Short]Name shortcuts
- - - - -
11 changed files:
- include/vlc_modules.h
- lib/audio.c
- lib/core.c
- modules/gui/macosx/preferences/prefs.m
- modules/gui/macosx/preferences/prefs_widgets.m
- modules/gui/qt/dialogs/plugins/plugins.cpp
- modules/gui/qt/dialogs/preferences/complete_preferences.cpp
- modules/gui/qt/dialogs/sout/profile_selector.cpp
- src/config/core.c
- src/input/demux.c
- src/misc/filter_chain.c
Changes:
=====================================
include/vlc_modules.h
=====================================
@@ -205,6 +205,7 @@ VLC_API const char * module_get_object(const module_t *m) VLC_USED;
* \return the short or long name of the module
*/
VLC_API const char *module_get_name(const module_t *m, bool longname) VLC_USED;
+#define module_GetShortName( m ) module_get_name( m, false )
#define module_GetLongName( m ) module_get_name( m, true )
/**
=====================================
lib/audio.c
=====================================
@@ -83,7 +83,7 @@ libvlc_audio_output_t *
}
item->psz_name = strdup( module_get_object( module ) );
- item->psz_description = strdup( module_get_name( module, true ) );
+ item->psz_description = strdup( module_GetLongName( module ) );
if( unlikely(item->psz_name == NULL || item->psz_description == NULL) )
{
free( item->psz_name );
=====================================
lib/core.c
=====================================
@@ -171,8 +171,8 @@ static libvlc_module_description_t *module_description_list_get(
p_list = p_actual;
const char* name = module_get_object( p_module );
- const char* shortname = module_get_name( p_module, false );
- const char* longname = module_get_name( p_module, true );
+ const char* shortname = module_GetShortName( p_module );
+ const char* longname = module_GetLongName( p_module );
const char* help = module_get_help( p_module );
p_actual->psz_name = name ? strdup( name ) : NULL;
p_actual->psz_shortname = shortname ? strdup( shortname ) : NULL;
=====================================
modules/gui/macosx/preferences/prefs.m
=====================================
@@ -623,7 +623,7 @@
@implementation VLCTreePluginItem
- (id)initWithPlugin:(module_t *)plugin
{
- NSString * name = _NS(module_get_name(plugin, false));
+ NSString * name = _NS(module_GetShortName(plugin));
if (self = [super initWithName:name]) {
_configItems = module_config_get(plugin, &_configSize);
//_plugin = plugin;
=====================================
modules/gui/macosx/preferences/prefs_widgets.m
=====================================
@@ -1249,7 +1249,7 @@ o_textfield = [[NSSecureTextField alloc] initWithFrame: s_rc]; \
/* Hack: required subcategory is stored in i_min */
if (p_cfg->i_type == CONFIG_SUBCATEGORY &&
p_cfg->value.i == self.p_item->min.i) {
- NSString *o_description = _NS(module_get_name(p_parser, TRUE));
+ NSString *o_description = _NS(module_GetLongName(p_parser));
if ([newval isEqualToString: o_description]) {
returnval = strdup(module_get_object(p_parser));
break;
@@ -1286,7 +1286,7 @@ o_textfield = [[NSSecureTextField alloc] initWithFrame: s_rc]; \
/* Hack: required subcategory is stored in i_min */
if (p_config->i_type == CONFIG_SUBCATEGORY &&
p_config->value.i == self.p_item->min.i) {
- NSString *o_description = _NS(module_get_name(p_parser, TRUE));
+ NSString *o_description = _NS(module_GetLongName(p_parser));
[o_popup addItemWithTitle: o_description];
if (self.p_item->value.psz && !strcmp(self.p_item->value.psz,
@@ -1968,7 +1968,7 @@ o_textfield = [[NSSecureTextField alloc] initWithFrame: s_rc]; \
if (p_config->i_type == CONFIG_SUBCATEGORY &&
p_config->value.i == p_item->min.i) {
- o_modulelongname = toNSStr(module_get_name(p_parser, TRUE));
+ o_modulelongname = toNSStr(module_GetLongName(p_parser));
o_modulename = toNSStr(module_get_object(p_parser));
if (p_item->value.psz &&
@@ -2008,7 +2008,7 @@ o_moduleenabled = [NSNumber numberWithBool:NO];\
} else if (module_provides(p_parser, p_item->psz_type)) {
- NSString *o_modulelongname = toNSStr(module_get_name(p_parser, TRUE));
+ NSString *o_modulelongname = toNSStr(module_GetLongName(p_parser));
NSString *o_modulename = toNSStr(module_get_object(p_parser));
NSNumber *o_moduleenabled = nil;
=====================================
modules/gui/qt/dialogs/plugins/plugins.cpp
=====================================
@@ -160,7 +160,7 @@ inline void PluginTab::FillTree()
module_t *p_module = p_list[i];
QStringList qs_item;
- qs_item << qfu( module_get_name( p_module, true ) )
+ qs_item << qfu( module_GetLongName( p_module ) )
<< qfu( module_get_capability( p_module ) )
<< QString::number( module_get_score( p_module ) );
#ifndef DEBUG
=====================================
modules/gui/qt/dialogs/preferences/complete_preferences.cpp
=====================================
@@ -249,7 +249,7 @@ PrefsTree::PrefsTree( qt_intf_t *_p_intf, QWidget *_parent,
PrefsItemData *module_data = new PrefsItemData( this );
module_data->i_type = PrefsItemData::TYPE_MODULE;
module_data->psz_shortcut = strdup( module_get_object( p_module ) );
- module_data->name = qfut( module_get_name( p_module, false ) );
+ module_data->name = qfut( module_GetShortName( p_module ) );
module_data->help.clear();
module_data->p_module = p_module;
const char *psz_help = module_get_help( p_module );
=====================================
modules/gui/qt/dialogs/sout/profile_selector.cpp
=====================================
@@ -504,7 +504,7 @@ inline void VLCProfileEditor::registerFilters()
if ( !listWidget ) continue;
- item = new QListWidgetItem( module_get_name( p_module, true ) );
+ item = new QListWidgetItem( module_GetLongName( p_module ) );
item->setCheckState( Qt::Unchecked );
item->setToolTip( QString( module_get_help( p_module ) ) );
item->setData( Qt::UserRole, QString( module_get_object( p_module ) ) );
=====================================
src/config/core.c
=====================================
@@ -282,7 +282,7 @@ static ssize_t config_ListModules (const char *cap, char ***restrict values,
{
vals[i] = strdup (module_get_object (list[i - 1]));
txts[i] = strdup (module_gettext (list[i - 1],
- module_get_name (list[i - 1], true)));
+ module_GetLongName (list[i - 1])));
if( !vals[i] || !txts[i])
goto error;
}
=====================================
src/input/demux.c
=====================================
@@ -503,8 +503,8 @@ static bool demux_filter_enable_disable(demux_t *p_demux,
struct vlc_demux_private *priv = vlc_stream_Private(p_demux);
if ( psz_demux &&
- (strcmp(module_get_name(priv->module, false), psz_demux) == 0
- || strcmp(module_get_name(priv->module, true), psz_demux) == 0) )
+ (strcmp(module_GetShortName(priv->module), psz_demux) == 0
+ || strcmp(module_GetLongName(priv->module), psz_demux) == 0) )
{
demux_Control( p_demux,
b_enable ? DEMUX_FILTER_ENABLE : DEMUX_FILTER_DISABLE );
=====================================
src/misc/filter_chain.c
=====================================
@@ -277,7 +277,7 @@ static filter_t *filter_chain_AppendInner( filter_chain_t *chain,
vlc_picture_chain_Init( &chained->pending );
msg_Dbg( chain->obj, "Filter '%s' (%p) appended to chain",
- (name != NULL) ? name : module_get_name(filter->p_module, false),
+ (name != NULL) ? name : module_GetShortName(filter->p_module),
(void *)filter );
return filter;
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/1516912726a503575e4c790f200f657f3aafe964...c17d3ae27f2d9af2a6408b0841b1776a30f8213b
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/1516912726a503575e4c790f200f657f3aafe964...c17d3ae27f2d9af2a6408b0841b1776a30f8213b
You're receiving this email because of your account on code.videolan.org.
More information about the vlc-commits
mailing list