refactor: move more common code to base class
Also removes unused imports and organize the ModModel header
This commit is contained in:
@ -1,39 +1,25 @@
|
||||
#pragma once
|
||||
|
||||
#include <RWStorage.h>
|
||||
|
||||
#include <QIcon>
|
||||
#include <QList>
|
||||
#include <QMetaType>
|
||||
#include <QSortFilterProxyModel>
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
#include <QStyledItemDelegate>
|
||||
#include <QThreadPool>
|
||||
|
||||
#include <net/NetJob.h>
|
||||
#include <functional>
|
||||
|
||||
#include "BaseInstance.h"
|
||||
#include "FlameModPage.h"
|
||||
#include "modplatform/flame/FlameModIndex.h"
|
||||
|
||||
namespace FlameMod {
|
||||
|
||||
typedef std::function<void(QString)> LogoCallback;
|
||||
|
||||
class ListModel : public ModPlatform::ListModel {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ListModel(FlameModPage* parent);
|
||||
virtual ~ListModel();
|
||||
|
||||
private slots:
|
||||
void searchRequestFinished(QJsonDocument& doc) override;
|
||||
ListModel(FlameModPage* parent) : ModPlatform::ListModel(parent) {}
|
||||
;
|
||||
virtual ~ListModel() = default;
|
||||
|
||||
private:
|
||||
const char** getSorts() const override;
|
||||
void loadIndexedPack(ModPlatform::IndexedPack& m, QJsonObject& obj) override { FlameMod::loadIndexedPack(m, obj); };
|
||||
|
||||
QJsonArray documentToArray(QJsonDocument& obj) const override { return obj.array(); };
|
||||
|
||||
static const char* sorts[6];
|
||||
const char** getSorts() const override { return sorts; };
|
||||
};
|
||||
|
||||
} // namespace Modrinth
|
||||
} // namespace FlameMod
|
||||
|
Reference in New Issue
Block a user