summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinQt2/Config/NewPatchDialog.cpp
diff options
context:
space:
mode:
authorLéo Lam <leo@innovatetechnologi.es>2018-05-13 21:58:55 +0200
committerGitHub <noreply@github.com>2018-05-13 21:58:55 +0200
commit07b57c7ac62e519ba0280ce28b0c32b342d92cd8 (patch)
tree59c9c43d0dd2683d8acd5c9dec6ced4c0b7fbf92 /Source/Core/DolphinQt2/Config/NewPatchDialog.cpp
parente67cbd462b96af1ce753a4e07514bb51d89c615d (diff)
parent5fd8cec7ea961559a4e5c6b66420a55144c60a76 (diff)
Merge pull request #6843 from lioncash/patch
PatchEngine: Minor changes
Diffstat (limited to 'Source/Core/DolphinQt2/Config/NewPatchDialog.cpp')
-rw-r--r--Source/Core/DolphinQt2/Config/NewPatchDialog.cpp18
1 files changed, 7 insertions, 11 deletions
diff --git a/Source/Core/DolphinQt2/Config/NewPatchDialog.cpp b/Source/Core/DolphinQt2/Config/NewPatchDialog.cpp
index fbe081d0b2..34745ceafc 100644
--- a/Source/Core/DolphinQt2/Config/NewPatchDialog.cpp
+++ b/Source/Core/DolphinQt2/Config/NewPatchDialog.cpp
@@ -77,11 +77,7 @@ void NewPatchDialog::ConnectWidgets()
void NewPatchDialog::AddEntry()
{
- PatchEngine::PatchEntry entry;
- entry.type = PatchEngine::PATCH_8BIT;
- entry.address = entry.value = 0;
-
- m_patch.entries.push_back(entry);
+ m_patch.entries.emplace_back();
m_entry_layout->addWidget(CreateEntry(static_cast<int>(m_patch.entries.size() - 1)));
}
@@ -163,24 +159,24 @@ QGroupBox* NewPatchDialog::CreateEntry(int index)
connect(byte, &QRadioButton::toggled, [this, index](bool checked) {
if (checked)
- m_patch.entries[index].type = PatchEngine::PATCH_8BIT;
+ m_patch.entries[index].type = PatchEngine::PatchType::Patch8Bit;
});
connect(word, &QRadioButton::toggled, [this, index](bool checked) {
if (checked)
- m_patch.entries[index].type = PatchEngine::PATCH_16BIT;
+ m_patch.entries[index].type = PatchEngine::PatchType::Patch16Bit;
});
connect(dword, &QRadioButton::toggled, [this, index](bool checked) {
if (checked)
- m_patch.entries[index].type = PatchEngine::PATCH_32BIT;
+ m_patch.entries[index].type = PatchEngine::PatchType::Patch32Bit;
});
auto entry_type = m_patch.entries[index].type;
- byte->setChecked(entry_type == PatchEngine::PATCH_8BIT);
- word->setChecked(entry_type == PatchEngine::PATCH_16BIT);
- dword->setChecked(entry_type == PatchEngine::PATCH_32BIT);
+ byte->setChecked(entry_type == PatchEngine::PatchType::Patch8Bit);
+ word->setChecked(entry_type == PatchEngine::PatchType::Patch16Bit);
+ dword->setChecked(entry_type == PatchEngine::PatchType::Patch32Bit);
offset->setText(
QStringLiteral("%1").arg(m_patch.entries[index].address, 10, 16, QLatin1Char('0')));