From 989ec97aa4b0034e6a4599df11ba5301e5b42af2 Mon Sep 17 00:00:00 2001 From: Francois Cartegnie Date: Fri, 5 Mar 2010 19:42:42 +0100 Subject: [PATCH] Qt: Fix save volume on exit Fixes #2968 --- modules/gui/qt4/qt4.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/modules/gui/qt4/qt4.cpp b/modules/gui/qt4/qt4.cpp index d689c4afac..6528f9f787 100644 --- a/modules/gui/qt4/qt4.cpp +++ b/modules/gui/qt4/qt4.cpp @@ -507,6 +507,15 @@ static void *Thread( void *obj ) /* Save the path */ getSettings()->setValue( "filedialog-path", p_intf->p_sys->filepath ); + /* Save volume on exit */ + audio_volume_t i_volume; + if ( var_InheritBool( p_intf, "qt-autosave-volume" ) ) + aout_VolumeGet( p_intf, &i_volume ); + else + i_volume = config_GetInt( p_intf, "qt-startvolume" ); + config_PutInt( p_intf, "volume", i_volume ); + config_SaveConfigFile( p_intf, NULL ); + /* Delete the configuration. Application has to be deleted after that. */ delete p_intf->p_sys->mainSettings; -- 2.39.2