From fca8ac40fffac3ef31132f8c1c65474c638af8cf Mon Sep 17 00:00:00 2001 From: Pagwin Date: Fri, 21 Nov 2025 16:19:41 -0500 Subject: [PATCH] Minor remaining fixes for PR (#4374) - changed case of `handleNoModLoader` to match project style - made default case in switch statement for `handleNoModLoader` return true for safety Signed-off-by: Pagwin --- launcher/ui/pages/instance/ModFolderPage.cpp | 11 ++++++----- launcher/ui/pages/instance/ModFolderPage.h | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/launcher/ui/pages/instance/ModFolderPage.cpp b/launcher/ui/pages/instance/ModFolderPage.cpp index a619743b3..0e56aeff8 100644 --- a/launcher/ui/pages/instance/ModFolderPage.cpp +++ b/launcher/ui/pages/instance/ModFolderPage.cpp @@ -146,7 +146,7 @@ void ModFolderPage::downloadMods() auto profile = static_cast(m_instance)->getPackProfile(); if (!profile->getModLoaders().has_value()) { - if (HandleNoModLoader()) { + if (handleNoModLoader()) { return; } } @@ -203,7 +203,7 @@ void ModFolderPage::updateMods(bool includeDeps) auto profile = static_cast(m_instance)->getPackProfile(); if (!profile->getModLoaders().has_value()) { - if (HandleNoModLoader()) { + if (handleNoModLoader()) { return; } } @@ -308,7 +308,7 @@ void ModFolderPage::changeModVersion() auto profile = static_cast(m_instance)->getPackProfile(); if (!profile->getModLoaders().has_value()) { - if (HandleNoModLoader()) { + if (handleNoModLoader()) { return; } } @@ -391,7 +391,7 @@ bool NilModFolderPage::shouldDisplay() const } // Helper function so this doesn't need to be duplicated 3 times -inline bool ModFolderPage::HandleNoModLoader() +inline bool ModFolderPage::handleNoModLoader() { int resp = QMessageBox::question(this, this->tr("Missing ModLoader"), this->tr("You need to install a mod loader before installing mods, would you like to do so?"), @@ -413,7 +413,8 @@ inline bool ModFolderPage::HandleNoModLoader() } default: { // Unreachable - break; + // returning true as a safety measure + return true; } } } diff --git a/launcher/ui/pages/instance/ModFolderPage.h b/launcher/ui/pages/instance/ModFolderPage.h index 296f1dd4e..aadeecb20 100644 --- a/launcher/ui/pages/instance/ModFolderPage.h +++ b/launcher/ui/pages/instance/ModFolderPage.h @@ -45,7 +45,7 @@ class ModFolderPage : public ExternalResourcesPage { Q_OBJECT - bool HandleNoModLoader(); + inline bool handleNoModLoader(); public: explicit ModFolderPage(BaseInstance* inst, std::shared_ptr model, QWidget* parent = nullptr);