diff options
author | Petr Mrázek <peterix@gmail.com> | 2020-04-01 02:08:11 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2020-04-01 02:08:11 +0200 |
commit | 296ff6de96f8228ae6de8967d6e34436001b3d00 (patch) | |
tree | 24e46df82e1c7400339693f9f89a23bc1590cef4 /application/pages/modplatform/twitch/TwitchModel.h | |
parent | 5e951299b2071377bc83dc7d2bf9bd7aa9d887e5 (diff) | |
download | MultiMC-296ff6de96f8228ae6de8967d6e34436001b3d00.tar MultiMC-296ff6de96f8228ae6de8967d6e34436001b3d00.tar.gz MultiMC-296ff6de96f8228ae6de8967d6e34436001b3d00.tar.lz MultiMC-296ff6de96f8228ae6de8967d6e34436001b3d00.tar.xz MultiMC-296ff6de96f8228ae6de8967d6e34436001b3d00.zip |
NOISSUE Add pagination support to twitch pack search
Try searching for 'craft'. Now it gives ALL the results, not just
the first page of 25.
Diffstat (limited to 'application/pages/modplatform/twitch/TwitchModel.h')
-rw-r--r-- | application/pages/modplatform/twitch/TwitchModel.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/application/pages/modplatform/twitch/TwitchModel.h b/application/pages/modplatform/twitch/TwitchModel.h index 1241a079..ad355c64 100644 --- a/application/pages/modplatform/twitch/TwitchModel.h +++ b/application/pages/modplatform/twitch/TwitchModel.h @@ -36,11 +36,15 @@ public: int columnCount(const QModelIndex &parent) const override; QVariant data(const QModelIndex &index, int role) const override; Qt::ItemFlags flags(const QModelIndex &index) const override; + bool canFetchMore(const QModelIndex & parent) const override; + void fetchMore(const QModelIndex & parent) override; void getLogo(const QString &logo, const QString &logoUrl, LogoCallback callback); void searchWithTerm(const QString & term); private slots: + void performPaginatedSearch(); + void logoFailed(QString logo); void logoLoaded(QString logo, QIcon out); @@ -58,6 +62,13 @@ private: QMap<QString, LogoCallback> waitingCallbacks; QString currentSearchTerm; + int nextSearchOffset = 0; + enum SearchState { + None, + CanPossiblyFetchMore, + ResetRequested, + Finished + } searchState = None; NetJobPtr jobPtr; QByteArray response; }; |