Commit e4fb5cd2 authored by Erwan Tulou's avatar Erwan Tulou
Browse files

skins: cosmetics about previous patch (thanks ivoire)

parent 24655a2d
...@@ -73,18 +73,16 @@ ThemeRepository::ThemeRepository( intf_thread_t *pIntf ): SkinObject( pIntf ) ...@@ -73,18 +73,16 @@ ThemeRepository::ThemeRepository( intf_thread_t *pIntf ): SkinObject( pIntf )
parseDirectory( *it ); parseDirectory( *it );
} }
// retrieve skins for skins directories and locate default skins // retrieve skins from skins directories and locate default skins
map<string,string>::const_iterator itmap, itdefault; map<string,string>::const_iterator itmap, itdefault;
for( itmap = m_skinsMap.begin(); itmap != m_skinsMap.end(); itmap++ ) for( itmap = m_skinsMap.begin(); itmap != m_skinsMap.end(); itmap++ )
{ {
string path = itmap->first; string path = itmap->first;
string name = itmap->second; string name = itmap->second;
val.psz_string = strdup( path.c_str() ); val.psz_string = (char*) path.c_str();
text.psz_string = strdup( name.c_str() ); text.psz_string = (char*) name.c_str();
var_Change( getIntf(), "intf-skins", VLC_VAR_ADDCHOICE, &val, var_Change( getIntf(), "intf-skins", VLC_VAR_ADDCHOICE, &val,
&text ); &text );
free( val.psz_string );
free( text.psz_string );
if( name == "default" ) if( name == "default" )
itdefault = itmap; itdefault = itmap;
...@@ -105,19 +103,16 @@ ThemeRepository::ThemeRepository( intf_thread_t *pIntf ): SkinObject( pIntf ) ...@@ -105,19 +103,16 @@ ThemeRepository::ThemeRepository( intf_thread_t *pIntf ): SkinObject( pIntf )
itmap = m_skinsMap.find( current ); itmap = m_skinsMap.find( current );
if( itmap == m_skinsMap.end() ) if( itmap == m_skinsMap.end() )
{ {
val.psz_string = strdup( current.c_str() ); val.psz_string = (char*) current.c_str();
text.psz_string = strdup( current.c_str() ); text.psz_string = (char*) current.c_str();
var_Change( getIntf(), "intf-skins", VLC_VAR_ADDCHOICE, &val, var_Change( getIntf(), "intf-skins", VLC_VAR_ADDCHOICE, &val,
&text ); &text );
var_Change( getIntf(), "intf-skins", VLC_VAR_SETVALUE, &val, NULL ); var_Change( getIntf(), "intf-skins", VLC_VAR_SETVALUE, &val, NULL );
free( val.psz_string );
free( text.psz_string );
} }
else else
{ {
val.psz_string = strdup( current.c_str() ); val.psz_string = (char*) current.c_str();
var_Change( getIntf(), "intf-skins", VLC_VAR_SETVALUE, &val, NULL ); var_Change( getIntf(), "intf-skins", VLC_VAR_SETVALUE, &val, NULL );
free( val.psz_string );
} }
free( psz_current ); free( psz_current );
m_skinsMap.clear(); m_skinsMap.clear();
......
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