General update
This commit is contained in:
@@ -35,6 +35,7 @@
|
||||
#include <QNetworkReply>
|
||||
#include <QNetworkRequest>
|
||||
#include <QEventLoop>
|
||||
#include <QtConcurrent/QtConcurrentRun>
|
||||
|
||||
#include "paginators/featuredimagespaginator.h"
|
||||
|
||||
@@ -200,13 +201,13 @@ public:
|
||||
* @brief nextPage
|
||||
* Function for the QML frontend
|
||||
*/
|
||||
Q_INVOKABLE auto nextPage() const -> void;
|
||||
Q_INVOKABLE auto nextPage() -> void;
|
||||
|
||||
/**
|
||||
* @brief previousPage
|
||||
* Function for the QML frontend
|
||||
*/
|
||||
Q_INVOKABLE auto previousPage() const -> void;
|
||||
Q_INVOKABLE auto previousPage() -> void;
|
||||
|
||||
protected:
|
||||
/**
|
||||
@@ -226,8 +227,19 @@ protected:
|
||||
*/
|
||||
auto resetState() -> void;
|
||||
|
||||
/**
|
||||
* @brief resetDataModel
|
||||
* Clears the data model and creates a new one if data exists
|
||||
*/
|
||||
auto resetDataModel() -> void;
|
||||
|
||||
/**
|
||||
* @brief onPaginatorFetching
|
||||
* Sets current state to loading. Triggered when paginator's cache controller
|
||||
* needs to fetch data from the remote endpoint.
|
||||
*/
|
||||
auto onPaginatorFetching() -> void;
|
||||
|
||||
signals:
|
||||
auto stateChanged() -> void;
|
||||
auto errorStringChanged() -> void;
|
||||
@@ -238,6 +250,18 @@ signals:
|
||||
auto totalPagesChanged() -> void;
|
||||
|
||||
private:
|
||||
/**
|
||||
* @brief boundaryCheck
|
||||
* Helper function to check the requested index boundary
|
||||
* @param index
|
||||
* @return
|
||||
*/
|
||||
auto boundaryCheck(qsizetype index) const -> bool;
|
||||
|
||||
/**
|
||||
* @brief m_dataRoles
|
||||
* Data role map that connects ImageSearchModel::DataRole to it's QML accessor name
|
||||
*/
|
||||
static inline const QHash<int, QByteArray> m_dataRoles =
|
||||
{
|
||||
{
|
||||
@@ -299,8 +323,6 @@ private:
|
||||
|
||||
FeaturedImagesPaginator *m_paginator = nullptr;
|
||||
|
||||
mutable QList<ImageCache> m_data;
|
||||
|
||||
Q_PROPERTY(State state READ state WRITE setState RESET resetState NOTIFY stateChanged FINAL)
|
||||
Q_PROPERTY(QString errorString READ errorString WRITE setErrorString NOTIFY errorStringChanged FINAL)
|
||||
Q_PROPERTY(qsizetype resultsPerPage READ resultsPerPage WRITE setResultsPerPage NOTIFY resultsPerPageChanged FINAL)
|
||||
|
||||
Reference in New Issue
Block a user