Skip to content

Commit

Permalink
Qt: fix deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
oltolm committed Dec 20, 2024
1 parent 953fb14 commit 5155985
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
3 changes: 1 addition & 2 deletions src/qt_gui/check_update.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down Expand Up @@ -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");
Expand Down
11 changes: 6 additions & 5 deletions src/qt_gui/settings_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include <QCompleter>
#include <QDirIterator>
#include <QFileDialog>
#include <QHoverEvent>

#include <common/version.h>
Expand All @@ -13,10 +14,10 @@
#include "check_update.h"
#endif
#include <toml.hpp>
#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",
Expand Down Expand Up @@ -126,8 +127,8 @@ SettingsDialog::SettingsDialog(std::span<const QString> 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()); });
Expand Down Expand Up @@ -336,7 +337,7 @@ void SettingsDialog::InitializeEmulatorLanguages() {
idx++;
}

connect(ui->emulatorLanguageComboBox, qOverload<int>(&QComboBox::currentIndexChanged), this,
connect(ui->emulatorLanguageComboBox, &QComboBox::currentIndexChanged, this,
&SettingsDialog::OnLanguageChanged);
}

Expand Down Expand Up @@ -549,4 +550,4 @@ void SettingsDialog::ResetInstallFolders() {
}
Config::setGameInstallDirs(settings_install_dirs_config);
}
}
}

0 comments on commit 5155985

Please sign in to comment.