2022-01-14 08:43:42 +00:00
|
|
|
#pragma once
|
|
|
|
|
2022-05-14 18:46:52 +01:00
|
|
|
#include "ModrinthModPage.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-05-14 18:46:52 +01:00
|
|
|
ListModel(ModrinthModPage* parent) : ModPlatform::ListModel(parent){};
|
2022-03-08 14:12:35 +00:00
|
|
|
~ListModel() override = default;
|
2022-03-03 02:01:23 +00:00
|
|
|
|
|
|
|
private:
|
2022-03-07 22:29:59 +00:00
|
|
|
void loadIndexedPack(ModPlatform::IndexedPack& m, QJsonObject& obj) override;
|
|
|
|
void loadIndexedPackVersions(ModPlatform::IndexedPack& m, QJsonArray& arr) override;
|
|
|
|
|
2022-03-08 14:12:35 +00:00
|
|
|
auto documentToArray(QJsonDocument& obj) const -> QJsonArray override;
|
2022-03-07 20:46:18 +00:00
|
|
|
|
2022-03-08 14:12:35 +00:00
|
|
|
// NOLINTNEXTLINE(modernize-avoid-c-arrays)
|
2022-03-07 20:46:18 +00:00
|
|
|
static const char* sorts[5];
|
2022-03-08 14:12:35 +00:00
|
|
|
inline auto getSorts() const -> const char** override { return sorts; };
|
2022-01-14 08:43:42 +00:00
|
|
|
};
|
|
|
|
|
2022-03-03 00:17:10 +00:00
|
|
|
} // namespace Modrinth
|