diff options
author | flow <flowlnlnln@gmail.com> | 2022-11-14 14:15:46 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-14 14:15:46 -0800 |
commit | fece9e207bdae16574f450593346e80f50702b00 (patch) | |
tree | 030dd7d9d47fe1dc47e76059f612e89004146836 /launcher/ui/pages/modplatform/modrinth | |
parent | f60b09568c503fc52204ad3411d8ae0091d4877b (diff) | |
parent | aef5349aee82922fb7cedab7489bc84766453700 (diff) | |
download | PrismLauncher-fece9e207bdae16574f450593346e80f50702b00.tar.gz PrismLauncher-fece9e207bdae16574f450593346e80f50702b00.tar.bz2 PrismLauncher-fece9e207bdae16574f450593346e80f50702b00.zip |
Merge pull request #448 from TheLastRar/fixup-warnings
Diffstat (limited to 'launcher/ui/pages/modplatform/modrinth')
-rw-r--r-- | launcher/ui/pages/modplatform/modrinth/ModrinthModel.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/launcher/ui/pages/modplatform/modrinth/ModrinthModel.h b/launcher/ui/pages/modplatform/modrinth/ModrinthModel.h index 6f33e11e..3be377a1 100644 --- a/launcher/ui/pages/modplatform/modrinth/ModrinthModel.h +++ b/launcher/ui/pages/modplatform/modrinth/ModrinthModel.h @@ -55,8 +55,8 @@ class ModpackListModel : public QAbstractListModel { ModpackListModel(ModrinthPage* parent); ~ModpackListModel() override = default; - inline auto rowCount(const QModelIndex& parent) const -> int override { return modpacks.size(); }; - inline auto columnCount(const QModelIndex& parent) const -> int override { return 1; }; + inline auto rowCount(const QModelIndex& parent) const -> int override { return parent.isValid() ? 0 : modpacks.size(); }; + inline auto columnCount(const QModelIndex& parent) const -> int override { return parent.isValid() ? 0 : 1; }; inline auto flags(const QModelIndex& index) const -> Qt::ItemFlags override { return QAbstractListModel::flags(index); }; auto debugName() const -> QString; @@ -74,7 +74,7 @@ class ModpackListModel : public QAbstractListModel { void getLogo(const QString& logo, const QString& logoUrl, LogoCallback callback); - inline auto canFetchMore(const QModelIndex& parent) const -> bool override { return searchState == CanPossiblyFetchMore; }; + inline auto canFetchMore(const QModelIndex& parent) const -> bool override { return parent.isValid() ? false : searchState == CanPossiblyFetchMore; }; public slots: void searchRequestFinished(QJsonDocument& doc_all); |