mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2024-11-23 03:09:55 +00:00
Fix patches not save changes properly (#1493)
Some checks are pending
Build and Release / reuse (push) Waiting to run
Build and Release / clang-format (push) Waiting to run
Build and Release / get-info (push) Waiting to run
Build and Release / windows-sdl (push) Blocked by required conditions
Build and Release / windows-qt (push) Blocked by required conditions
Build and Release / macos-sdl (push) Blocked by required conditions
Build and Release / macos-qt (push) Blocked by required conditions
Build and Release / linux-sdl (push) Blocked by required conditions
Build and Release / linux-qt (push) Blocked by required conditions
Build and Release / pre-release (push) Blocked by required conditions
Some checks are pending
Build and Release / reuse (push) Waiting to run
Build and Release / clang-format (push) Waiting to run
Build and Release / get-info (push) Waiting to run
Build and Release / windows-sdl (push) Blocked by required conditions
Build and Release / windows-qt (push) Blocked by required conditions
Build and Release / macos-sdl (push) Blocked by required conditions
Build and Release / macos-qt (push) Blocked by required conditions
Build and Release / linux-sdl (push) Blocked by required conditions
Build and Release / linux-qt (push) Blocked by required conditions
Build and Release / pre-release (push) Blocked by required conditions
Don't use ```QCheckBox::text()``` because it may return strings that contain "&" cause patch name comparison to fail.
This commit is contained in:
parent
46ac48c311
commit
f45cad6bc9
@ -434,7 +434,9 @@ QCheckBox* CheatsPatches::findCheckBoxByName(const QString& name) {
|
|||||||
QWidget* widget = item->widget();
|
QWidget* widget = item->widget();
|
||||||
QCheckBox* checkBox = qobject_cast<QCheckBox*>(widget);
|
QCheckBox* checkBox = qobject_cast<QCheckBox*>(widget);
|
||||||
if (checkBox) {
|
if (checkBox) {
|
||||||
if (checkBox->text().toStdString().find(name.toStdString()) != std::string::npos) {
|
const auto patchName = checkBox->property("patchName");
|
||||||
|
if (patchName.isValid() && patchName.toString().toStdString().find(
|
||||||
|
name.toStdString()) != std::string::npos) {
|
||||||
return checkBox;
|
return checkBox;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1176,6 +1178,7 @@ void CheatsPatches::addPatchesToLayout(const QString& filePath) {
|
|||||||
|
|
||||||
if (!patchName.isEmpty() && !patchLines.isEmpty()) {
|
if (!patchName.isEmpty() && !patchLines.isEmpty()) {
|
||||||
QCheckBox* patchCheckBox = new QCheckBox(patchName);
|
QCheckBox* patchCheckBox = new QCheckBox(patchName);
|
||||||
|
patchCheckBox->setProperty("patchName", patchName);
|
||||||
patchCheckBox->setChecked(isEnabled);
|
patchCheckBox->setChecked(isEnabled);
|
||||||
patchesGroupBoxLayout->addWidget(patchCheckBox);
|
patchesGroupBoxLayout->addWidget(patchCheckBox);
|
||||||
|
|
||||||
@ -1349,8 +1352,10 @@ bool CheatsPatches::eventFilter(QObject* obj, QEvent* event) {
|
|||||||
|
|
||||||
void CheatsPatches::onPatchCheckBoxHovered(QCheckBox* checkBox, bool hovered) {
|
void CheatsPatches::onPatchCheckBoxHovered(QCheckBox* checkBox, bool hovered) {
|
||||||
if (hovered) {
|
if (hovered) {
|
||||||
QString text = checkBox->text();
|
const auto patchName = checkBox->property("patchName");
|
||||||
updateNoteTextEdit(text);
|
if (patchName.isValid()) {
|
||||||
|
updateNoteTextEdit(patchName.toString());
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
instructionsTextEdit->setText(defaultTextEdit);
|
instructionsTextEdit->setText(defaultTextEdit);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user