mirror of https://github.com/mgba-emu/mgba.git
Qt: ConfigController::getOption now has a default argument
This commit is contained in:
parent
75e609f65c
commit
17fa98fe4e
|
@ -158,12 +158,16 @@ void ConfigController::updateOption(const char* key) {
|
||||||
m_optionSet[optionName]->setValue(mCoreConfigGetValue(&m_config, key));
|
m_optionSet[optionName]->setValue(mCoreConfigGetValue(&m_config, key));
|
||||||
}
|
}
|
||||||
|
|
||||||
QString ConfigController::getOption(const char* key) const {
|
QString ConfigController::getOption(const char* key, const QVariant& defaultVal) const {
|
||||||
return QString(mCoreConfigGetValue(&m_config, key));
|
const char* val = mCoreConfigGetValue(&m_config, key);
|
||||||
|
if (val) {
|
||||||
|
return QString(val);
|
||||||
|
}
|
||||||
|
return defaultVal.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString ConfigController::getOption(const QString& key) const {
|
QString ConfigController::getOption(const QString& key, const QVariant& defaultVal) const {
|
||||||
return getOption(key.toUtf8().constData());
|
return getOption(key.toUtf8().constData(), defaultVal);
|
||||||
}
|
}
|
||||||
|
|
||||||
QVariant ConfigController::getQtOption(const QString& key, const QString& group) const {
|
QVariant ConfigController::getQtOption(const QString& key, const QString& group) const {
|
||||||
|
|
|
@ -70,8 +70,8 @@ public:
|
||||||
ConfigOption* addOption(const char* key);
|
ConfigOption* addOption(const char* key);
|
||||||
void updateOption(const char* key);
|
void updateOption(const char* key);
|
||||||
|
|
||||||
QString getOption(const char* key) const;
|
QString getOption(const char* key, const QVariant& defaultVal = QVariant()) const;
|
||||||
QString getOption(const QString& key) const;
|
QString getOption(const QString& key, const QVariant& defaultVal = QVariant()) const;
|
||||||
|
|
||||||
QVariant getQtOption(const QString& key, const QString& group = QString()) const;
|
QVariant getQtOption(const QString& key, const QString& group = QString()) const;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue