Merge pull request #5414 from MerryMage/config-fixups

Config: Minor fixups
This commit is contained in:
Tilka 2017-05-13 15:58:01 +01:00 committed by GitHub
commit 9944712f6e
4 changed files with 41 additions and 22 deletions

View File

@ -65,7 +65,7 @@ public:
T Get(const std::string& key, const T& default_value) const
{
T value;
Get(key, value, default_value);
Get(key, &value, default_value);
return value;
}

View File

@ -196,7 +196,7 @@ static ConfigLocation MapINIToRealLocation(const std::string& section, const std
// Certain sections like 'Speedhacks' has keys that are variable
it = ini_to_location.find({section, ""});
if (it != ini_to_location.end())
return it->second;
return {it->second.system, it->second.section, key};
// Attempt to load it as a configuration option
// It will be in the format of '<System>.<Section>'
@ -230,11 +230,11 @@ static std::pair<std::string, std::string> GetINILocationFromConfig(const Config
// Try again, but this time with an empty key
// Certain sections like 'Speedhacks' have keys that are variable
it = std::find_if(ini_to_location.begin(), ini_to_location.end(), [&location](const auto& entry) {
return std::tie(entry.second.system, entry.second.key) ==
std::tie(location.system, location.key);
return std::tie(entry.second.system, entry.second.section) ==
std::tie(location.system, location.section);
});
if (it != ini_to_location.end())
return it->first;
return {it->first.first, location.key};
WARN_LOG(CORE, "Unknown option: %s.%s", location.section.c_str(), location.key.c_str());
return {"", ""};

View File

@ -45,6 +45,10 @@
<ClCompile Include="Boot\Boot_ELF.cpp" />
<ClCompile Include="Boot\Boot_WiiWAD.cpp" />
<ClCompile Include="Boot\ElfReader.cpp" />
<ClCompile Include="ConfigLoaders\BaseConfigLoader.cpp" />
<ClCompile Include="ConfigLoaders\GameConfigLoader.cpp" />
<ClCompile Include="ConfigLoaders\MovieConfigLoader.cpp" />
<ClCompile Include="ConfigLoaders\NetPlayConfigLoader.cpp" />
<ClCompile Include="ConfigManager.cpp" />
<ClCompile Include="Core.cpp" />
<ClCompile Include="CoreTiming.cpp" />
@ -231,10 +235,6 @@
<ClCompile Include="Movie.cpp" />
<ClCompile Include="NetPlayClient.cpp" />
<ClCompile Include="NetPlayServer.cpp" />
<ClCompile Include="ConfigLoaders\BaseConfigLoader.cpp" />
<ClCompile Include="ConfigLoaders\GameConfigLoader.cpp" />
<ClCompile Include="ConfigLoaders\MovieConfigLoader.cpp" />
<ClCompile Include="ConfigLoaders\NetPlayConfigLoader.cpp" />
<ClCompile Include="PatchEngine.cpp" />
<ClCompile Include="PowerPC\BreakPoints.cpp" />
<ClCompile Include="PowerPC\CachedInterpreter\CachedInterpreter.cpp" />
@ -308,6 +308,10 @@
<ClInclude Include="Boot\Boot_DOL.h" />
<ClInclude Include="Boot\ElfReader.h" />
<ClInclude Include="Boot\ElfTypes.h" />
<ClInclude Include="ConfigLoaders\BaseConfigLoader.h" />
<ClInclude Include="ConfigLoaders\GameConfigLoader.h" />
<ClInclude Include="ConfigLoaders\MovieConfigLoader.h" />
<ClInclude Include="ConfigLoaders\NetPlayConfigLoader.h" />
<ClInclude Include="ConfigManager.h" />
<ClInclude Include="Core.h" />
<ClInclude Include="CoreTiming.h" />
@ -483,10 +487,6 @@
<ClInclude Include="NetPlayClient.h" />
<ClInclude Include="NetPlayProto.h" />
<ClInclude Include="NetPlayServer.h" />
<ClInclude Include="ConfigLoaders\BaseConfigLoader.h" />
<ClInclude Include="ConfigLoaders\GameConfigLoader.h" />
<ClInclude Include="ConfigLoaders\MovieConfigLoader.h" />
<ClInclude Include="ConfigLoaders\NetPlayConfigLoader.h" />
<ClInclude Include="PatchEngine.h" />
<ClInclude Include="PowerPC\BreakPoints.h" />
<ClInclude Include="PowerPC\CPUCoreBase.h" />

View File

@ -7,6 +7,9 @@
<Filter Include="Boot">
<UniqueIdentifier>{2472fb36-5473-4d49-ad2d-3699b78ab6e2}</UniqueIdentifier>
</Filter>
<Filter Include="ConfigLoader">
<UniqueIdentifier>{259a11eb-ca07-4b31-b849-7286dbd4550a}</UniqueIdentifier>
</Filter>
<Filter Include="Debugger">
<UniqueIdentifier>{ed683a12-55f0-49cb-918b-c7edbcf57268}</UniqueIdentifier>
</Filter>
@ -170,10 +173,6 @@
<ClCompile Include="NetPlayClient.cpp" />
<ClCompile Include="NetPlayServer.cpp" />
<ClCompile Include="PatchEngine.cpp" />
<ClCompile Include="ConfigLoaders\BaseConfigLoader.cpp" />
<ClCompile Include="ConfigLoaders\GameConfigLoader.cpp" />
<ClCompile Include="ConfigLoaders\MovieConfigLoader.cpp" />
<ClCompile Include="ConfigLoaders\NetPlayConfigLoader.cpp" />
<ClCompile Include="State.cpp" />
<ClCompile Include="WiiRoot.cpp" />
<ClCompile Include="ActionReplay.cpp">
@ -886,6 +885,18 @@
<ClCompile Include="PowerPC\Jit64Common\ConstantPool.cpp">
<Filter>PowerPC\Jit64Common</Filter>
</ClCompile>
<ClCompile Include="ConfigLoaders\BaseConfigLoader.cpp">
<Filter>ConfigLoader</Filter>
</ClCompile>
<ClCompile Include="ConfigLoaders\GameConfigLoader.cpp">
<Filter>ConfigLoader</Filter>
</ClCompile>
<ClCompile Include="ConfigLoaders\MovieConfigLoader.cpp">
<Filter>ConfigLoader</Filter>
</ClCompile>
<ClCompile Include="ConfigLoaders\NetPlayConfigLoader.cpp">
<Filter>ConfigLoader</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="BootManager.h" />
@ -901,10 +912,6 @@
<ClInclude Include="NetPlayProto.h" />
<ClInclude Include="NetPlayServer.h" />
<ClInclude Include="PatchEngine.h" />
<ClInclude Include="ConfigLoaders\BaseConfigLoader.h" />
<ClInclude Include="ConfigLoaders\GameConfigLoader.h" />
<ClInclude Include="ConfigLoaders\MovieConfigLoader.h" />
<ClInclude Include="ConfigLoaders\NetPlayConfigLoader.h" />
<ClInclude Include="State.h" />
<ClInclude Include="WiiRoot.h" />
<ClInclude Include="ActionReplay.h">
@ -1376,7 +1383,7 @@
<ClInclude Include="Analytics.h" />
<ClInclude Include="PowerPC\SignatureDB\CSVSignatureDB.h" />
<ClInclude Include="PowerPC\SignatureDB\DSYSignatureDB.h" />
<ClCompile Include="PowerPC\SignatureDB\MEGASignatureDB.h" />
<ClInclude Include="PowerPC\SignatureDB\MEGASignatureDB.h" />
<ClInclude Include="PowerPC\SignatureDB\SignatureDB.h" />
<ClInclude Include="IOS\USB\Bluetooth\BTBase.h">
<Filter>IOS\USB\Bluetooth</Filter>
@ -1522,6 +1529,18 @@
<ClInclude Include="PowerPC\Jit64Common\ConstantPool.h">
<Filter>PowerPC\Jit64Common</Filter>
</ClInclude>
<ClInclude Include="ConfigLoaders\BaseConfigLoader.h">
<Filter>ConfigLoader</Filter>
</ClInclude>
<ClInclude Include="ConfigLoaders\GameConfigLoader.h">
<Filter>ConfigLoader</Filter>
</ClInclude>
<ClInclude Include="ConfigLoaders\MovieConfigLoader.h">
<Filter>ConfigLoader</Filter>
</ClInclude>
<ClInclude Include="ConfigLoaders\NetPlayConfigLoader.h">
<Filter>ConfigLoader</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Text Include="CMakeLists.txt" />