PrismLauncher/launcher/ui/pages/modplatform/modrinth/ModrinthModel.h

25 lines
674 B
C
Raw Normal View History

2022-01-14 08:43:42 +00:00
#pragma once
2022-01-15 07:51:47 +00:00
#include "ModrinthPage.h"
#include "modplatform/modrinth/ModrinthPackIndex.h"
2022-01-14 08:43:42 +00:00
namespace Modrinth {
class ListModel : public ModPlatform::ListModel {
2022-01-14 08:43:42 +00:00
Q_OBJECT
public:
ListModel(ModrinthPage* parent) : ModPlatform::ListModel(parent){};
virtual ~ListModel() = default;
private:
void loadIndexedPack(ModPlatform::IndexedPack& m, QJsonObject& obj) override { Modrinth::loadIndexedPack(m, obj); };
QJsonArray documentToArray(QJsonDocument& obj) const override { return obj.object().value("hits").toArray(); };
static const char* sorts[5];
const char** getSorts() const override { return sorts; };
2022-01-14 08:43:42 +00:00
};
} // namespace Modrinth