mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-28 16:49:58 -06:00
Config: Remove recursive layer
This commit is contained in:
@ -246,51 +246,4 @@ void Section::ClearDirty()
|
||||
{
|
||||
m_dirty = false;
|
||||
}
|
||||
|
||||
RecursiveSection::RecursiveSection(LayerType layer, System system, const std::string& name)
|
||||
: Section(layer, system, name)
|
||||
{
|
||||
}
|
||||
|
||||
bool RecursiveSection::Exists(const std::string& key) const
|
||||
{
|
||||
auto layers_it = Config::GetLayers()->find(LayerType::Meta);
|
||||
do
|
||||
{
|
||||
const Section* layer_section = layers_it->second->GetSection(m_system, m_name);
|
||||
if (layer_section && layer_section->Exists(key))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
} while (--layers_it != Config::GetLayers()->end());
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool RecursiveSection::Get(const std::string& key, std::string* value,
|
||||
const std::string& default_value) const
|
||||
{
|
||||
for (auto layer_id : SEARCH_ORDER)
|
||||
{
|
||||
auto layers_it = Config::GetLayers()->find(layer_id);
|
||||
if (layers_it == Config::GetLayers()->end())
|
||||
continue;
|
||||
|
||||
const Section* layer_section = layers_it->second->GetSection(m_system, m_name);
|
||||
if (layer_section && layer_section->Exists(key))
|
||||
{
|
||||
return layer_section->Get(key, value, default_value);
|
||||
}
|
||||
}
|
||||
|
||||
return Section::Get(key, value, default_value);
|
||||
}
|
||||
|
||||
void RecursiveSection::Set(const std::string& key, const std::string& value)
|
||||
{
|
||||
// The RecursiveSection can't set since it is used to recursively get values from the layer
|
||||
// map.
|
||||
// It is only a part of the meta layer, and the meta layer isn't allowed to set any values.
|
||||
_assert_msg_(COMMON, false, "Don't try to set values here!");
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user