Added missing calls to setState
This commit is contained in:
@@ -1,8 +1,9 @@
|
|||||||
#include "featuredimagesmodel.h"
|
#include "featuredimagesmodel.h"
|
||||||
#include "common/wallpapercache.h"
|
|
||||||
|
|
||||||
FeaturedImagesModel::FeaturedImagesModel(QObject *parent) : QAbstractListModel{parent}
|
FeaturedImagesModel::FeaturedImagesModel(QObject *parent) : QAbstractListModel{parent}
|
||||||
{
|
{
|
||||||
|
setState(Loading);
|
||||||
|
|
||||||
m_paginator = new FeaturedImagesPaginator(this);
|
m_paginator = new FeaturedImagesPaginator(this);
|
||||||
PaginationNotifier *notifier = static_cast<PaginationNotifier*>(m_paginator);
|
PaginationNotifier *notifier = static_cast<PaginationNotifier*>(m_paginator);
|
||||||
|
|
||||||
@@ -157,6 +158,8 @@ auto FeaturedImagesModel::resetState() -> void
|
|||||||
|
|
||||||
auto FeaturedImagesModel::resetDataModel() -> void
|
auto FeaturedImagesModel::resetDataModel() -> void
|
||||||
{
|
{
|
||||||
|
setState(Loading);
|
||||||
|
|
||||||
//invalidate previous model data
|
//invalidate previous model data
|
||||||
beginRemoveRows(QModelIndex(), 0, m_data.count());
|
beginRemoveRows(QModelIndex(), 0, m_data.count());
|
||||||
m_data.clear();
|
m_data.clear();
|
||||||
@@ -172,6 +175,8 @@ auto FeaturedImagesModel::resetDataModel() -> void
|
|||||||
}
|
}
|
||||||
|
|
||||||
endInsertRows();
|
endInsertRows();
|
||||||
|
|
||||||
|
setState(Idle);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto FeaturedImagesModel::roleNames() const -> QHash<int, QByteArray>
|
auto FeaturedImagesModel::roleNames() const -> QHash<int, QByteArray>
|
||||||
|
|||||||
@@ -3,6 +3,8 @@
|
|||||||
|
|
||||||
FeaturedVideosModel::FeaturedVideosModel(QObject *parent) : QAbstractListModel{parent}
|
FeaturedVideosModel::FeaturedVideosModel(QObject *parent) : QAbstractListModel{parent}
|
||||||
{
|
{
|
||||||
|
setState(Loading);
|
||||||
|
|
||||||
m_paginator = new FeaturedVideosPaginator(this);
|
m_paginator = new FeaturedVideosPaginator(this);
|
||||||
PaginationNotifier *notifier = static_cast<PaginationNotifier*>(m_paginator);
|
PaginationNotifier *notifier = static_cast<PaginationNotifier*>(m_paginator);
|
||||||
|
|
||||||
@@ -145,6 +147,8 @@ auto FeaturedVideosModel::resetState() -> void
|
|||||||
|
|
||||||
auto FeaturedVideosModel::resetDataModel() -> void
|
auto FeaturedVideosModel::resetDataModel() -> void
|
||||||
{
|
{
|
||||||
|
setState(Loading);
|
||||||
|
|
||||||
//invalidate previous model data
|
//invalidate previous model data
|
||||||
beginRemoveRows(QModelIndex(), 0, m_data.count());
|
beginRemoveRows(QModelIndex(), 0, m_data.count());
|
||||||
m_data.clear();
|
m_data.clear();
|
||||||
@@ -160,6 +164,8 @@ auto FeaturedVideosModel::resetDataModel() -> void
|
|||||||
}
|
}
|
||||||
|
|
||||||
endInsertRows();
|
endInsertRows();
|
||||||
|
|
||||||
|
setState(Idle);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto FeaturedVideosModel::roleNames() const -> QHash<int, QByteArray>
|
auto FeaturedVideosModel::roleNames() const -> QHash<int, QByteArray>
|
||||||
|
|||||||
@@ -3,6 +3,8 @@
|
|||||||
|
|
||||||
NewestPacksModel::NewestPacksModel(QObject *parent) : QAbstractListModel{parent}
|
NewestPacksModel::NewestPacksModel(QObject *parent) : QAbstractListModel{parent}
|
||||||
{
|
{
|
||||||
|
setState(Loading);
|
||||||
|
|
||||||
m_paginator = new NewestPacksPaginator(this);
|
m_paginator = new NewestPacksPaginator(this);
|
||||||
PaginationNotifier *notifier = static_cast<PaginationNotifier*>(m_paginator);
|
PaginationNotifier *notifier = static_cast<PaginationNotifier*>(m_paginator);
|
||||||
|
|
||||||
@@ -151,6 +153,7 @@ auto NewestPacksModel::resetState() -> void
|
|||||||
|
|
||||||
auto NewestPacksModel::resetDataModel() -> void
|
auto NewestPacksModel::resetDataModel() -> void
|
||||||
{
|
{
|
||||||
|
setState(Loading);
|
||||||
//invalidate previous model data
|
//invalidate previous model data
|
||||||
beginRemoveRows(QModelIndex(), 0, m_data.count());
|
beginRemoveRows(QModelIndex(), 0, m_data.count());
|
||||||
m_data.clear();
|
m_data.clear();
|
||||||
@@ -166,6 +169,7 @@ auto NewestPacksModel::resetDataModel() -> void
|
|||||||
}
|
}
|
||||||
|
|
||||||
endInsertRows();
|
endInsertRows();
|
||||||
|
setState(Idle);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto NewestPacksModel::roleNames() const -> QHash<int, QByteArray>
|
auto NewestPacksModel::roleNames() const -> QHash<int, QByteArray>
|
||||||
|
|||||||
Reference in New Issue
Block a user