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 ) ...@@ -216,15 +216,15 @@ void ExtVideo::ChangeVFiltersString( char *psz_name, vlc_bool_t b_add )
return; 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"; 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"; 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"; psz_filter_type = "sub-filter";
} }
......
...@@ -452,7 +452,7 @@ void ModuleConfigControl::finish( bool bycat ) ...@@ -452,7 +452,7 @@ void ModuleConfigControl::finish( bool bycat )
combo->setCurrentIndex( combo->count() - 1 ); 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), combo->addItem( qtr(p_parser->psz_longname),
QVariant( p_parser->psz_object_name ) ); QVariant( p_parser->psz_object_name ) );
...@@ -572,7 +572,7 @@ void ModuleListConfigControl::finish( bool bycat ) ...@@ -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; CHECKBOX_LISTS;
} }
......
...@@ -428,31 +428,29 @@ QMenu *QVLCMenu::SDMenu( intf_thread_t *p_intf ) ...@@ -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++ ) 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 ; 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++; i_num++;
} }
for( int i_index = 0 ; i_index < p_list->i_count; i_index++ ) 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; 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" ) )
{ continue;
QAction *a = new QAction( qfu( p_parser->psz_longname ), menu );
a->setCheckable( true ); QAction *a = new QAction( qfu( p_parser->psz_longname ), menu );
/* hack to handle submodules properly */ a->setCheckable( true );
int i = -1; /* hack to handle submodules properly */
while( p_parser->pp_shortcuts[++i] != NULL ); int i = -1;
i--; while( p_parser->pp_shortcuts[++i] != NULL );
if( playlist_IsServicesDiscoveryLoaded( THEPL, i--;
i>=0?p_parser->pp_shortcuts[i] if( playlist_IsServicesDiscoveryLoaded( THEPL,
: p_parser->psz_object_name ) ) i>=0?p_parser->pp_shortcuts[i]
{ : p_parser->psz_object_name ) )
a->setChecked( true ); a->setChecked( true );
} CONNECT( a , triggered(), THEDP->SDMapper, map() );
CONNECT( a , triggered(), THEDP->SDMapper, map() ); THEDP->SDMapper->setMapping( a, i>=0? p_parser->pp_shortcuts[i] :
THEDP->SDMapper->setMapping( a, i>=0? p_parser->pp_shortcuts[i] : p_parser->psz_object_name );
p_parser->psz_object_name ); menu->addAction( a );
menu->addAction( a );
}
} }
vlc_list_release( p_list ); vlc_list_release( p_list );
return menu; 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