Use consistent snake_case naming & don't pass string_view by ref

Addresses feedback to use consistent naming conventions as most variables are using snake_case. Also no longer passes string_view by reference as per feedback.
This commit is contained in:
Dan McCarthy 2023-11-28 16:17:08 -06:00 committed by Connor McLaughlin
parent 57465b2892
commit 45758add5d
2 changed files with 10 additions and 10 deletions

View File

@ -88,12 +88,12 @@ void GamePatchSettingsWidget::onReloadClicked()
void GamePatchSettingsWidget::reloadList() void GamePatchSettingsWidget::reloadList()
{ {
// Patches shouldn't have any unlabelled patch groups, because they're new. // Patches shouldn't have any unlabelled patch groups, because they're new.
u32 numberOfUnlabeledPatches = 0; u32 number_of_unlabeled_patches = 0;
std::vector<Patch::PatchInfo> patches = Patch::GetPatchInfo(m_dialog->getSerial(), m_dialog->getDiscCRC(), false, &numberOfUnlabeledPatches); std::vector<Patch::PatchInfo> patches = Patch::GetPatchInfo(m_dialog->getSerial(), m_dialog->getDiscCRC(), false, &number_of_unlabeled_patches);
std::vector<std::string> enabled_list = std::vector<std::string> enabled_list =
m_dialog->getSettingsInterface()->GetStringList(Patch::PATCHES_CONFIG_SECTION, Patch::PATCH_ENABLE_CONFIG_KEY); m_dialog->getSettingsInterface()->GetStringList(Patch::PATCHES_CONFIG_SECTION, Patch::PATCH_ENABLE_CONFIG_KEY);
setUnlabeledPatchesWarningVisibility(numberOfUnlabeledPatches > 0); setUnlabeledPatchesWarningVisibility(number_of_unlabeled_patches > 0);
delete m_ui.scrollArea->takeWidget(); delete m_ui.scrollArea->takeWidget();
QWidget* container = new QWidget(m_ui.scrollArea); QWidget* container = new QWidget(m_ui.scrollArea);

View File

@ -158,8 +158,8 @@ namespace Patch
static std::vector<std::string> FindPatchFilesOnDisk( static std::vector<std::string> FindPatchFilesOnDisk(
const std::string_view& serial, u32 crc, bool cheats, bool all_crcs); const std::string_view& serial, u32 crc, bool cheats, bool all_crcs);
static bool ContainsPatchName(const PatchInfoList& patches, const std::string_view& patchName); static bool ContainsPatchName(const PatchInfoList& patches, const std::string_view patchName);
static bool ContainsPatchName(const PatchList& patches, const std::string_view& patchName); static bool ContainsPatchName(const PatchList& patches, const std::string_view patchName);
template <typename F> template <typename F>
static void EnumeratePnachFiles(const std::string_view& serial, u32 crc, bool cheats, bool for_ui, const F& f); static void EnumeratePnachFiles(const std::string_view& serial, u32 crc, bool cheats, bool for_ui, const F& f);
@ -219,11 +219,11 @@ void Patch::TrimPatchLine(std::string& buffer)
buffer.erase(pos); buffer.erase(pos);
} }
bool Patch::ContainsPatchName(const PatchList& patchList, const std::string_view& patchName) bool Patch::ContainsPatchName(const PatchList& patch_list, const std::string_view patch_name)
{ {
return std::find_if(patchList.begin(), patchList.end(), [&patchName](const PatchGroup& patch) { return std::find_if(patch_list.begin(), patch_list.end(), [&patch_name](const PatchGroup& patch) {
return patch.name == patchName; return patch.name == patch_name;
}) != patchList.end(); }) != patch_list.end();
} }
int Patch::PatchTableExecute(PatchGroup* group, const std::string_view& lhs, const std::string_view& rhs, int Patch::PatchTableExecute(PatchGroup* group, const std::string_view& lhs, const std::string_view& rhs,
@ -369,7 +369,7 @@ std::vector<std::string> Patch::FindPatchFilesOnDisk(const std::string_view& ser
return ret; return ret;
} }
bool Patch::ContainsPatchName(const PatchInfoList& patches, const std::string_view& patchName) bool Patch::ContainsPatchName(const PatchInfoList& patches, const std::string_view patchName)
{ {
return std::find_if(patches.begin(), patches.end(), [&patchName](const PatchInfo& patch) { return std::find_if(patches.begin(), patches.end(), [&patchName](const PatchInfo& patch) {
return patch.name == patchName; return patch.name == patchName;