ConfigLoaders: Temporarily not save all settings
This commit is contained in:
parent
b3197d8dce
commit
57264022ce
|
@ -28,6 +28,7 @@ set(SRCS
|
||||||
Config/Config.cpp
|
Config/Config.cpp
|
||||||
ConfigLoaders/BaseConfigLoader.cpp
|
ConfigLoaders/BaseConfigLoader.cpp
|
||||||
ConfigLoaders/GameConfigLoader.cpp
|
ConfigLoaders/GameConfigLoader.cpp
|
||||||
|
ConfigLoaders/IsSettingSaveable.cpp
|
||||||
ConfigLoaders/MovieConfigLoader.cpp
|
ConfigLoaders/MovieConfigLoader.cpp
|
||||||
ConfigLoaders/NetPlayConfigLoader.cpp
|
ConfigLoaders/NetPlayConfigLoader.cpp
|
||||||
Debugger/Debugger_SymbolMap.cpp
|
Debugger/Debugger_SymbolMap.cpp
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
|
|
||||||
#include "Core/Config/Config.h"
|
#include "Core/Config/Config.h"
|
||||||
#include "Core/ConfigLoaders/BaseConfigLoader.h"
|
#include "Core/ConfigLoaders/BaseConfigLoader.h"
|
||||||
|
#include "Core/ConfigLoaders/IsSettingSaveable.h"
|
||||||
|
|
||||||
namespace ConfigLoaders
|
namespace ConfigLoaders
|
||||||
{
|
{
|
||||||
|
@ -80,7 +81,12 @@ public:
|
||||||
IniFile::Section* ini_section = ini.GetOrCreateSection(section_name);
|
IniFile::Section* ini_section = ini.GetOrCreateSection(section_name);
|
||||||
|
|
||||||
for (const auto& value : section_values)
|
for (const auto& value : section_values)
|
||||||
|
{
|
||||||
|
if (!IsSettingSaveable({system.first, section->GetName(), value.first}))
|
||||||
|
continue;
|
||||||
|
|
||||||
ini_section->Set(value.first, value.second);
|
ini_section->Set(value.first, value.second);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ini.Save(File::GetUserPath(mapping->second));
|
ini.Save(File::GetUserPath(mapping->second));
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
|
|
||||||
#include "Core/Config/Config.h"
|
#include "Core/Config/Config.h"
|
||||||
#include "Core/ConfigLoaders/GameConfigLoader.h"
|
#include "Core/ConfigLoaders/GameConfigLoader.h"
|
||||||
|
#include "Core/ConfigLoaders/IsSettingSaveable.h"
|
||||||
|
|
||||||
namespace ConfigLoaders
|
namespace ConfigLoaders
|
||||||
{
|
{
|
||||||
|
@ -382,6 +383,9 @@ void INIGameConfigLayerLoader::Save(Config::Layer* config_layer)
|
||||||
{
|
{
|
||||||
for (const auto& value : section->GetValues())
|
for (const auto& value : section->GetValues())
|
||||||
{
|
{
|
||||||
|
if (!IsSettingSaveable({system.first, section->GetName(), value.first}))
|
||||||
|
continue;
|
||||||
|
|
||||||
const auto ini_location =
|
const auto ini_location =
|
||||||
GetINILocationFromConfig({system.first, section->GetName(), value.first});
|
GetINILocationFromConfig({system.first, section->GetName(), value.first});
|
||||||
if (ini_location.first.empty() && ini_location.second.empty())
|
if (ini_location.first.empty() && ini_location.second.empty())
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
// Copyright 2017 Dolphin Emulator Project
|
||||||
|
// Licensed under GPLv2+
|
||||||
|
// Refer to the license.txt file included.
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
#include "Core/Config/Config.h"
|
||||||
|
#include "Core/ConfigLoaders/IsSettingSaveable.h"
|
||||||
|
|
||||||
|
namespace ConfigLoaders
|
||||||
|
{
|
||||||
|
const static std::vector<Config::ConfigLocation> s_setting_saveable{};
|
||||||
|
|
||||||
|
bool IsSettingSaveable(const Config::ConfigLocation& config_location)
|
||||||
|
{
|
||||||
|
return std::find(s_setting_saveable.begin(), s_setting_saveable.end(), config_location) !=
|
||||||
|
s_setting_saveable.end();
|
||||||
|
}
|
||||||
|
} // namespace ConfigLoader
|
|
@ -0,0 +1,18 @@
|
||||||
|
// Copyright 2017 Dolphin Emulator Project
|
||||||
|
// Licensed under GPLv2+
|
||||||
|
// Refer to the license.txt file included.
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
namespace Config
|
||||||
|
{
|
||||||
|
struct ConfigLocation;
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace ConfigLoaders
|
||||||
|
{
|
||||||
|
// This is a temporary function that allows for both the new and old configuration
|
||||||
|
// systems to co-exist without trampling on each other while saving.
|
||||||
|
// This function shall be removed when the old configuration system retires.
|
||||||
|
bool IsSettingSaveable(const Config::ConfigLocation& config_location);
|
||||||
|
} // namespace ConfigLoader
|
|
@ -59,6 +59,7 @@
|
||||||
<ClCompile Include="Config\Config.cpp" />
|
<ClCompile Include="Config\Config.cpp" />
|
||||||
<ClCompile Include="ConfigLoaders\BaseConfigLoader.cpp" />
|
<ClCompile Include="ConfigLoaders\BaseConfigLoader.cpp" />
|
||||||
<ClCompile Include="ConfigLoaders\GameConfigLoader.cpp" />
|
<ClCompile Include="ConfigLoaders\GameConfigLoader.cpp" />
|
||||||
|
<ClCompile Include="ConfigLoaders\IsSettingSaveable.cpp" />
|
||||||
<ClCompile Include="ConfigLoaders\MovieConfigLoader.cpp" />
|
<ClCompile Include="ConfigLoaders\MovieConfigLoader.cpp" />
|
||||||
<ClCompile Include="ConfigLoaders\NetPlayConfigLoader.cpp" />
|
<ClCompile Include="ConfigLoaders\NetPlayConfigLoader.cpp" />
|
||||||
<ClCompile Include="ConfigManager.cpp" />
|
<ClCompile Include="ConfigManager.cpp" />
|
||||||
|
@ -311,6 +312,7 @@
|
||||||
<ClInclude Include="Config\Config.h" />
|
<ClInclude Include="Config\Config.h" />
|
||||||
<ClInclude Include="ConfigLoaders\BaseConfigLoader.h" />
|
<ClInclude Include="ConfigLoaders\BaseConfigLoader.h" />
|
||||||
<ClInclude Include="ConfigLoaders\GameConfigLoader.h" />
|
<ClInclude Include="ConfigLoaders\GameConfigLoader.h" />
|
||||||
|
<ClInclude Include="ConfigLoaders\IsSettingSaveable.h" />
|
||||||
<ClInclude Include="ConfigLoaders\MovieConfigLoader.h" />
|
<ClInclude Include="ConfigLoaders\MovieConfigLoader.h" />
|
||||||
<ClInclude Include="ConfigLoaders\NetPlayConfigLoader.h" />
|
<ClInclude Include="ConfigLoaders\NetPlayConfigLoader.h" />
|
||||||
<ClInclude Include="ConfigManager.h" />
|
<ClInclude Include="ConfigManager.h" />
|
||||||
|
|
|
@ -853,6 +853,9 @@
|
||||||
<ClCompile Include="ConfigLoaders\NetPlayConfigLoader.cpp">
|
<ClCompile Include="ConfigLoaders\NetPlayConfigLoader.cpp">
|
||||||
<Filter>ConfigLoader</Filter>
|
<Filter>ConfigLoader</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="ConfigLoaders\IsSettingSaveable.cpp">
|
||||||
|
<Filter>ConfigLoader</Filter>
|
||||||
|
</ClCompile>
|
||||||
<ClCompile Include="Config\Config.cpp" />
|
<ClCompile Include="Config\Config.cpp" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
@ -1488,6 +1491,9 @@
|
||||||
<Filter>ConfigLoader</Filter>
|
<Filter>ConfigLoader</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="Config\Config.h" />
|
<ClInclude Include="Config\Config.h" />
|
||||||
|
<ClInclude Include="ConfigLoaders\IsSettingSaveable.h">
|
||||||
|
<Filter>ConfigLoader</Filter>
|
||||||
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Text Include="CMakeLists.txt" />
|
<Text Include="CMakeLists.txt" />
|
||||||
|
|
Loading…
Reference in New Issue