diff options
| author | Leo Lam <leolino.lam@gmail.com> | 2017-11-17 15:01:56 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-11-17 15:01:56 +0100 |
| commit | 84ca9a4aec0048e5ac01caea8f8be9210eb947f6 (patch) | |
| tree | 9bc42cfe376101b040527ee254a527f05320a853 /Source/Core/Common/Config/Config.cpp | |
| parent | 1e33fd0d3540e288f124c1c41891a768103f6290 (diff) | |
| parent | 37419b9a579fbcb1633caa9295a39da405e93904 (diff) | |
Merge pull request #6154 from MerryMage/config-cleanup
Cleanup implementation of onion configuration
Diffstat (limited to 'Source/Core/Common/Config/Config.cpp')
| -rw-r--r-- | Source/Core/Common/Config/Config.cpp | 25 |
1 files changed, 1 insertions, 24 deletions
diff --git a/Source/Core/Common/Config/Config.cpp b/Source/Core/Common/Config/Config.cpp index 339155dbe3..a3504f80d2 100644 --- a/Source/Core/Common/Config/Config.cpp +++ b/Source/Core/Common/Config/Config.cpp @@ -17,11 +17,6 @@ static std::list<ConfigChangedCallback> s_callbacks; void InvokeConfigChangedCallbacks(); -Section* GetOrCreateSection(System system, const std::string& section_name) -{ - return s_layers[LayerType::Meta]->GetOrCreateSection(system, section_name); -} - Layers* GetLayers() { return &s_layers; @@ -83,8 +78,6 @@ void Init() { // These layers contain temporary values ClearCurrentRunLayer(); - // This layer always has to exist - s_layers[LayerType::Meta] = std::make_unique<RecursiveLayer>(); } void Shutdown() @@ -129,26 +122,10 @@ const std::string& GetLayerName(LayerType layer) {LayerType::Movie, "Movie"}, {LayerType::CommandLine, "Command Line"}, {LayerType::CurrentRun, "Current Run"}, - {LayerType::Meta, "Top"}, }; return layer_to_name.at(layer); } -bool ConfigLocation::operator==(const ConfigLocation& other) const -{ - return std::tie(system, section, key) == std::tie(other.system, other.section, other.key); -} - -bool ConfigLocation::operator!=(const ConfigLocation& other) const -{ - return !(*this == other); -} - -bool ConfigLocation::operator<(const ConfigLocation& other) const -{ - return std::tie(system, section, key) < std::tie(other.system, other.section, other.key); -} - LayerType GetActiveLayerForConfig(const ConfigLocation& config) { for (auto layer : SEARCH_ORDER) @@ -156,7 +133,7 @@ LayerType GetActiveLayerForConfig(const ConfigLocation& config) if (!LayerExists(layer)) continue; - if (GetLayer(layer)->Exists(config.system, config.section, config.key)) + if (GetLayer(layer)->Exists(config)) return layer; } |
