2022-01-14 08:43:42 +00:00
|
|
|
#pragma once
|
|
|
|
|
2022-01-15 07:51:47 +00:00
|
|
|
#include "ModrinthPage.h"
|
2022-03-03 00:17:10 +00:00
|
|
|
#include "modplatform/modrinth/ModrinthPackIndex.h"
|
2022-01-14 08:43:42 +00:00
|
|
|
|
|
|
|
namespace Modrinth {
|
|
|
|
|
2022-03-03 00:17:10 +00:00
|
|
|
class ListModel : public ModPlatform::ListModel {
|
2022-01-14 08:43:42 +00:00
|
|
|
Q_OBJECT
|
|
|
|
|
2022-03-03 00:17:10 +00:00
|
|
|
public:
|
2022-03-07 20:46:18 +00:00
|
|
|
ListModel(ModrinthPage* parent) : ModPlatform::ListModel(parent){};
|
|
|
|
virtual ~ListModel() = default;
|
2022-03-03 02:01:23 +00:00
|
|
|
|
|
|
|
private:
|
2022-03-07 20:46:18 +00:00
|
|
|
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
|
|
|
};
|
|
|
|
|
2022-03-03 00:17:10 +00:00
|
|
|
} // namespace Modrinth
|