Qt: implement GetIsDynamicConfig in emu_settings

- unused at this point
This commit is contained in:
Megamouse 2020-04-17 10:09:35 +02:00
parent e361bac945
commit ec4e8eda04
2 changed files with 16 additions and 0 deletions

View file

@ -105,6 +105,14 @@ static QStringList get_options(cfg_location location)
return values;
}
/** Returns dynamic property for some particular setting.*/
static bool get_is_dynamic(cfg_location location)
{
auto begin = location.cbegin();
auto end = location.cend();
return cfg_adapter::get_cfg(g_cfg, begin, end).get_is_dynamic();
}
emu_settings::emu_settings()
: QObject()
, m_render_creator(new render_creator(this))
@ -721,3 +729,9 @@ QString emu_settings::GetLocalizedSetting(const QString& original, emu_settings_
return original;
}
bool emu_settings::GetIsDynamicConfig(emu_settings_type type)
{
const cfg_location loc = m_settings_location[type];
return get_is_dynamic(loc);
}

View file

@ -89,6 +89,8 @@ public:
/** Get a localized and therefore freely adjustable version of the string used in config.yml.*/
QString GetLocalizedSetting(const QString& original, emu_settings_type type, int index) const;
bool GetIsDynamicConfig(emu_settings_type type);
public Q_SLOTS:
/** Writes the unsaved settings to file. Used in settings dialog on accept.*/
void SaveSettings();