mirror of https://github.com/mgba-emu/mgba.git
Qt: Ensure action set is clean before (re)building
This commit is contained in:
parent
6e65b70c32
commit
3ee12b1a55
|
@ -220,6 +220,10 @@ void ConfigController::updateOption(const char* key) {
|
|||
m_optionSet[optionName]->setValue(mCoreConfigGetValue(&m_config, key));
|
||||
}
|
||||
|
||||
void ConfigController::clearOptions() {
|
||||
m_optionSet.clear();
|
||||
}
|
||||
|
||||
QString ConfigController::getOption(const char* key, const QVariant& defaultVal) const {
|
||||
const char* val = mCoreConfigGetValue(&m_config, key);
|
||||
if (val) {
|
||||
|
|
|
@ -80,6 +80,7 @@ public:
|
|||
|
||||
ConfigOption* addOption(const char* key);
|
||||
void updateOption(const char* key);
|
||||
void clearOptions();
|
||||
|
||||
QString getOption(const char* key, const QVariant& defaultVal = QVariant()) const;
|
||||
QString getOption(const QString& key, const QVariant& defaultVal = QVariant()) const;
|
||||
|
|
|
@ -1259,6 +1259,11 @@ void Window::setupMenu(QMenuBar* menubar) {
|
|||
installEventFilter(m_shortcutController);
|
||||
|
||||
menubar->clear();
|
||||
m_gameActions.clear();
|
||||
m_nonMpActions.clear();
|
||||
m_platformActions.clear();
|
||||
m_config->clearOptions();
|
||||
|
||||
m_actions.addMenu(tr("&File"), "file");
|
||||
|
||||
m_actions.addAction(tr("Load &ROM..."), "loadROM", this, &Window::selectROM, "file", QKeySequence::Open);
|
||||
|
|
Loading…
Reference in New Issue