mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-05-18 09:24:58 +00:00
Qt: fix deprecation warnings (#1672)
This commit is contained in:
parent
174b5c0f95
commit
65cd3be4ca
2 changed files with 22 additions and 7 deletions
|
@ -14,6 +14,7 @@
|
||||||
#include <QNetworkReply>
|
#include <QNetworkReply>
|
||||||
#include <QNetworkRequest>
|
#include <QNetworkRequest>
|
||||||
#include <QProcess>
|
#include <QProcess>
|
||||||
|
#include <QProgressBar>
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
#include <QStandardPaths>
|
#include <QStandardPaths>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
@ -24,11 +25,9 @@
|
||||||
#include <common/path_util.h>
|
#include <common/path_util.h>
|
||||||
#include <common/scm_rev.h>
|
#include <common/scm_rev.h>
|
||||||
#include <common/version.h>
|
#include <common/version.h>
|
||||||
#include <qprogressbar.h>
|
|
||||||
#include "check_update.h"
|
#include "check_update.h"
|
||||||
|
|
||||||
using namespace Common::FS;
|
using namespace Common::FS;
|
||||||
namespace fs = std::filesystem;
|
|
||||||
|
|
||||||
CheckUpdate::CheckUpdate(const bool showMessage, QWidget* parent)
|
CheckUpdate::CheckUpdate(const bool showMessage, QWidget* parent)
|
||||||
: QDialog(parent), networkManager(new QNetworkAccessManager(this)) {
|
: QDialog(parent), networkManager(new QNetworkAccessManager(this)) {
|
||||||
|
@ -254,7 +253,11 @@ void CheckUpdate::setupUI(const QString& downloadUrl, const QString& latestDate,
|
||||||
connect(noButton, &QPushButton::clicked, this, [this]() { close(); });
|
connect(noButton, &QPushButton::clicked, this, [this]() { close(); });
|
||||||
|
|
||||||
autoUpdateCheckBox->setChecked(Config::autoUpdate());
|
autoUpdateCheckBox->setChecked(Config::autoUpdate());
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 7, 0))
|
||||||
connect(autoUpdateCheckBox, &QCheckBox::stateChanged, this, [](int state) {
|
connect(autoUpdateCheckBox, &QCheckBox::stateChanged, this, [](int state) {
|
||||||
|
#else
|
||||||
|
connect(autoUpdateCheckBox, &QCheckBox::checkStateChanged, this, [](Qt::CheckState state) {
|
||||||
|
#endif
|
||||||
const auto user_dir = Common::FS::GetUserPath(Common::FS::PathType::UserDir);
|
const auto user_dir = Common::FS::GetUserPath(Common::FS::PathType::UserDir);
|
||||||
Config::setAutoUpdate(state == Qt::Checked);
|
Config::setAutoUpdate(state == Qt::Checked);
|
||||||
Config::save(user_dir / "config.toml");
|
Config::save(user_dir / "config.toml");
|
||||||
|
|
|
@ -3,22 +3,24 @@
|
||||||
|
|
||||||
#include <QCompleter>
|
#include <QCompleter>
|
||||||
#include <QDirIterator>
|
#include <QDirIterator>
|
||||||
|
#include <QFileDialog>
|
||||||
#include <QHoverEvent>
|
#include <QHoverEvent>
|
||||||
|
#include <fmt/format.h>
|
||||||
|
|
||||||
#include <common/version.h>
|
|
||||||
#include "common/config.h"
|
#include "common/config.h"
|
||||||
|
#include "common/version.h"
|
||||||
#include "qt_gui/compatibility_info.h"
|
#include "qt_gui/compatibility_info.h"
|
||||||
#ifdef ENABLE_DISCORD_RPC
|
#ifdef ENABLE_DISCORD_RPC
|
||||||
#include "common/discord_rpc_handler.h"
|
#include "common/discord_rpc_handler.h"
|
||||||
|
#include "common/singleton.h"
|
||||||
#endif
|
#endif
|
||||||
#ifdef ENABLE_UPDATER
|
#ifdef ENABLE_UPDATER
|
||||||
#include "check_update.h"
|
#include "check_update.h"
|
||||||
#endif
|
#endif
|
||||||
#include <toml.hpp>
|
#include <toml.hpp>
|
||||||
|
#include "background_music_player.h"
|
||||||
#include "common/logging/backend.h"
|
#include "common/logging/backend.h"
|
||||||
#include "common/logging/filter.h"
|
#include "common/logging/filter.h"
|
||||||
#include "common/logging/formatter.h"
|
|
||||||
#include "main_window.h"
|
|
||||||
#include "settings_dialog.h"
|
#include "settings_dialog.h"
|
||||||
#include "ui_settings_dialog.h"
|
#include "ui_settings_dialog.h"
|
||||||
QStringList languageNames = {"Arabic",
|
QStringList languageNames = {"Arabic",
|
||||||
|
@ -130,8 +132,13 @@ SettingsDialog::SettingsDialog(std::span<const QString> physical_devices,
|
||||||
// GENERAL TAB
|
// GENERAL TAB
|
||||||
{
|
{
|
||||||
#ifdef ENABLE_UPDATER
|
#ifdef ENABLE_UPDATER
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 7, 0))
|
||||||
connect(ui->updateCheckBox, &QCheckBox::stateChanged, this,
|
connect(ui->updateCheckBox, &QCheckBox::stateChanged, this,
|
||||||
[](int state) { Config::setAutoUpdate(state == Qt::Checked); });
|
[](int state) { Config::setAutoUpdate(state == Qt::Checked); });
|
||||||
|
#else
|
||||||
|
connect(ui->updateCheckBox, &QCheckBox::checkStateChanged, this,
|
||||||
|
[](Qt::CheckState state) { Config::setAutoUpdate(state == Qt::Checked); });
|
||||||
|
#endif
|
||||||
|
|
||||||
connect(ui->updateComboBox, &QComboBox::currentTextChanged, this,
|
connect(ui->updateComboBox, &QComboBox::currentTextChanged, this,
|
||||||
[](const QString& channel) { Config::setUpdateChannel(channel.toStdString()); });
|
[](const QString& channel) { Config::setUpdateChannel(channel.toStdString()); });
|
||||||
|
@ -150,7 +157,12 @@ SettingsDialog::SettingsDialog(std::span<const QString> physical_devices,
|
||||||
emit CompatibilityChanged();
|
emit CompatibilityChanged();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 7, 0))
|
||||||
connect(ui->enableCompatibilityCheckBox, &QCheckBox::stateChanged, this, [this](int state) {
|
connect(ui->enableCompatibilityCheckBox, &QCheckBox::stateChanged, this, [this](int state) {
|
||||||
|
#else
|
||||||
|
connect(ui->enableCompatibilityCheckBox, &QCheckBox::checkStateChanged, this,
|
||||||
|
[this](Qt::CheckState state) {
|
||||||
|
#endif
|
||||||
Config::setCompatibilityEnabled(state);
|
Config::setCompatibilityEnabled(state);
|
||||||
emit CompatibilityChanged();
|
emit CompatibilityChanged();
|
||||||
});
|
});
|
||||||
|
@ -358,7 +370,7 @@ void SettingsDialog::InitializeEmulatorLanguages() {
|
||||||
idx++;
|
idx++;
|
||||||
}
|
}
|
||||||
|
|
||||||
connect(ui->emulatorLanguageComboBox, qOverload<int>(&QComboBox::currentIndexChanged), this,
|
connect(ui->emulatorLanguageComboBox, &QComboBox::currentIndexChanged, this,
|
||||||
&SettingsDialog::OnLanguageChanged);
|
&SettingsDialog::OnLanguageChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -578,4 +590,4 @@ void SettingsDialog::ResetInstallFolders() {
|
||||||
}
|
}
|
||||||
Config::setGameInstallDirs(settings_install_dirs_config);
|
Config::setGameInstallDirs(settings_install_dirs_config);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue