From 52e7e8eed3daee0de13f7ab114c87cedd3e2a46b Mon Sep 17 00:00:00 2001 From: Zach Hilman Date: Sat, 3 Nov 2018 20:38:39 -0400 Subject: game_list: Only reload game list after relevant settings changed Prevents unnecessary reloads on every configuration operation. --- src/yuzu/configuration/configure_gamelist.cpp | 14 ++++++++++++++ src/yuzu/configuration/configure_gamelist.h | 2 ++ src/yuzu/configuration/configure_general.cpp | 3 +++ 3 files changed, 19 insertions(+) (limited to 'src/yuzu/configuration') diff --git a/src/yuzu/configuration/configure_gamelist.cpp b/src/yuzu/configuration/configure_gamelist.cpp index 8743ce982..0112bd950 100644 --- a/src/yuzu/configuration/configure_gamelist.cpp +++ b/src/yuzu/configuration/configure_gamelist.cpp @@ -36,6 +36,16 @@ ConfigureGameList::ConfigureGameList(QWidget* parent) InitializeRowComboBoxes(); this->setConfiguration(); + + // Force game list reload if any of the relevant settings are changed. + connect(ui->show_unknown, &QCheckBox::stateChanged, this, + &ConfigureGameList::RequestGameListUpdate); + connect(ui->icon_size_combobox, QOverload::of(&QComboBox::currentIndexChanged), this, + &ConfigureGameList::RequestGameListUpdate); + connect(ui->row_1_text_combobox, QOverload::of(&QComboBox::currentIndexChanged), this, + &ConfigureGameList::RequestGameListUpdate); + connect(ui->row_2_text_combobox, QOverload::of(&QComboBox::currentIndexChanged), this, + &ConfigureGameList::RequestGameListUpdate); } ConfigureGameList::~ConfigureGameList() = default; @@ -48,6 +58,10 @@ void ConfigureGameList::applyConfiguration() { Settings::Apply(); } +void ConfigureGameList::RequestGameListUpdate() { + UISettings::values.is_game_list_reload_pending.exchange(true); +} + void ConfigureGameList::setConfiguration() { ui->show_unknown->setChecked(UISettings::values.show_unknown); ui->icon_size_combobox->setCurrentIndex( diff --git a/src/yuzu/configuration/configure_gamelist.h b/src/yuzu/configuration/configure_gamelist.h index ff7406c60..bbf7e25f1 100644 --- a/src/yuzu/configuration/configure_gamelist.h +++ b/src/yuzu/configuration/configure_gamelist.h @@ -21,6 +21,8 @@ public: void applyConfiguration(); private: + void RequestGameListUpdate(); + void setConfiguration(); void changeEvent(QEvent*) override; diff --git a/src/yuzu/configuration/configure_general.cpp b/src/yuzu/configuration/configure_general.cpp index 537d6e576..8e77558fa 100644 --- a/src/yuzu/configuration/configure_general.cpp +++ b/src/yuzu/configuration/configure_general.cpp @@ -19,6 +19,9 @@ ConfigureGeneral::ConfigureGeneral(QWidget* parent) this->setConfiguration(); + connect(ui->toggle_deepscan, &QCheckBox::stateChanged, this, + [] { UISettings::values.is_game_list_reload_pending.exchange(true); }); + ui->use_cpu_jit->setEnabled(!Core::System::GetInstance().IsPoweredOn()); ui->use_docked_mode->setEnabled(!Core::System::GetInstance().IsPoweredOn()); } -- cgit v1.2.3