From 9fb5674233c21775fac76cf96cd2a77c4098e908 Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Thu, 14 Apr 2022 21:55:03 +0200 Subject: refactor: cleanup ModLoaderType --- launcher/modplatform/modrinth/ModrinthAPI.h | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) (limited to 'launcher/modplatform/modrinth') diff --git a/launcher/modplatform/modrinth/ModrinthAPI.h b/launcher/modplatform/modrinth/ModrinthAPI.h index 711649d9..eefa4a85 100644 --- a/launcher/modplatform/modrinth/ModrinthAPI.h +++ b/launcher/modplatform/modrinth/ModrinthAPI.h @@ -51,25 +51,16 @@ class ModrinthAPI : public NetworkModAPI { return s; } - inline auto getModLoaderString(ModLoaderType modLoader) const -> QString + static auto getModLoaderString(ModLoaderType type) -> const QString { - switch (modLoader) { - case Any: - return "fabric, forge, quilt"; - case Forge: - return "forge"; - case Fabric: - return "fabric"; - case Quilt: - return "quilt"; - default: - return ""; - } + if (type == Unspecified) + return "fabric, forge, quilt"; + return ModAPI::getModLoaderString(type); } inline auto validateModLoader(ModLoaderType modLoader) const -> bool { - return modLoader == Any || modLoader == Forge || modLoader == Fabric || modLoader == Quilt; + return modLoader == Unspecified || modLoader == Forge || modLoader == Fabric || modLoader == Quilt; } }; -- cgit