From 7871f3a8ccf12d05bcf4eabddc2cda16363603f3 Mon Sep 17 00:00:00 2001 From: Digital Artifex <7929434+DigitalArtifex@users.noreply.github.com> Date: Wed, 17 Jun 2026 19:51:10 -0400 Subject: [PATCH] Added missing calls to setState --- KomplexHubPlugin/featuredimagesmodel.cpp | 7 ++++++- KomplexHubPlugin/featuredvideosmodel.cpp | 6 ++++++ KomplexHubPlugin/newestpacksmodel.cpp | 4 ++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/KomplexHubPlugin/featuredimagesmodel.cpp b/KomplexHubPlugin/featuredimagesmodel.cpp index 6460c34..b22df52 100644 --- a/KomplexHubPlugin/featuredimagesmodel.cpp +++ b/KomplexHubPlugin/featuredimagesmodel.cpp @@ -1,8 +1,9 @@ #include "featuredimagesmodel.h" -#include "common/wallpapercache.h" FeaturedImagesModel::FeaturedImagesModel(QObject *parent) : QAbstractListModel{parent} { + setState(Loading); + m_paginator = new FeaturedImagesPaginator(this); PaginationNotifier *notifier = static_cast(m_paginator); @@ -157,6 +158,8 @@ auto FeaturedImagesModel::resetState() -> void auto FeaturedImagesModel::resetDataModel() -> void { + setState(Loading); + //invalidate previous model data beginRemoveRows(QModelIndex(), 0, m_data.count()); m_data.clear(); @@ -172,6 +175,8 @@ auto FeaturedImagesModel::resetDataModel() -> void } endInsertRows(); + + setState(Idle); } auto FeaturedImagesModel::roleNames() const -> QHash diff --git a/KomplexHubPlugin/featuredvideosmodel.cpp b/KomplexHubPlugin/featuredvideosmodel.cpp index c4897e0..1de1be0 100644 --- a/KomplexHubPlugin/featuredvideosmodel.cpp +++ b/KomplexHubPlugin/featuredvideosmodel.cpp @@ -3,6 +3,8 @@ FeaturedVideosModel::FeaturedVideosModel(QObject *parent) : QAbstractListModel{parent} { + setState(Loading); + m_paginator = new FeaturedVideosPaginator(this); PaginationNotifier *notifier = static_cast(m_paginator); @@ -145,6 +147,8 @@ auto FeaturedVideosModel::resetState() -> void auto FeaturedVideosModel::resetDataModel() -> void { + setState(Loading); + //invalidate previous model data beginRemoveRows(QModelIndex(), 0, m_data.count()); m_data.clear(); @@ -160,6 +164,8 @@ auto FeaturedVideosModel::resetDataModel() -> void } endInsertRows(); + + setState(Idle); } auto FeaturedVideosModel::roleNames() const -> QHash diff --git a/KomplexHubPlugin/newestpacksmodel.cpp b/KomplexHubPlugin/newestpacksmodel.cpp index b05ea32..fe63cce 100644 --- a/KomplexHubPlugin/newestpacksmodel.cpp +++ b/KomplexHubPlugin/newestpacksmodel.cpp @@ -3,6 +3,8 @@ NewestPacksModel::NewestPacksModel(QObject *parent) : QAbstractListModel{parent} { + setState(Loading); + m_paginator = new NewestPacksPaginator(this); PaginationNotifier *notifier = static_cast(m_paginator); @@ -151,6 +153,7 @@ auto NewestPacksModel::resetState() -> void auto NewestPacksModel::resetDataModel() -> void { + setState(Loading); //invalidate previous model data beginRemoveRows(QModelIndex(), 0, m_data.count()); m_data.clear(); @@ -166,6 +169,7 @@ auto NewestPacksModel::resetDataModel() -> void } endInsertRows(); + setState(Idle); } auto NewestPacksModel::roleNames() const -> QHash