diff options
author | TheKodeToad <TheKodeToad@proton.me> | 2023-08-31 14:58:54 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-31 14:58:54 +0100 |
commit | 25ce11d85d1aa9060e9df335a63f3de5e61c7f6b (patch) | |
tree | e273257fef10a5dac301f8db5f2fcfd70f57c72f /launcher/ui/pages/modplatform/modrinth/ModrinthModel.h | |
parent | b83fdbd1b752acdf555fb90d397ff61ddb896f2c (diff) | |
parent | 8c607ae7348206c29a8a8ce5e2db421138bd89ff (diff) | |
download | PrismLauncher-25ce11d85d1aa9060e9df335a63f3de5e61c7f6b.tar.gz PrismLauncher-25ce11d85d1aa9060e9df335a63f3de5e61c7f6b.tar.bz2 PrismLauncher-25ce11d85d1aa9060e9df335a63f3de5e61c7f6b.zip |
Merge pull request #1539 from Trial97/refactor_modpack_ux
Improvements to modpack UX
Diffstat (limited to 'launcher/ui/pages/modplatform/modrinth/ModrinthModel.h')
-rw-r--r-- | launcher/ui/pages/modplatform/modrinth/ModrinthModel.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/launcher/ui/pages/modplatform/modrinth/ModrinthModel.h b/launcher/ui/pages/modplatform/modrinth/ModrinthModel.h index 721c69f5..2a9d6226 100644 --- a/launcher/ui/pages/modplatform/modrinth/ModrinthModel.h +++ b/launcher/ui/pages/modplatform/modrinth/ModrinthModel.h @@ -73,6 +73,9 @@ class ModpackListModel : public QAbstractListModel { void refresh(); void searchWithTerm(const QString& term, const int sort); + [[nodiscard]] bool hasActiveSearchJob() const { return jobPtr && jobPtr->isRunning(); } + [[nodiscard]] Task::Ptr activeSearchJob() { return hasActiveSearchJob() ? jobPtr : nullptr; } + void getLogo(const QString& logo, const QString& logoUrl, LogoCallback callback); inline auto canFetchMore(const QModelIndex& parent) const -> bool override @@ -83,6 +86,7 @@ class ModpackListModel : public QAbstractListModel { public slots: void searchRequestFinished(QJsonDocument& doc_all); void searchRequestFailed(QString reason); + void searchRequestForOneSucceeded(QJsonDocument&); protected slots: @@ -111,7 +115,7 @@ class ModpackListModel : public QAbstractListModel { int nextSearchOffset = 0; enum SearchState { None, CanPossiblyFetchMore, ResetRequested, Finished } searchState = None; - NetJob::Ptr jobPtr; + Task::Ptr jobPtr; std::shared_ptr<QByteArray> m_all_response = std::make_shared<QByteArray>(); QByteArray m_specific_response; |