Commit 9a78b063 authored by Clément Stenac's avatar Clément Stenac

A bit of cleanup

parent ba0aca83
......@@ -61,11 +61,6 @@
PrefsTree::PrefsTree( intf_thread_t *_p_intf, QWidget *_parent ) :
QTreeWidget( _parent ), p_intf( _p_intf )
{
module_t *p_module;
vlc_list_t *p_list = vlc_list_find( p_intf, VLC_OBJECT_MODULE,
FIND_ANYWHERE );
if( !p_list ) return;
setColumnCount( 1 );
setIconSize( QSize( ITEM_HEIGHT,ITEM_HEIGHT ) );
setAlternatingRowColors( true );
......@@ -83,14 +78,20 @@ PrefsTree::PrefsTree( intf_thread_t *_p_intf, QWidget *_parent ) :
/* Build the tree for the main module */
int i_index;
module_t *p_module;
vlc_list_t *p_list = vlc_list_find( p_intf, VLC_OBJECT_MODULE,
FIND_ANYWHERE );
bool found = true;
if( !p_list ) return;
for( i_index = 0; i_index < p_list->i_count; i_index++ )
{
p_module = (module_t *)p_list->p_values[i_index].p_object;
if( !strcmp( p_module->psz_object_name, "main" ) )
break;
if( !strcmp( p_module->psz_object_name, "main" ) ) {
found = true; break;
}
if( i_index < p_list->i_count )
{
}
assert( found );
module_config_t *p_item = p_module->p_config;
PrefsItemData *data = NULL;
QTreeWidgetItem *current_item = NULL;
......@@ -182,7 +183,6 @@ PrefsTree::PrefsTree( intf_thread_t *_p_intf, QWidget *_parent ) :
break;
}
} while( p_item->i_type != CONFIG_HINT_END && p_item++ );
}
/* Build the tree of plugins */
for( int i_index = 0; i_index < p_list->i_count; i_index++ )
......@@ -284,7 +284,6 @@ void PrefsTree::cleanAll()
doAll( true );
}
/// \todo When cleaning, we should remove the panel ?
void PrefsTree::doAll( bool doclean )
{
for( int i_cat_index = 0 ; i_cat_index < topLevelItemCount();
......@@ -350,29 +349,9 @@ PrefsPanel::PrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
p_module = (module_t *) vlc_object_get( p_intf, data->i_object_id );
else
{
/* List the plugins */
int i_index;
vlc_bool_t b_found = VLC_FALSE;
vlc_list_t *p_list = vlc_list_find( p_intf,
VLC_OBJECT_MODULE, FIND_ANYWHERE );
if( !p_list ) return;
for( i_index = 0; i_index < p_list->i_count; i_index++ )
{
p_module = (module_t *)p_list->p_values[i_index].p_object;
if( !strcmp( p_module->psz_object_name, "main" ) )
{
b_found = VLC_TRUE;
break;
}
}
if( !p_module && !b_found )
{
msg_Warn( p_intf, "unable to create preferences (main not found)");
return;
}
if( p_module ) vlc_object_yield( p_module );
vlc_list_release( p_list );
p_module = config_FindModule( p_intf, "main" );
assert( p_module );
vlc_object_yield( p_module );
}
if( p_module->b_submodule )
......
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