mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-05-17 17:05:02 +00:00
Fix warnings (#749)
* suppress warning in vk_mem_alloc.h * fix warnings in cheats_patches.cpp
This commit is contained in:
parent
42ab101908
commit
e9ef726185
7 changed files with 33 additions and 14 deletions
|
@ -147,13 +147,13 @@ void CheatsPatches::setupUI() {
|
||||||
controlLayout->addWidget(downloadComboBox);
|
controlLayout->addWidget(downloadComboBox);
|
||||||
|
|
||||||
QPushButton* downloadButton = new QPushButton(tr("Download Cheats"));
|
QPushButton* downloadButton = new QPushButton(tr("Download Cheats"));
|
||||||
connect(downloadButton, &QPushButton::clicked, [=]() {
|
connect(downloadButton, &QPushButton::clicked, [this, downloadComboBox]() {
|
||||||
QString source = downloadComboBox->currentData().toString();
|
QString source = downloadComboBox->currentData().toString();
|
||||||
downloadCheats(source, m_gameSerial, m_gameVersion, true);
|
downloadCheats(source, m_gameSerial, m_gameVersion, true);
|
||||||
});
|
});
|
||||||
|
|
||||||
QPushButton* deleteCheatButton = new QPushButton(tr("Delete File"));
|
QPushButton* deleteCheatButton = new QPushButton(tr("Delete File"));
|
||||||
connect(deleteCheatButton, &QPushButton::clicked, [=]() {
|
connect(deleteCheatButton, &QPushButton::clicked, [this, CHEATS_DIR_QString]() {
|
||||||
QStringListModel* model = qobject_cast<QStringListModel*>(listView_selectFile->model());
|
QStringListModel* model = qobject_cast<QStringListModel*>(listView_selectFile->model());
|
||||||
if (!model) {
|
if (!model) {
|
||||||
return;
|
return;
|
||||||
|
@ -232,7 +232,7 @@ void CheatsPatches::setupUI() {
|
||||||
patchesControlLayout->addWidget(patchesComboBox);
|
patchesControlLayout->addWidget(patchesComboBox);
|
||||||
|
|
||||||
QPushButton* patchesButton = new QPushButton(tr("Download Patches"));
|
QPushButton* patchesButton = new QPushButton(tr("Download Patches"));
|
||||||
connect(patchesButton, &QPushButton::clicked, [=]() {
|
connect(patchesButton, &QPushButton::clicked, [this]() {
|
||||||
QString selectedOption = patchesComboBox->currentData().toString();
|
QString selectedOption = patchesComboBox->currentData().toString();
|
||||||
downloadPatches(selectedOption, true);
|
downloadPatches(selectedOption, true);
|
||||||
});
|
});
|
||||||
|
@ -444,8 +444,8 @@ QCheckBox* CheatsPatches::findCheckBoxByName(const QString& name) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CheatsPatches::downloadCheats(const QString& source, const QString& m_gameSerial,
|
void CheatsPatches::downloadCheats(const QString& source, const QString& gameSerial,
|
||||||
const QString& m_gameVersion, const bool showMessageBox) {
|
const QString& gameVersion, const bool showMessageBox) {
|
||||||
QDir dir(Common::FS::GetUserPath(Common::FS::PathType::CheatsDir));
|
QDir dir(Common::FS::GetUserPath(Common::FS::PathType::CheatsDir));
|
||||||
if (!dir.exists()) {
|
if (!dir.exists()) {
|
||||||
dir.mkpath(".");
|
dir.mkpath(".");
|
||||||
|
@ -455,7 +455,7 @@ void CheatsPatches::downloadCheats(const QString& source, const QString& m_gameS
|
||||||
if (source == "GoldHEN") {
|
if (source == "GoldHEN") {
|
||||||
url = "https://raw.githubusercontent.com/GoldHEN/GoldHEN_Cheat_Repository/main/json.txt";
|
url = "https://raw.githubusercontent.com/GoldHEN/GoldHEN_Cheat_Repository/main/json.txt";
|
||||||
} else if (source == "wolf2022") {
|
} else if (source == "wolf2022") {
|
||||||
url = "https://wolf2022.ir/trainer/" + m_gameSerial + "_" + m_gameVersion + ".json";
|
url = "https://wolf2022.ir/trainer/" + gameSerial + "_" + gameVersion + ".json";
|
||||||
} else if (source == "shadPS4") {
|
} else if (source == "shadPS4") {
|
||||||
url = "https://raw.githubusercontent.com/shadps4-emu/ps4_cheats/main/"
|
url = "https://raw.githubusercontent.com/shadps4-emu/ps4_cheats/main/"
|
||||||
"CHEATS_JSON.txt";
|
"CHEATS_JSON.txt";
|
||||||
|
@ -468,7 +468,7 @@ void CheatsPatches::downloadCheats(const QString& source, const QString& m_gameS
|
||||||
QNetworkRequest request(url);
|
QNetworkRequest request(url);
|
||||||
QNetworkReply* reply = manager->get(request);
|
QNetworkReply* reply = manager->get(request);
|
||||||
|
|
||||||
connect(reply, &QNetworkReply::finished, [=]() {
|
connect(reply, &QNetworkReply::finished, [=, this]() {
|
||||||
if (reply->error() == QNetworkReply::NoError) {
|
if (reply->error() == QNetworkReply::NoError) {
|
||||||
QByteArray jsonData = reply->readAll();
|
QByteArray jsonData = reply->readAll();
|
||||||
bool foundFiles = false;
|
bool foundFiles = false;
|
||||||
|
@ -476,7 +476,7 @@ void CheatsPatches::downloadCheats(const QString& source, const QString& m_gameS
|
||||||
if (source == "GoldHEN" || source == "shadPS4") {
|
if (source == "GoldHEN" || source == "shadPS4") {
|
||||||
QString textContent(jsonData);
|
QString textContent(jsonData);
|
||||||
QRegularExpression regex(
|
QRegularExpression regex(
|
||||||
QString("%1_%2[^=]*\.json").arg(m_gameSerial).arg(m_gameVersion));
|
QString("%1_%2[^=]*\\.json").arg(gameSerial).arg(gameVersion));
|
||||||
QRegularExpressionMatchIterator matches = regex.globalMatch(textContent);
|
QRegularExpressionMatchIterator matches = regex.globalMatch(textContent);
|
||||||
QString baseUrl;
|
QString baseUrl;
|
||||||
|
|
||||||
|
@ -519,7 +519,7 @@ void CheatsPatches::downloadCheats(const QString& source, const QString& m_gameS
|
||||||
QNetworkRequest fileRequest(fileUrl);
|
QNetworkRequest fileRequest(fileUrl);
|
||||||
QNetworkReply* fileReply = manager->get(fileRequest);
|
QNetworkReply* fileReply = manager->get(fileRequest);
|
||||||
|
|
||||||
connect(fileReply, &QNetworkReply::finished, [=]() {
|
connect(fileReply, &QNetworkReply::finished, [=, this]() {
|
||||||
if (fileReply->error() == QNetworkReply::NoError) {
|
if (fileReply->error() == QNetworkReply::NoError) {
|
||||||
QByteArray fileData = fileReply->readAll();
|
QByteArray fileData = fileReply->readAll();
|
||||||
QFile localFile(localFilePath);
|
QFile localFile(localFilePath);
|
||||||
|
@ -680,7 +680,7 @@ void CheatsPatches::downloadPatches(const QString repository, const bool showMes
|
||||||
QNetworkRequest request(url);
|
QNetworkRequest request(url);
|
||||||
QNetworkReply* reply = manager->get(request);
|
QNetworkReply* reply = manager->get(request);
|
||||||
|
|
||||||
connect(reply, &QNetworkReply::finished, [=]() {
|
connect(reply, &QNetworkReply::finished, [=, this]() {
|
||||||
if (reply->error() == QNetworkReply::NoError) {
|
if (reply->error() == QNetworkReply::NoError) {
|
||||||
QByteArray htmlData = reply->readAll();
|
QByteArray htmlData = reply->readAll();
|
||||||
reply->deleteLater();
|
reply->deleteLater();
|
||||||
|
@ -725,7 +725,7 @@ void CheatsPatches::downloadPatches(const QString repository, const bool showMes
|
||||||
QNetworkRequest fileRequest(fileUrl);
|
QNetworkRequest fileRequest(fileUrl);
|
||||||
QNetworkReply* fileReply = manager->get(fileRequest);
|
QNetworkReply* fileReply = manager->get(fileRequest);
|
||||||
|
|
||||||
connect(fileReply, &QNetworkReply::finished, [=]() {
|
connect(fileReply, &QNetworkReply::finished, [=, this]() {
|
||||||
if (fileReply->error() == QNetworkReply::NoError) {
|
if (fileReply->error() == QNetworkReply::NoError) {
|
||||||
QByteArray fileData = fileReply->readAll();
|
QByteArray fileData = fileReply->readAll();
|
||||||
QFile localFile(dir.filePath(fileName));
|
QFile localFile(dir.filePath(fileName));
|
||||||
|
@ -864,7 +864,7 @@ void CheatsPatches::addCheatsToLayout(const QJsonArray& modsArray, const QJsonAr
|
||||||
rightLayout->addWidget(cheatCheckBox);
|
rightLayout->addWidget(cheatCheckBox);
|
||||||
m_cheatCheckBoxes.append(cheatCheckBox);
|
m_cheatCheckBoxes.append(cheatCheckBox);
|
||||||
connect(cheatCheckBox, &QCheckBox::toggled,
|
connect(cheatCheckBox, &QCheckBox::toggled,
|
||||||
[=](bool checked) { applyCheat(modName, checked); });
|
[this, modName](bool checked) { applyCheat(modName, checked); });
|
||||||
} else if (modType == "button") {
|
} else if (modType == "button") {
|
||||||
QPushButton* cheatButton = new QPushButton(modName);
|
QPushButton* cheatButton = new QPushButton(modName);
|
||||||
cheatButton->adjustSize();
|
cheatButton->adjustSize();
|
||||||
|
@ -880,7 +880,8 @@ void CheatsPatches::addCheatsToLayout(const QJsonArray& modsArray, const QJsonAr
|
||||||
buttonLayout->addStretch();
|
buttonLayout->addStretch();
|
||||||
|
|
||||||
rightLayout->addLayout(buttonLayout);
|
rightLayout->addLayout(buttonLayout);
|
||||||
connect(cheatButton, &QPushButton::clicked, [=]() { applyCheat(modName, true); });
|
connect(cheatButton, &QPushButton::clicked,
|
||||||
|
[this, modName]() { applyCheat(modName, true); });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1093,7 +1094,7 @@ void CheatsPatches::addPatchesToLayout(const QString& filePath) {
|
||||||
patchCheckBox->installEventFilter(this);
|
patchCheckBox->installEventFilter(this);
|
||||||
|
|
||||||
connect(patchCheckBox, &QCheckBox::toggled,
|
connect(patchCheckBox, &QCheckBox::toggled,
|
||||||
[=](bool checked) { applyPatch(patchName, checked); });
|
[this, patchName](bool checked) { applyPatch(patchName, checked); });
|
||||||
|
|
||||||
patchName.clear();
|
patchName.clear();
|
||||||
patchAuthor.clear();
|
patchAuthor.clear();
|
||||||
|
|
|
@ -9,7 +9,10 @@
|
||||||
#include "video_core/renderer_vulkan/vk_platform.h"
|
#include "video_core/renderer_vulkan/vk_platform.h"
|
||||||
#include "video_core/renderer_vulkan/vk_scheduler.h"
|
#include "video_core/renderer_vulkan/vk_scheduler.h"
|
||||||
|
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
#pragma GCC diagnostic ignored "-Wnullability-completeness"
|
||||||
#include <vk_mem_alloc.h>
|
#include <vk_mem_alloc.h>
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
|
||||||
namespace VideoCore {
|
namespace VideoCore {
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,10 @@
|
||||||
#include "video_core/renderer_vulkan/vk_rasterizer.h"
|
#include "video_core/renderer_vulkan/vk_rasterizer.h"
|
||||||
#include "video_core/texture_cache/image.h"
|
#include "video_core/texture_cache/image.h"
|
||||||
|
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
#pragma GCC diagnostic ignored "-Wnullability-completeness"
|
||||||
#include <vk_mem_alloc.h>
|
#include <vk_mem_alloc.h>
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
|
||||||
namespace Vulkan {
|
namespace Vulkan {
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,10 @@
|
||||||
|
|
||||||
// Implement vma functions
|
// Implement vma functions
|
||||||
#define VMA_IMPLEMENTATION
|
#define VMA_IMPLEMENTATION
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
#pragma GCC diagnostic ignored "-Wnullability-completeness"
|
||||||
#include <vk_mem_alloc.h>
|
#include <vk_mem_alloc.h>
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
|
||||||
// Store the dispatch loader here
|
// Store the dispatch loader here
|
||||||
VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE
|
VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE
|
||||||
|
|
|
@ -14,7 +14,10 @@
|
||||||
#include "video_core/renderer_vulkan/vk_instance.h"
|
#include "video_core/renderer_vulkan/vk_instance.h"
|
||||||
#include "video_core/renderer_vulkan/vk_platform.h"
|
#include "video_core/renderer_vulkan/vk_platform.h"
|
||||||
|
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
#pragma GCC diagnostic ignored "-Wnullability-completeness"
|
||||||
#include <vk_mem_alloc.h>
|
#include <vk_mem_alloc.h>
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
|
||||||
namespace Vulkan {
|
namespace Vulkan {
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,10 @@
|
||||||
#include "video_core/texture_cache/image.h"
|
#include "video_core/texture_cache/image.h"
|
||||||
#include "video_core/texture_cache/tile_manager.h"
|
#include "video_core/texture_cache/tile_manager.h"
|
||||||
|
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
#pragma GCC diagnostic ignored "-Wnullability-completeness"
|
||||||
#include <vk_mem_alloc.h>
|
#include <vk_mem_alloc.h>
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
|
||||||
namespace VideoCore {
|
namespace VideoCore {
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,10 @@
|
||||||
|
|
||||||
#include <boost/container/static_vector.hpp>
|
#include <boost/container/static_vector.hpp>
|
||||||
#include <magic_enum.hpp>
|
#include <magic_enum.hpp>
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
#pragma GCC diagnostic ignored "-Wnullability-completeness"
|
||||||
#include <vk_mem_alloc.h>
|
#include <vk_mem_alloc.h>
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
|
||||||
namespace VideoCore {
|
namespace VideoCore {
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue