[TESTERS NEEDED] Improved contextual menu (#16038)

This commit is contained in:
Antonino Di Guardo 2024-09-14 21:51:42 +02:00 committed by GitHub
parent 7f2534819e
commit d1648dd707
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 528 additions and 133 deletions

View file

@ -97,6 +97,27 @@ games_config::result games_config::add_external_hdd_game(const std::string& key,
return res;
}
games_config::result games_config::remove_game(const std::string& key)
{
std::lock_guard lock(m_mutex);
// Remove node
if (m_games.erase(key) == 0) // If node not found
{
// Nothing to do
return result::success;
}
m_dirty = true;
if (m_save_on_dirty && !save_nl())
{
return result::failure;
}
return result::success;
}
bool games_config::save_nl()
{
YAML::Emitter out;