From f649c443d9e27828bc148be3e87ff537d5bf1ef1 Mon Sep 17 00:00:00 2001 From: BreadFish64 Date: Mon, 2 Jul 2018 16:53:34 -0500 Subject: [PATCH] optimize settings application --- src/citra_qt/configuration/configure_audio.cpp | 1 - src/citra_qt/configuration/configure_camera.cpp | 1 - src/citra_qt/configuration/configure_debug.cpp | 1 - src/citra_qt/configuration/configure_general.cpp | 1 - src/citra_qt/configuration/configure_graphics.cpp | 1 - src/citra_qt/configuration/configure_input.cpp | 2 -- src/citra_qt/configuration/configure_web.cpp | 1 - src/citra_qt/main.cpp | 4 +++- 8 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/citra_qt/configuration/configure_audio.cpp b/src/citra_qt/configuration/configure_audio.cpp index 46424dbb9c..123be49970 100644 --- a/src/citra_qt/configuration/configure_audio.cpp +++ b/src/citra_qt/configuration/configure_audio.cpp @@ -61,7 +61,6 @@ void ConfigureAudio::applyConfiguration() { Settings::values.audio_device_id = ui->audio_device_combo_box->itemText(ui->audio_device_combo_box->currentIndex()) .toStdString(); - Settings::Apply(); } void ConfigureAudio::updateAudioDevices(int sink_index) { diff --git a/src/citra_qt/configuration/configure_camera.cpp b/src/citra_qt/configuration/configure_camera.cpp index 226fb7d0ea..b1c8de40b2 100644 --- a/src/citra_qt/configuration/configure_camera.cpp +++ b/src/citra_qt/configuration/configure_camera.cpp @@ -285,7 +285,6 @@ void ConfigureCamera::applyConfiguration() { Settings::values.camera_name = camera_name; Settings::values.camera_config = camera_config; Settings::values.camera_flip = camera_flip; - Settings::Apply(); } ConfigureCamera::CameraPosition ConfigureCamera::getCameraSelection() { diff --git a/src/citra_qt/configuration/configure_debug.cpp b/src/citra_qt/configuration/configure_debug.cpp index e57cd8ef17..6b708cfdd2 100644 --- a/src/citra_qt/configuration/configure_debug.cpp +++ b/src/citra_qt/configuration/configure_debug.cpp @@ -44,7 +44,6 @@ void ConfigureDebug::applyConfiguration() { Log::Filter filter; filter.ParseFilterString(Settings::values.log_filter); Log::SetGlobalFilter(filter); - Settings::Apply(); } void ConfigureDebug::retranslateUi() { diff --git a/src/citra_qt/configuration/configure_general.cpp b/src/citra_qt/configuration/configure_general.cpp index 0bdeeeb3dd..d89a7984c4 100644 --- a/src/citra_qt/configuration/configure_general.cpp +++ b/src/citra_qt/configuration/configure_general.cpp @@ -68,7 +68,6 @@ void ConfigureGeneral::applyConfiguration() { Settings::values.region_value = ui->region_combobox->currentIndex() - 1; Settings::values.use_cpu_jit = ui->toggle_cpu_jit->isChecked(); - Settings::Apply(); } void ConfigureGeneral::onLanguageChanged(int index) { diff --git a/src/citra_qt/configuration/configure_graphics.cpp b/src/citra_qt/configuration/configure_graphics.cpp index 7868702f56..41fd13ba9b 100644 --- a/src/citra_qt/configuration/configure_graphics.cpp +++ b/src/citra_qt/configuration/configure_graphics.cpp @@ -62,7 +62,6 @@ void ConfigureGraphics::applyConfiguration() { Settings::values.layout_option = static_cast(ui->layout_combobox->currentIndex()); Settings::values.swap_screen = ui->swap_screen->isChecked(); - Settings::Apply(); } void ConfigureGraphics::retranslateUi() { diff --git a/src/citra_qt/configuration/configure_input.cpp b/src/citra_qt/configuration/configure_input.cpp index 8bdfd83a1a..1428a77197 100644 --- a/src/citra_qt/configuration/configure_input.cpp +++ b/src/citra_qt/configuration/configure_input.cpp @@ -186,8 +186,6 @@ void ConfigureInput::applyConfiguration() { [](const Common::ParamPackage& param) { return param.Serialize(); }); std::transform(analogs_param.begin(), analogs_param.end(), Settings::values.analogs.begin(), [](const Common::ParamPackage& param) { return param.Serialize(); }); - - Settings::Apply(); } void ConfigureInput::loadConfiguration() { diff --git a/src/citra_qt/configuration/configure_web.cpp b/src/citra_qt/configuration/configure_web.cpp index 58e326e126..78dc81ca3d 100644 --- a/src/citra_qt/configuration/configure_web.cpp +++ b/src/citra_qt/configuration/configure_web.cpp @@ -61,7 +61,6 @@ void ConfigureWeb::applyConfiguration() { tr("Username and token were not verified. The changes to your " "username and/or token have not been saved.")); } - Settings::Apply(); } void ConfigureWeb::RefreshTelemetryID() { diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp index ff16a00068..d276af54c3 100644 --- a/src/citra_qt/main.cpp +++ b/src/citra_qt/main.cpp @@ -1154,10 +1154,12 @@ void GMainWindow::OnConfigure() { ConfigureDialog configureDialog(this); connect(&configureDialog, &ConfigureDialog::languageChanged, this, &GMainWindow::OnLanguageChanged); + auto old_theme = UISettings::values.theme; auto result = configureDialog.exec(); if (result == QDialog::Accepted) { configureDialog.applyConfiguration(); - UpdateUITheme(); + if (UISettings::values.theme != old_theme) + UpdateUITheme(); emit UpdateThemedIcons(); SyncMenuUISettings(); config->Save();