Commit e7859061 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Use module_IsCapable

parent 6c11c08a
......@@ -216,15 +216,15 @@ void ExtVideo::ChangeVFiltersString( char *psz_name, vlc_bool_t b_add )
return;
}
if( !strcmp( ((module_t*)p_obj)->psz_capability, "video filter2" ) )
if( module_IsCapable( (module_t*)p_obj, "video filter2" ) )
{
psz_filter_type = "video-filter";
}
else if( !strcmp( ((module_t*)p_obj)->psz_capability, "video filter" ) )
else if( module_IsCapable( (module_t*)p_obj, "video filter" ) )
{
psz_filter_type = "vout-filter";
}
else if( !strcmp( ((module_t*)p_obj)->psz_capability, "sub filter" ) )
else if( module_IsCapable( (module_t*)p_obj, "sub filter" ) )
{
psz_filter_type = "sub-filter";
}
......
......@@ -452,7 +452,7 @@ void ModuleConfigControl::finish( bool bycat )
combo->setCurrentIndex( combo->count() - 1 );
}
}
else if( !strcmp( p_parser->psz_capability, p_item->psz_type ) )
else if( module_IsCapable( p_parser, p_item->psz_type ) )
{
combo->addItem( qtr(p_parser->psz_longname),
QVariant( p_parser->psz_object_name ) );
......@@ -572,7 +572,7 @@ void ModuleListConfigControl::finish( bool bycat )
}
}
}
else if( !strcmp( p_parser->psz_capability, p_item->psz_type ) )
else if( module_IsCapable( p_parser, p_item->psz_type ) )
{
CHECKBOX_LISTS;
}
......
......@@ -428,31 +428,29 @@ QMenu *QVLCMenu::SDMenu( intf_thread_t *p_intf )
for( int i_index = 0 ; i_index < p_list->i_count; i_index++ )
{
module_t * p_parser = (module_t *)p_list->p_values[i_index].p_object ;
if( !strcmp( p_parser->psz_capability, "services_discovery" ) )
if( module_IsCapable( p_parser, "services_discovery" ) )
i_num++;
}
for( int i_index = 0 ; i_index < p_list->i_count; i_index++ )
{
module_t * p_parser = (module_t *)p_list->p_values[i_index].p_object;
if( !strcmp( p_parser->psz_capability, "services_discovery" ) )
{
QAction *a = new QAction( qfu( p_parser->psz_longname ), menu );
a->setCheckable( true );
/* hack to handle submodules properly */
int i = -1;
while( p_parser->pp_shortcuts[++i] != NULL );
i--;
if( playlist_IsServicesDiscoveryLoaded( THEPL,
i>=0?p_parser->pp_shortcuts[i]
: p_parser->psz_object_name ) )
{
a->setChecked( true );
}
CONNECT( a , triggered(), THEDP->SDMapper, map() );
THEDP->SDMapper->setMapping( a, i>=0? p_parser->pp_shortcuts[i] :
p_parser->psz_object_name );
menu->addAction( a );
}
if( !module_IsCapable( p_parser, "services_discovery" ) )
continue;
QAction *a = new QAction( qfu( p_parser->psz_longname ), menu );
a->setCheckable( true );
/* hack to handle submodules properly */
int i = -1;
while( p_parser->pp_shortcuts[++i] != NULL );
i--;
if( playlist_IsServicesDiscoveryLoaded( THEPL,
i>=0?p_parser->pp_shortcuts[i]
: p_parser->psz_object_name ) )
a->setChecked( true );
CONNECT( a , triggered(), THEDP->SDMapper, map() );
THEDP->SDMapper->setMapping( a, i>=0? p_parser->pp_shortcuts[i] :
p_parser->psz_object_name );
menu->addAction( a );
}
vlc_list_release( p_list );
return menu;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment