From 84f4d6d3f3a39e777d266300cb1bca6e21d2b613 Mon Sep 17 00:00:00 2001 From: auria Date: Mon, 22 Mar 2010 01:39:01 +0000 Subject: [PATCH] Save config file when relevant. Forbid editing or removing the guest account through the GUI git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@5041 178a84e3-b1eb-0310-8ba1-8eac791a3b58 --- src/config/user_config.cpp | 1 + src/states_screens/options_screen_players.cpp | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/config/user_config.cpp b/src/config/user_config.cpp index 4b9c2dbd6..6aef2c882 100644 --- a/src/config/user_config.cpp +++ b/src/config/user_config.cpp @@ -326,6 +326,7 @@ UserConfig::UserConfig() if(!loadConfig() || UserConfigParams::m_all_players.size() == 0) { addDefaultPlayer(); + saveConfig(); } } // UserConfig diff --git a/src/states_screens/options_screen_players.cpp b/src/states_screens/options_screen_players.cpp index 95b7a7195..100e87f61 100644 --- a/src/states_screens/options_screen_players.cpp +++ b/src/states_screens/options_screen_players.cpp @@ -118,6 +118,7 @@ void OptionsScreenPlayers::deletePlayer(PlayerProfile* player) void OptionsScreenPlayers::tearDown() { + user_config->saveConfig(); } // ----------------------------------------------------------------------------- @@ -148,11 +149,14 @@ void OptionsScreenPlayers::eventCallback(Widget* widget, const std::string& name std::string selectedPlayer = players->getSelectionName(); const int playerAmount = UserConfigParams::m_all_players.size(); - for(int n=0; n