propagate side as enum instead of Qstring
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
@@ -19,27 +19,16 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "modplatform/packwiz/Packwiz.h"
|
||||
|
||||
// launcher/minecraft/mod/Mod.h
|
||||
class Mod;
|
||||
|
||||
namespace Metadata {
|
||||
using ModStruct = Packwiz::V1::Mod;
|
||||
using ModSide = Packwiz::V1::Side;
|
||||
|
||||
inline auto create(const QDir& index_dir, ModPlatform::IndexedPack& mod_pack, ModPlatform::IndexedVersion& mod_version) -> ModStruct
|
||||
inline ModStruct create(const QDir& index_dir, ModPlatform::IndexedPack& mod_pack, ModPlatform::IndexedVersion& mod_version)
|
||||
{
|
||||
return Packwiz::V1::createModFormat(index_dir, mod_pack, mod_version);
|
||||
}
|
||||
|
||||
inline auto create(const QDir& index_dir, Mod& internal_mod, QString mod_slug) -> ModStruct
|
||||
{
|
||||
return Packwiz::V1::createModFormat(index_dir, internal_mod, std::move(mod_slug));
|
||||
}
|
||||
|
||||
inline void update(const QDir& index_dir, ModStruct& mod)
|
||||
{
|
||||
Packwiz::V1::updateModIndex(index_dir, mod);
|
||||
@@ -50,24 +39,14 @@ inline void remove(const QDir& index_dir, QString mod_slug)
|
||||
Packwiz::V1::deleteModIndex(index_dir, mod_slug);
|
||||
}
|
||||
|
||||
inline void remove(const QDir& index_dir, QVariant& mod_id)
|
||||
{
|
||||
Packwiz::V1::deleteModIndex(index_dir, mod_id);
|
||||
}
|
||||
|
||||
inline auto get(const QDir& index_dir, QString mod_slug) -> ModStruct
|
||||
inline ModStruct get(const QDir& index_dir, QString mod_slug)
|
||||
{
|
||||
return Packwiz::V1::getIndexForMod(index_dir, std::move(mod_slug));
|
||||
}
|
||||
|
||||
inline auto get(const QDir& index_dir, QVariant& mod_id) -> ModStruct
|
||||
inline ModStruct get(const QDir& index_dir, QVariant& mod_id)
|
||||
{
|
||||
return Packwiz::V1::getIndexForMod(index_dir, mod_id);
|
||||
}
|
||||
|
||||
inline auto modSideToString(ModSide side) -> QString
|
||||
{
|
||||
return Packwiz::V1::sideToString(side);
|
||||
}
|
||||
|
||||
}; // namespace Metadata
|
||||
|
||||
@@ -179,9 +179,9 @@ auto Mod::loaders() const -> QString
|
||||
auto Mod::side() const -> QString
|
||||
{
|
||||
if (metadata())
|
||||
return Metadata::modSideToString(metadata()->side);
|
||||
return ModPlatform::SideUtils::toString(metadata()->side);
|
||||
|
||||
return Metadata::modSideToString(Metadata::ModSide::UniversalSide);
|
||||
return ModPlatform::SideUtils::toString(ModPlatform::Side::UniversalSide);
|
||||
}
|
||||
|
||||
auto Mod::mcVersions() const -> QString
|
||||
|
||||
Reference in New Issue
Block a user