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

Remove unused variable variable type

parent 23b4f051
...@@ -54,7 +54,6 @@ ...@@ -54,7 +54,6 @@
#define VLC_VAR_BOOL 0x0020 #define VLC_VAR_BOOL 0x0020
#define VLC_VAR_INTEGER 0x0030 #define VLC_VAR_INTEGER 0x0030
#define VLC_VAR_STRING 0x0040 #define VLC_VAR_STRING 0x0040
#define VLC_VAR_VARIABLE 0x0044
#define VLC_VAR_FLOAT 0x0050 #define VLC_VAR_FLOAT 0x0050
#define VLC_VAR_ADDRESS 0x0070 #define VLC_VAR_ADDRESS 0x0070
#define VLC_VAR_COORDS 0x00A0 #define VLC_VAR_COORDS 0x00A0
......
...@@ -1326,7 +1326,6 @@ static VLCMainMenu *_o_sharedInstance = nil; ...@@ -1326,7 +1326,6 @@ static VLCMainMenu *_o_sharedInstance = nil;
switch(i_type & VLC_VAR_TYPE) { switch(i_type & VLC_VAR_TYPE) {
case VLC_VAR_VOID: case VLC_VAR_VOID:
case VLC_VAR_BOOL: case VLC_VAR_BOOL:
case VLC_VAR_VARIABLE:
case VLC_VAR_STRING: case VLC_VAR_STRING:
case VLC_VAR_INTEGER: case VLC_VAR_INTEGER:
break; break;
...@@ -1410,9 +1409,7 @@ static VLCMainMenu *_o_sharedInstance = nil; ...@@ -1410,9 +1409,7 @@ static VLCMainMenu *_o_sharedInstance = nil;
/* Make sure we want to display the variable */ /* Make sure we want to display the variable */
if (i_type & VLC_VAR_HASCHOICE) { if (i_type & VLC_VAR_HASCHOICE) {
var_Change(p_object, psz_variable, VLC_VAR_CHOICESCOUNT, &val, NULL); var_Change(p_object, psz_variable, VLC_VAR_CHOICESCOUNT, &val, NULL);
if (val.i_int == 0) if (val.i_int == 0 || val.i_int == 1)
return;
if ((i_type & VLC_VAR_TYPE) != VLC_VAR_VARIABLE && val.i_int == 1)
return; return;
} }
else else
...@@ -1421,7 +1418,6 @@ static VLCMainMenu *_o_sharedInstance = nil; ...@@ -1421,7 +1418,6 @@ static VLCMainMenu *_o_sharedInstance = nil;
switch(i_type & VLC_VAR_TYPE) { switch(i_type & VLC_VAR_TYPE) {
case VLC_VAR_VOID: case VLC_VAR_VOID:
case VLC_VAR_BOOL: case VLC_VAR_BOOL:
case VLC_VAR_VARIABLE:
case VLC_VAR_STRING: case VLC_VAR_STRING:
case VLC_VAR_INTEGER: case VLC_VAR_INTEGER:
break; break;
......
...@@ -1224,44 +1224,13 @@ static bool IsMenuEmpty( const char *psz_var, ...@@ -1224,44 +1224,13 @@ static bool IsMenuEmpty( const char *psz_var,
vlc_object_t *p_object, vlc_object_t *p_object,
bool b_root = true ) bool b_root = true )
{ {
vlc_value_t val, val_list;
int i_type, i_result, i;
/* Check the type of the object variable */
i_type = var_Type( p_object, psz_var );
/* Check if we want to display the variable */ /* Check if we want to display the variable */
if( !( i_type & VLC_VAR_HASCHOICE ) ) return false; if( !(var_Type( p_object, psz_var) & VLC_VAR_HASCHOICE) )
return false;
vlc_value_t val;
var_Change( p_object, psz_var, VLC_VAR_CHOICESCOUNT, &val, NULL ); var_Change( p_object, psz_var, VLC_VAR_CHOICESCOUNT, &val, NULL );
if( val.i_int == 0 ) return true; return val.i_int == 0 || (val.i_int == 1 && b_root);
if( ( i_type & VLC_VAR_TYPE ) != VLC_VAR_VARIABLE )
{
if( val.i_int == 1 && b_root ) return true;
else return false;
}
/* Check children variables in case of VLC_VAR_VARIABLE */
if( var_Change( p_object, psz_var, VLC_VAR_GETCHOICES, &val_list, NULL ) < 0 )
{
return true;
}
for( i = 0, i_result = true; i < val_list.p_list->i_count; i++ )
{
if( !IsMenuEmpty( val_list.p_list->p_values[i].psz_string,
p_object, false ) )
{
i_result = false;
break;
}
}
/* clean up everything */
var_FreeList( &val_list, NULL );
return i_result;
} }
#define TEXT_OR_VAR qfue ( text.psz_string ? text.psz_string : psz_var ) #define TEXT_OR_VAR qfue ( text.psz_string ? text.psz_string : psz_var )
...@@ -1296,7 +1265,6 @@ void VLCMenuBar::UpdateItem( intf_thread_t *p_intf, QMenu *menu, ...@@ -1296,7 +1265,6 @@ void VLCMenuBar::UpdateItem( intf_thread_t *p_intf, QMenu *menu,
{ {
case VLC_VAR_VOID: case VLC_VAR_VOID:
case VLC_VAR_BOOL: case VLC_VAR_BOOL:
case VLC_VAR_VARIABLE:
case VLC_VAR_STRING: case VLC_VAR_STRING:
case VLC_VAR_INTEGER: case VLC_VAR_INTEGER:
case VLC_VAR_FLOAT: case VLC_VAR_FLOAT:
...@@ -1418,7 +1386,6 @@ int VLCMenuBar::CreateChoicesMenu( QMenu *submenu, const char *psz_var, ...@@ -1418,7 +1386,6 @@ int VLCMenuBar::CreateChoicesMenu( QMenu *submenu, const char *psz_var,
{ {
case VLC_VAR_VOID: case VLC_VAR_VOID:
case VLC_VAR_BOOL: case VLC_VAR_BOOL:
case VLC_VAR_VARIABLE:
case VLC_VAR_STRING: case VLC_VAR_STRING:
case VLC_VAR_INTEGER: case VLC_VAR_INTEGER:
case VLC_VAR_FLOAT: case VLC_VAR_FLOAT:
...@@ -1442,16 +1409,9 @@ int VLCMenuBar::CreateChoicesMenu( QMenu *submenu, const char *psz_var, ...@@ -1442,16 +1409,9 @@ int VLCMenuBar::CreateChoicesMenu( QMenu *submenu, const char *psz_var,
{ {
vlc_value_t another_val; vlc_value_t another_val;
QString menutext; QString menutext;
QMenu *subsubmenu = new QMenu( submenu );
switch( i_type & VLC_VAR_TYPE ) switch( i_type & VLC_VAR_TYPE )
{ {
case VLC_VAR_VARIABLE:
CreateChoicesMenu( subsubmenu, CURVAL.psz_string, p_object, false );
subsubmenu->setTitle( qfue( CURTEXT ? CURTEXT :CURVAL.psz_string ) );
submenu->addMenu( subsubmenu );
break;
case VLC_VAR_STRING: case VLC_VAR_STRING:
var_Get( p_object, psz_var, &val ); var_Get( p_object, psz_var, &val );
another_val.psz_string = strdup( CURVAL.psz_string ); another_val.psz_string = strdup( CURVAL.psz_string );
......
...@@ -1477,7 +1477,6 @@ static void DumpVariable(const void *data, const VISIT which, const int depth) ...@@ -1477,7 +1477,6 @@ static void DumpVariable(const void *data, const VISIT which, const int depth)
case VLC_VAR_BOOL: typename = "bool"; break; case VLC_VAR_BOOL: typename = "bool"; break;
case VLC_VAR_INTEGER: typename = "integer"; break; case VLC_VAR_INTEGER: typename = "integer"; break;
case VLC_VAR_STRING: typename = "string"; break; case VLC_VAR_STRING: typename = "string"; break;
case VLC_VAR_VARIABLE: typename = "variable"; break;
case VLC_VAR_FLOAT: typename = "float"; break; case VLC_VAR_FLOAT: typename = "float"; break;
case VLC_VAR_COORDS: typename = "coordinates"; break; case VLC_VAR_COORDS: typename = "coordinates"; break;
case VLC_VAR_ADDRESS: typename = "address"; break; case VLC_VAR_ADDRESS: typename = "address"; break;
......
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