Allow getting pool pages as well as posts
Currently this clashes, meaning that there will be problems if you get pools and then posts...
This commit is contained in:
		
					parent
					
						
							
								786c8d1f44
							
						
					
				
			
			
				commit
				
					
						feded2bdf3
					
				
			
		
					 2 changed files with 26 additions and 13 deletions
				
			
		| 
						 | 
					@ -317,7 +317,8 @@ const QStringList DanbooruService::allowedRatings() const
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int DanbooruService::currentPage() const {
 | 
					int DanbooruService::currentPage() const
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
    return m_currentPage;
 | 
					    return m_currentPage;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -340,6 +341,13 @@ void DanbooruService::nextPostPage()
 | 
				
			||||||
    getPostList();
 | 
					    getPostList();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void DanbooruService::nextPoolPage()
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    m_currentPage++;
 | 
				
			||||||
 | 
					    getPoolList();
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
QStringList DanbooruService::postTags() const
 | 
					QStringList DanbooruService::postTags() const
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    return m_tags;
 | 
					    return m_tags;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -194,19 +194,24 @@ public:
 | 
				
			||||||
     **/
 | 
					     **/
 | 
				
			||||||
    int maxPosts() const;
 | 
					    int maxPosts() const;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * @brief Fetches the next page of posts.
 | 
					     * @brief Fetches the next page of posts.
 | 
				
			||||||
     *
 | 
					     **/
 | 
				
			||||||
     * @return void
 | 
					 | 
				
			||||||
     */
 | 
					 | 
				
			||||||
    Q_INVOKABLE void nextPostPage();
 | 
					    Q_INVOKABLE void nextPostPage();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * @brief Fetches the next page of pools.
 | 
				
			||||||
 | 
					     **/
 | 
				
			||||||
 | 
					    Q_INVOKABLE void nextPoolPage();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * @return A QStringList containing the currently-selected tags
 | 
					     * @return A QStringList containing the currently-selected tags
 | 
				
			||||||
     */
 | 
					     **/
 | 
				
			||||||
    QStringList postTags() const;
 | 
					    QStringList postTags() const;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * @brief Resets the service to the default state, clearing the page counters.
 | 
				
			||||||
 | 
					     **/
 | 
				
			||||||
    void reset();
 | 
					    void reset();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
| 
						 | 
					@ -215,8 +220,8 @@ public:
 | 
				
			||||||
     * Posts with blacklisted tags are not downloaded.
 | 
					     * Posts with blacklisted tags are not downloaded.
 | 
				
			||||||
     *
 | 
					     *
 | 
				
			||||||
     * @param blacklist A QSet<QString> including unwanted tags.
 | 
					     * @param blacklist A QSet<QString> including unwanted tags.
 | 
				
			||||||
     * @return void
 | 
					     *
 | 
				
			||||||
     */
 | 
					     **/
 | 
				
			||||||
    void setBlacklist(const QStringList& blacklist);
 | 
					    void setBlacklist(const QStringList& blacklist);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
     /**
 | 
					     /**
 | 
				
			||||||
| 
						 | 
					@ -257,8 +262,8 @@ public:
 | 
				
			||||||
     * @brief Set username for login.
 | 
					     * @brief Set username for login.
 | 
				
			||||||
     *
 | 
					     *
 | 
				
			||||||
     * @param username The username to use.
 | 
					     * @param username The username to use.
 | 
				
			||||||
     * @return void
 | 
					     *
 | 
				
			||||||
     */
 | 
					     **/
 | 
				
			||||||
    void setUserName(const QString& username);
 | 
					    void setUserName(const QString& username);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
| 
						 | 
					@ -268,9 +273,9 @@ public:
 | 
				
			||||||
     * with a specific salt (which is board-dependent; check their
 | 
					     * with a specific salt (which is board-dependent; check their
 | 
				
			||||||
     * API access rules).
 | 
					     * API access rules).
 | 
				
			||||||
     *
 | 
					     *
 | 
				
			||||||
     * @param username The salted password to use.
 | 
					     * @param password The salted password to use.
 | 
				
			||||||
     * @return void
 | 
					     *
 | 
				
			||||||
     */
 | 
					     **/
 | 
				
			||||||
    void setPassword(const QString& password);
 | 
					    void setPassword(const QString& password);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    void setMaxPosts(int number);
 | 
					    void setMaxPosts(int number);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue