]> git.sesse.net Git - vlc/commitdiff
Qt: Fix save volume on exit Fixes #2968
authorFrancois Cartegnie <fcvlcdev@free.fr>
Fri, 5 Mar 2010 18:42:42 +0000 (19:42 +0100)
committerFrancois Cartegnie <fcvlcdev@free.fr>
Wed, 28 Jul 2010 18:06:34 +0000 (20:06 +0200)
modules/gui/qt4/qt4.cpp

index d689c4afac1bee9ed661f77349580f1ed80a48d1..6528f9f787ac950723cced5ff86192ff99a3ed4f 100644 (file)
@@ -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;