refactor: move things around so that related things are close together

This also adds some comments around ModModel.cpp and ModPage.cpp to add
some ease of reading the code.

Also move some things from headers to cpp files.
This commit is contained in:
flow
2022-03-07 19:29:59 -03:00
parent b131d3b2ec
commit 9c57b54a81
12 changed files with 200 additions and 165 deletions

View File

@ -36,6 +36,9 @@ class ListModel : public QAbstractListModel {
void searchWithTerm(const QString& term, const int sort);
void requestModVersions(const ModPlatform::IndexedPack& current);
virtual void loadIndexedPack(ModPlatform::IndexedPack& m, QJsonObject& obj) = 0;
virtual void loadIndexedPackVersions(ModPlatform::IndexedPack& m, QJsonArray& arr) = 0;
void getLogo(const QString& logo, const QString& logoUrl, LogoCallback callback);
inline bool canFetchMore(const QModelIndex& parent) const override { return searchState == CanPossiblyFetchMore; };
@ -54,7 +57,6 @@ class ListModel : public QAbstractListModel {
void performPaginatedSearch();
protected:
virtual void loadIndexedPack(ModPlatform::IndexedPack& m, QJsonObject& obj) = 0;
virtual QJsonArray documentToArray(QJsonDocument& obj) const = 0;
virtual const char** getSorts() const = 0;