diff options
| author | Lioncash <mathew1800@gmail.com> | 2018-05-13 14:10:58 -0400 |
|---|---|---|
| committer | Lioncash <mathew1800@gmail.com> | 2018-05-13 15:46:51 -0400 |
| commit | 0995cfef6a8a59fd3e2c7c03297001e8a6c3fb8d (patch) | |
| tree | f197328af529e036243946451f67c2c7deff09e0 /Source/Core/DolphinQt2/Config/NewPatchDialog.cpp | |
| parent | a166cf24812451f62680eac971b6f50173653084 (diff) | |
PatchEngine: Make PatchType an enum class
Makes the enum strongly typed. A function for retrieving the string
representation of the enum is also added, which allows hiding the array
that contains all of the strings from view (i.e. we operate on the API,
not the exposed internals). This also allows us to bounds check any
querying for the strings.
Diffstat (limited to 'Source/Core/DolphinQt2/Config/NewPatchDialog.cpp')
| -rw-r--r-- | Source/Core/DolphinQt2/Config/NewPatchDialog.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Source/Core/DolphinQt2/Config/NewPatchDialog.cpp b/Source/Core/DolphinQt2/Config/NewPatchDialog.cpp index 33fef87db5..0dfc94a474 100644 --- a/Source/Core/DolphinQt2/Config/NewPatchDialog.cpp +++ b/Source/Core/DolphinQt2/Config/NewPatchDialog.cpp @@ -161,24 +161,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'))); |
