From feded2bdf3a425936a7bc0eccdf17fde072c9fc0 Mon Sep 17 00:00:00 2001 From: Luca Beltrame Date: Sun, 1 Mar 2015 22:34:14 +0100 Subject: [PATCH] Allow getting pool pages as well as posts Currently this clashes, meaning that there will be problems if you get pools and then posts... --- src/libdanbooru/danbooruservice.cpp | 10 +++++++++- src/libdanbooru/danbooruservice.h | 29 +++++++++++++++++------------ 2 files changed, 26 insertions(+), 13 deletions(-) diff --git a/src/libdanbooru/danbooruservice.cpp b/src/libdanbooru/danbooruservice.cpp index d956f1e..f2ba59f 100644 --- a/src/libdanbooru/danbooruservice.cpp +++ b/src/libdanbooru/danbooruservice.cpp @@ -317,7 +317,8 @@ const QStringList DanbooruService::allowedRatings() const } -int DanbooruService::currentPage() const { +int DanbooruService::currentPage() const +{ return m_currentPage; } @@ -340,6 +341,13 @@ void DanbooruService::nextPostPage() getPostList(); } +void DanbooruService::nextPoolPage() +{ + m_currentPage++; + getPoolList(); +} + + QStringList DanbooruService::postTags() const { return m_tags; diff --git a/src/libdanbooru/danbooruservice.h b/src/libdanbooru/danbooruservice.h index 7cce6ae..1b9bd3b 100644 --- a/src/libdanbooru/danbooruservice.h +++ b/src/libdanbooru/danbooruservice.h @@ -194,19 +194,24 @@ public: **/ int maxPosts() const; - /** * @brief Fetches the next page of posts. - * - * @return void - */ + **/ Q_INVOKABLE void nextPostPage(); + /** + * @brief Fetches the next page of pools. + **/ + Q_INVOKABLE void nextPoolPage(); + /** * @return A QStringList containing the currently-selected tags - */ + **/ QStringList postTags() const; + /** + * @brief Resets the service to the default state, clearing the page counters. + **/ void reset(); /** @@ -215,8 +220,8 @@ public: * Posts with blacklisted tags are not downloaded. * * @param blacklist A QSet including unwanted tags. - * @return void - */ + * + **/ void setBlacklist(const QStringList& blacklist); /** @@ -257,8 +262,8 @@ public: * @brief Set username for login. * * @param username The username to use. - * @return void - */ + * + **/ void setUserName(const QString& username); /** @@ -268,9 +273,9 @@ public: * with a specific salt (which is board-dependent; check their * API access rules). * - * @param username The salted password to use. - * @return void - */ + * @param password The salted password to use. + * + **/ void setPassword(const QString& password); void setMaxPosts(int number);