pollymc/launcher/ui/pages/modplatform/modrinth/ModrinthModel.cpp

25 lines
648 B
C++
Raw Normal View History

2022-01-14 14:13:42 +05:30
#include "ModrinthModel.h"
#include "modplatform/modrinth/ModrinthPackIndex.h"
2022-01-14 14:13:42 +05:30
namespace Modrinth {
const char* ListModel::sorts[5]{ "relevance", "downloads", "follows", "updated", "newest" };
void ListModel::loadIndexedPack(ModPlatform::IndexedPack& m, QJsonObject& obj)
{
Modrinth::loadIndexedPack(m, obj);
}
void ListModel::loadIndexedPackVersions(ModPlatform::IndexedPack& m, QJsonArray& arr)
{
Modrinth::loadIndexedPackVersions(m, arr, APPLICATION->network(), m_parent->m_instance);
};
QJsonArray ListModel::documentToArray(QJsonDocument& obj) const
{
return obj.object().value("hits").toArray();
}
} // namespace Modrinth