mirror of https://github.com/PCSX2/pcsx2.git
USB: Add ConfigKeyExists()
This commit is contained in:
parent
24171787f8
commit
2703b91e41
|
@ -155,7 +155,7 @@ bool LayeredSettingsInterface::ContainsValue(const char* section, const char* ke
|
|||
{
|
||||
if (SettingsInterface* sif = m_layers[layer])
|
||||
{
|
||||
if (sif->ContainsValue(key, section))
|
||||
if (sif->ContainsValue(section, key))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -671,6 +671,12 @@ std::string USB::GetConfigSubKey(const std::string_view& device, const std::stri
|
|||
return fmt::format("{}_{}", device, bind_name);
|
||||
}
|
||||
|
||||
bool USB::ConfigKeyExists(SettingsInterface& si, u32 port, const char* devname, const char* key)
|
||||
{
|
||||
const std::string real_key(fmt::format("{}_{}", devname, key));
|
||||
return si.ContainsValue(GetConfigSection(port).c_str(), real_key.c_str());
|
||||
}
|
||||
|
||||
bool USB::GetConfigBool(SettingsInterface& si, u32 port, const char* devname, const char* key, bool default_value)
|
||||
{
|
||||
const std::string real_key(fmt::format("{}_{}", devname, key));
|
||||
|
|
|
@ -79,6 +79,9 @@ namespace USB
|
|||
/// Identifies any device/subtype changes and recreates devices.
|
||||
void CheckForConfigChanges(const Pcsx2Config& old_config);
|
||||
|
||||
/// Returns true if a device-specific configuration key exists.
|
||||
bool ConfigKeyExists(SettingsInterface& si, u32 port, const char* devname, const char* key);
|
||||
|
||||
/// Reads a device-specific configuration boolean.
|
||||
bool GetConfigBool(SettingsInterface& si, u32 port, const char* devname, const char* key, bool default_value);
|
||||
|
||||
|
|
Loading…
Reference in New Issue