diff options
author | flow <thiagodonato300@gmail.com> | 2022-03-07 17:46:18 -0300 |
---|---|---|
committer | flow <thiagodonato300@gmail.com> | 2022-03-07 18:28:24 -0300 |
commit | b131d3b2ecbe6a9be35088d8411927bcd30de896 (patch) | |
tree | c4696b10263981845608730f00f7f7d0d175e8b4 /launcher/ui/pages/modplatform/flame/FlameModModel.h | |
parent | 16bfafa29e2cb54e1553c813cab0fff5203f8c60 (diff) | |
download | PrismLauncher-b131d3b2ecbe6a9be35088d8411927bcd30de896.tar.gz PrismLauncher-b131d3b2ecbe6a9be35088d8411927bcd30de896.tar.bz2 PrismLauncher-b131d3b2ecbe6a9be35088d8411927bcd30de896.zip |
refactor: move more common code to base class
Also removes unused imports and organize the ModModel header
Diffstat (limited to 'launcher/ui/pages/modplatform/flame/FlameModModel.h')
-rw-r--r-- | launcher/ui/pages/modplatform/flame/FlameModModel.h | 34 |
1 files changed, 10 insertions, 24 deletions
diff --git a/launcher/ui/pages/modplatform/flame/FlameModModel.h b/launcher/ui/pages/modplatform/flame/FlameModModel.h index 022ec32e..204834c9 100644 --- a/launcher/ui/pages/modplatform/flame/FlameModModel.h +++ b/launcher/ui/pages/modplatform/flame/FlameModModel.h @@ -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 |