From 69db070ffbb796237b6a073708668ac0dd0d9402 Mon Sep 17 00:00:00 2001 From: =?utf8?q?R=C3=A9mi=20Denis-Courmont?= Date: Sat, 4 Aug 2007 18:03:18 +0000 Subject: [PATCH] Use module_* --- .../qt4/components/complete_preferences.cpp | 13 +++++------ .../qt4/components/preferences_widgets.cpp | 22 +++++++++---------- modules/gui/qt4/menus.cpp | 9 ++++---- 3 files changed, 21 insertions(+), 23 deletions(-) diff --git a/modules/gui/qt4/components/complete_preferences.cpp b/modules/gui/qt4/components/complete_preferences.cpp index 1510c5d841..dbba8dd4d0 100644 --- a/modules/gui/qt4/components/complete_preferences.cpp +++ b/modules/gui/qt4/components/complete_preferences.cpp @@ -88,7 +88,7 @@ PrefsTree::PrefsTree( intf_thread_t *_p_intf, QWidget *_parent ) : assert (i < (unsigned)p_list->i_count); const module_t *p_main = (module_t *)p_list->p_values[i].p_object; - if( strcmp( p_main->psz_object_name, "main" ) == 0 ) + if( strcmp( module_GetObjName( p_main ), "main" ) == 0 ) p_module = p_main; } @@ -191,7 +191,7 @@ PrefsTree::PrefsTree( intf_thread_t *_p_intf, QWidget *_parent ) : p_module = (module_t *)p_list->p_values[i_index].p_object; // Main module excluded - if( !strcmp( p_module->psz_object_name, "main" ) ) continue; + if( !strcmp( module_GetObjName( p_module ), "main" ) ) continue; /* Exclude submodules; they have no config options of their own */ if( p_module->b_submodule ) continue; @@ -252,15 +252,14 @@ PrefsTree::PrefsTree( intf_thread_t *_p_intf, QWidget *_parent ) : PrefsItemData *module_data = new PrefsItemData(); module_data->b_submodule = p_module->b_submodule; module_data->i_type = TYPE_MODULE; - module_data->psz_name = strdup( p_module->psz_object_name ); + module_data->psz_name = strdup( module_GetObjName( p_module ) ); module_data->i_object_id = p_module->b_submodule ? ((module_t *)p_module->p_parent)->i_object_id : p_module->i_object_id; module_data->help.clear(); // TODO image QTreeWidgetItem *module_item = new QTreeWidgetItem(); - module_item->setText( 0, qtr( p_module->psz_shortname ? - p_module->psz_shortname : p_module->psz_object_name) ); + module_item->setText( 0, qtr( module_GetName( p_module, VLC_FALSE ) ) ); //item->setIcon( 0 , XXX ); module_item->setData( 0, Qt::UserRole, QVariant::fromValue( module_data) ); @@ -390,11 +389,11 @@ PrefsPanel::PrefsPanel( intf_thread_t *_p_intf, QWidget *_parent, } else { - head = QString( qtr(p_module->psz_longname) ); + head = QString( qtr( module_GetLongName( p_module ) ) ); if( p_module->psz_help ) { help.append( "\n" ); - help.append( qtr( p_module->psz_help ) ); + help.append( qtr( module_GetHelp( p_module ) ) ); } } diff --git a/modules/gui/qt4/components/preferences_widgets.cpp b/modules/gui/qt4/components/preferences_widgets.cpp index 2df114a4c0..3e23ff9967 100644 --- a/modules/gui/qt4/components/preferences_widgets.cpp +++ b/modules/gui/qt4/components/preferences_widgets.cpp @@ -437,7 +437,7 @@ void ModuleConfigControl::finish( bool bycat ) if( bycat ) { - if( !strcmp( p_parser->psz_object_name, "main" ) ) continue; + if( !strcmp( module_GetObjName( p_parser ), "main" ) ) continue; for (size_t i = 0; i < p_parser->confsize; i++) { @@ -445,19 +445,19 @@ void ModuleConfigControl::finish( bool bycat ) /* Hack: required subcategory is stored in i_min */ if( p_config->i_type == CONFIG_SUBCATEGORY && p_config->value.i == p_item->min.i ) - combo->addItem( qtr(p_parser->psz_longname), - QVariant( p_parser->psz_object_name ) ); + combo->addItem( qtr( module_GetLongName( p_parser )), + QVariant( module_GetObjName( p_parser ) ) ); if( p_item->value.psz && !strcmp( p_item->value.psz, - p_parser->psz_object_name) ) + module_GetObjName( p_parser ) ) ) combo->setCurrentIndex( combo->count() - 1 ); } } else if( module_IsCapable( p_parser, p_item->psz_type ) ) { - combo->addItem( qtr(p_parser->psz_longname), - QVariant( p_parser->psz_object_name ) ); + combo->addItem( qtr(module_GetLongName( p_parser ) ), + QVariant( module_GetObjName( p_parser ) ) ); if( p_item->value.psz && !strcmp( p_item->value.psz, - p_parser->psz_object_name) ) + module_GetObjName( p_parser ) ) ) combo->setCurrentIndex( combo->count() - 1 ); } } @@ -529,11 +529,11 @@ ModuleListConfigControl::~ModuleListConfigControl() #define CHECKBOX_LISTS \ { \ - QCheckBox *cb = new QCheckBox( qtr( p_parser->psz_longname ) );\ + QCheckBox *cb = new QCheckBox( qtr( module_GetLongName( p_parser ) ) );\ checkBoxListItem *cbl = new checkBoxListItem; \ \ CONNECT( cb, stateChanged( int ), this, onUpdate( int ) );\ - cb->setToolTip( formatTooltip( qtr(p_parser->psz_longname)) );\ + cb->setToolTip( formatTooltip( qtr( module_GetLongName( p_parser ))));\ cbl->checkBox = cb; \ \ int i = -1; \ @@ -541,7 +541,7 @@ ModuleListConfigControl::~ModuleListConfigControl() i--; \ \ cbl->psz_module = strdup( i>=0?p_parser->pp_shortcuts[i] \ - : p_parser->psz_object_name ); \ + : module_GetObjName( p_parser ) ); \ modules.push_back( cbl ); \ } @@ -559,7 +559,7 @@ void ModuleListConfigControl::finish( bool bycat ) if( bycat ) { - if( !strcmp( p_parser->psz_object_name, "main" ) ) continue; + if( !strcmp( module_GetObjName( p_parser ), "main" ) ) continue; for (size_t i = 0; i < p_parser->confsize; i++) { diff --git a/modules/gui/qt4/menus.cpp b/modules/gui/qt4/menus.cpp index 39fec7c210..90026ba926 100644 --- a/modules/gui/qt4/menus.cpp +++ b/modules/gui/qt4/menus.cpp @@ -4,7 +4,7 @@ * Copyright (C) 2006-2007 the VideoLAN team * $Id$ * - * Authors: Clément Stenac + * Authors: Clément Stenac * Jean-Baptiste Kempf * * This program is free software; you can redistribute it and/or modify @@ -437,19 +437,18 @@ QMenu *QVLCMenu::SDMenu( intf_thread_t *p_intf ) if( !module_IsCapable( p_parser, "services_discovery" ) ) continue; - QAction *a = new QAction( qfu( p_parser->psz_longname ), menu ); + QAction *a = new QAction( qfu( module_GetLongName( p_parser ) ), 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 ) ) + p_parser->pp_shortcuts[i] ?: module_GetObjName( p_parser ) ) ) 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 ); + module_GetObjName( p_parser ) ); menu->addAction( a ); } vlc_list_release( p_list ); -- 2.39.2