From 5155985d0d334213f636735758ec0a61bbb9cf86 Mon Sep 17 00:00:00 2001 From: oltolm Date: Thu, 5 Dec 2024 22:56:48 +0100 Subject: [PATCH] Qt: fix deprecation warnings --- src/qt_gui/check_update.cpp | 3 +-- src/qt_gui/settings_dialog.cpp | 11 ++++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/qt_gui/check_update.cpp b/src/qt_gui/check_update.cpp index d713f67fb91..e3361ce7c2f 100644 --- a/src/qt_gui/check_update.cpp +++ b/src/qt_gui/check_update.cpp @@ -27,7 +27,6 @@ #include "check_update.h" using namespace Common::FS; -namespace fs = std::filesystem; CheckUpdate::CheckUpdate(const bool showMessage, QWidget* parent) : QDialog(parent), networkManager(new QNetworkAccessManager(this)) { @@ -253,7 +252,7 @@ void CheckUpdate::setupUI(const QString& downloadUrl, const QString& latestDate, connect(noButton, &QPushButton::clicked, this, [this]() { close(); }); autoUpdateCheckBox->setChecked(Config::autoUpdate()); - connect(autoUpdateCheckBox, &QCheckBox::stateChanged, this, [](int state) { + connect(autoUpdateCheckBox, &QCheckBox::checkStateChanged, this, [](Qt::CheckState state) { const auto user_dir = Common::FS::GetUserPath(Common::FS::PathType::UserDir); Config::setAutoUpdate(state == Qt::Checked); Config::save(user_dir / "config.toml"); diff --git a/src/qt_gui/settings_dialog.cpp b/src/qt_gui/settings_dialog.cpp index 09d3674f7f9..51926aebd33 100644 --- a/src/qt_gui/settings_dialog.cpp +++ b/src/qt_gui/settings_dialog.cpp @@ -3,6 +3,7 @@ #include #include +#include #include #include @@ -13,10 +14,10 @@ #include "check_update.h" #endif #include +#include "background_music_player.h" #include "common/logging/backend.h" #include "common/logging/filter.h" #include "common/logging/formatter.h" -#include "main_window.h" #include "settings_dialog.h" #include "ui_settings_dialog.h" QStringList languageNames = {"Arabic", @@ -126,8 +127,8 @@ SettingsDialog::SettingsDialog(std::span physical_devices, QWidge // GENERAL TAB { #ifdef ENABLE_UPDATER - connect(ui->updateCheckBox, &QCheckBox::stateChanged, this, - [](int state) { Config::setAutoUpdate(state == Qt::Checked); }); + connect(ui->updateCheckBox, &QCheckBox::checkStateChanged, this, + [](Qt::CheckState state) { Config::setAutoUpdate(state == Qt::Checked); }); connect(ui->updateComboBox, &QComboBox::currentTextChanged, this, [](const QString& channel) { Config::setUpdateChannel(channel.toStdString()); }); @@ -336,7 +337,7 @@ void SettingsDialog::InitializeEmulatorLanguages() { idx++; } - connect(ui->emulatorLanguageComboBox, qOverload(&QComboBox::currentIndexChanged), this, + connect(ui->emulatorLanguageComboBox, &QComboBox::currentIndexChanged, this, &SettingsDialog::OnLanguageChanged); } @@ -549,4 +550,4 @@ void SettingsDialog::ResetInstallFolders() { } Config::setGameInstallDirs(settings_install_dirs_config); } -} \ No newline at end of file +}