mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-25 23:55:38 +00:00
Added list of Settings keys to not save.
This way stuff like the --debug and --windowed flags no longer save to es_settings.xml.
This commit is contained in:
parent
c31c7c246f
commit
40df8d3189
|
@ -3,9 +3,21 @@
|
||||||
#include "pugiXML/pugixml.hpp"
|
#include "pugiXML/pugixml.hpp"
|
||||||
#include "platform.h"
|
#include "platform.h"
|
||||||
#include <boost/filesystem.hpp>
|
#include <boost/filesystem.hpp>
|
||||||
|
#include <boost/assign.hpp>
|
||||||
|
|
||||||
Settings* Settings::sInstance = NULL;
|
Settings* Settings::sInstance = NULL;
|
||||||
|
|
||||||
|
// these values are NOT saved to es_settings.xml
|
||||||
|
// since they're set through command-line arguments, and not the in-program settings menu
|
||||||
|
std::vector<const char*> settings_dont_save = boost::assign::list_of
|
||||||
|
("Debug")
|
||||||
|
("DebugGrid")
|
||||||
|
("DebugText")
|
||||||
|
("ParseGamelistOnly")
|
||||||
|
("ShowExit")
|
||||||
|
("Windowed")
|
||||||
|
("IgnoreGamelist");
|
||||||
|
|
||||||
Settings::Settings()
|
Settings::Settings()
|
||||||
{
|
{
|
||||||
setDefaults();
|
setDefaults();
|
||||||
|
@ -33,7 +45,6 @@ void Settings::setDefaults()
|
||||||
mBoolMap["ShowHelpPrompts"] = true;
|
mBoolMap["ShowHelpPrompts"] = true;
|
||||||
mBoolMap["ScrapeRatings"] = true;
|
mBoolMap["ScrapeRatings"] = true;
|
||||||
mBoolMap["IgnoreGamelist"] = false;
|
mBoolMap["IgnoreGamelist"] = false;
|
||||||
mBoolMap["ParseGamelistOnly"] = false;
|
|
||||||
mBoolMap["QuickSystemSelect"] = true;
|
mBoolMap["QuickSystemSelect"] = true;
|
||||||
|
|
||||||
mBoolMap["Debug"] = false;
|
mBoolMap["Debug"] = false;
|
||||||
|
@ -44,8 +55,6 @@ void Settings::setDefaults()
|
||||||
mIntMap["ScraperResizeWidth"] = 400;
|
mIntMap["ScraperResizeWidth"] = 400;
|
||||||
mIntMap["ScraperResizeHeight"] = 0;
|
mIntMap["ScraperResizeHeight"] = 0;
|
||||||
|
|
||||||
mIntMap["GameListSortIndex"] = 0;
|
|
||||||
|
|
||||||
mStringMap["TransitionStyle"] = "fade";
|
mStringMap["TransitionStyle"] = "fade";
|
||||||
mStringMap["ThemeSet"] = "";
|
mStringMap["ThemeSet"] = "";
|
||||||
mStringMap["ScreenSaverBehavior"] = "dim";
|
mStringMap["ScreenSaverBehavior"] = "dim";
|
||||||
|
@ -57,6 +66,10 @@ void saveMap(pugi::xml_document& doc, std::map<K, V>& map, const char* type)
|
||||||
{
|
{
|
||||||
for(auto iter = map.begin(); iter != map.end(); iter++)
|
for(auto iter = map.begin(); iter != map.end(); iter++)
|
||||||
{
|
{
|
||||||
|
// key is on the "don't save" list, so don't save it
|
||||||
|
if(std::find(settings_dont_save.begin(), settings_dont_save.end(), iter->first) != settings_dont_save.end())
|
||||||
|
continue;
|
||||||
|
|
||||||
pugi::xml_node node = doc.append_child(type);
|
pugi::xml_node node = doc.append_child(type);
|
||||||
node.append_attribute("name").set_value(iter->first.c_str());
|
node.append_attribute("name").set_value(iter->first.c_str());
|
||||||
node.append_attribute("value").set_value(iter->second);
|
node.append_attribute("value").set_value(iter->second);
|
||||||
|
|
Loading…
Reference in a new issue