Qt: Clean and remove empty game settings

This commit is contained in:
Stenzek authored and Connor McLaughlin committed 2024-05-05 12:13:20 +10:00
1 parent 12af031193
commit 2ab6a3b873
21 files changed
+267 -81

No files matched your search

+28
View File
@@ -20,6 +20,11 @@ void MemorySettingsInterface::Clear()
m_sections.clear();
}
bool MemorySettingsInterface::IsEmpty()
{
return m_sections.empty();
}
bool MemorySettingsInterface::GetIntValue(const char* section, const char* key, s32* value) const
{
const auto sit = m_sections.find(section);
@@ -312,3 +317,26 @@ void MemorySettingsInterface::ClearSection(const char* section)
m_sections.erase(sit);
}
void MemorySettingsInterface::RemoveSection(const char* section)
{
auto sit = m_sections.find(section);
if (sit == m_sections.end())
return;
m_sections.erase(sit);
}
void MemorySettingsInterface::RemoveEmptySections()
{
for (auto sit = m_sections.begin(); sit != m_sections.end();)
{
if (sit->second.size() > 0)
{
++sit;
continue;
}
sit = m_sections.erase(sit);
}
}