From 7fc73f3fe1f9d976ce3f739ebb39423179b10718 Mon Sep 17 00:00:00 2001 From: Erwan Tulou Date: Sat, 6 Mar 2010 14:28:07 +0100 Subject: [PATCH] skins2: replace most config_Get with var_Inherit --- modules/gui/skins2/parser/interpreter.cpp | 4 ++-- modules/gui/skins2/src/skin_main.cpp | 5 +++-- modules/gui/skins2/src/theme_loader.cpp | 2 +- modules/gui/skins2/src/theme_repository.cpp | 4 ++-- modules/gui/skins2/src/vlcproc.cpp | 2 +- modules/gui/skins2/src/window_manager.cpp | 4 ++-- modules/gui/skins2/win32/win32_factory.cpp | 4 ++-- 7 files changed, 13 insertions(+), 12 deletions(-) diff --git a/modules/gui/skins2/parser/interpreter.cpp b/modules/gui/skins2/parser/interpreter.cpp index 38e01706ec..9f695aafff 100644 --- a/modules/gui/skins2/parser/interpreter.cpp +++ b/modules/gui/skins2/parser/interpreter.cpp @@ -256,7 +256,7 @@ CmdGeneric *Interpreter::parseAction( const string &rAction, Theme *pTheme ) string windowId = rAction.substr( 0, leftPos ); if( windowId == "playlist_window" && - !config_GetInt( getIntf(), "skinned-playlist") ) + !var_InheritBool( getIntf(), "skinned-playlist") ) { list list; list.push_back( new CmdDlgPlaylist( getIntf() ) ); @@ -297,7 +297,7 @@ CmdGeneric *Interpreter::parseAction( const string &rAction, Theme *pTheme ) int leftPos = rAction.find( ".hide()" ); string windowId = rAction.substr( 0, leftPos ); if( windowId == "playlist_window" && - ! config_GetInt( getIntf(), "skinned-playlist") ) + !var_InheritBool( getIntf(), "skinned-playlist") ) { list list; list.push_back( new CmdDlgPlaylist( getIntf() ) ); diff --git a/modules/gui/skins2/src/skin_main.cpp b/modules/gui/skins2/src/skin_main.cpp index 17d68def97..f019c1f4bd 100644 --- a/modules/gui/skins2/src/skin_main.cpp +++ b/modules/gui/skins2/src/skin_main.cpp @@ -256,7 +256,7 @@ static void *Run( void * p_obj ) } // Load a theme - skin_last = config_GetPsz( p_intf, "skins2-last" ); + skin_last = var_InheritString( p_intf, "skins2-last" ); pLoader = new ThemeLoader( p_intf ); if( !skin_last || !pLoader->load( skin_last ) ) @@ -339,7 +339,8 @@ static int WindowOpen( vlc_object_t *p_this ) if( pIntf == NULL ) return VLC_EGENERIC; - if( !config_GetInt( pIntf, "skinned-video") || + if( !vlc_object_alive( pIntf ) || + !var_InheritBool( pIntf, "skinned-video") || pWnd->cfg->is_standalone ) { vlc_object_release( pIntf ); diff --git a/modules/gui/skins2/src/theme_loader.cpp b/modules/gui/skins2/src/theme_loader.cpp index 0d9cfd5b9e..f06e77c1ca 100644 --- a/modules/gui/skins2/src/theme_loader.cpp +++ b/modules/gui/skins2/src/theme_loader.cpp @@ -98,7 +98,7 @@ bool ThemeLoader::load( const string &fileName ) } // Check if the skin to load is in the config file, to load its config - char *skin_last = config_GetPsz( getIntf(), "skins2-last" ); + char *skin_last = var_InheritString( getIntf(), "skins2-last" ); if( skin_last != NULL && fileName == (string)skin_last ) { // Restore the theme configuration diff --git a/modules/gui/skins2/src/theme_repository.cpp b/modules/gui/skins2/src/theme_repository.cpp index 06199e4539..df8d8d1b74 100644 --- a/modules/gui/skins2/src/theme_repository.cpp +++ b/modules/gui/skins2/src/theme_repository.cpp @@ -89,7 +89,7 @@ ThemeRepository::ThemeRepository( intf_thread_t *pIntf ): SkinObject( pIntf ) } // retrieve last skins stored or skins requested by user - char* psz_current = config_GetPsz( getIntf(), "skins2-last" ); + char* psz_current = var_InheritString( getIntf(), "skins2-last" ); string current = string( psz_current ? psz_current : "" ); // set the default skins if no skins provided @@ -206,7 +206,7 @@ void ThemeRepository::updateRepository() vlc_value_t val, text; // retrieve the current skin - char* psz_current = config_GetPsz( getIntf(), "skins2-last" ); + char* psz_current = var_InheritString( getIntf(), "skins2-last" ); if( !psz_current ) return; diff --git a/modules/gui/skins2/src/vlcproc.cpp b/modules/gui/skins2/src/vlcproc.cpp index b0981bb171..bb95186822 100644 --- a/modules/gui/skins2/src/vlcproc.cpp +++ b/modules/gui/skins2/src/vlcproc.cpp @@ -754,7 +754,7 @@ void VlcProc::update_equalizer() if( m_pAout ) pFilters = var_GetNonEmptyString( m_pAout, "audio-filter" ); else - pFilters = config_GetPsz( getIntf(), "audio-filter" ); + pFilters = var_InheritString( getIntf(), "audio-filter" ); bool b_equalizer = pFilters && strstr( pFilters, "equalizer" ); free( pFilters ); diff --git a/modules/gui/skins2/src/window_manager.cpp b/modules/gui/skins2/src/window_manager.cpp index d2c8b8ea43..1081e1a61e 100644 --- a/modules/gui/skins2/src/window_manager.cpp +++ b/modules/gui/skins2/src/window_manager.cpp @@ -71,7 +71,7 @@ void WindowManager::startMove( TopWindow &rWindow ) m_movingWindows.clear(); buildDependSet( m_movingWindows, &rWindow ); - if( config_GetInt( getIntf(), "skins2-transparency" ) ) + if( var_InheritBool( getIntf(), "skins2-transparency" ) ) { // Change the opacity of the moving windows WinSet_t::const_iterator it; @@ -96,7 +96,7 @@ void WindowManager::stopMove() WinSet_t::const_iterator itWin1, itWin2; AncList_t::const_iterator itAnc1, itAnc2; - if( config_GetInt( getIntf(), "skins2-transparency" ) ) + if( var_InheritBool( getIntf(), "skins2-transparency" ) ) { // Restore the opacity of the moving windows WinSet_t::const_iterator it; diff --git a/modules/gui/skins2/win32/win32_factory.cpp b/modules/gui/skins2/win32/win32_factory.cpp index f95d9f7b7e..7e0b5f96e9 100644 --- a/modules/gui/skins2/win32/win32_factory.cpp +++ b/modules/gui/skins2/win32/win32_factory.cpp @@ -183,13 +183,13 @@ bool Win32Factory::init() strcpy( m_trayIcon.szTip, "VLC media player" ); // Show the systray icon if needed - if( config_GetInt( getIntf(), "skins2-systray" ) ) + if( var_InheritBool( getIntf(), "skins2-systray" ) ) { addInTray(); } // Show the task in the task bar if needed - if( config_GetInt( getIntf(), "skins2-taskbar" ) ) + if( var_InheritBool( getIntf(), "skins2-taskbar" ) ) { addInTaskBar(); } -- 2.11.4.GIT