diff --git a/src/libdanbooru/danbooruservice.cpp b/src/libdanbooru/danbooruservice.cpp index afe6a62..d298fcb 100644 --- a/src/libdanbooru/danbooruservice.cpp +++ b/src/libdanbooru/danbooruservice.cpp @@ -523,6 +523,21 @@ void DanbooruService::setBlacklist(const QSet< QString > &blacklist) } +void DanbooruService::setBlacklist(const QStringList &blacklist) +{ + + if (blacklist.isEmpty()) { + return; + } + + m_blacklist.clear(); + + for (auto element : blacklist) { + m_blacklist.insert(element); + } + +} + void DanbooruService::setBoardUrl(const QUrl& url) { m_url = url; diff --git a/src/libdanbooru/danbooruservice.h b/src/libdanbooru/danbooruservice.h index b06722e..6d764a2 100644 --- a/src/libdanbooru/danbooruservice.h +++ b/src/libdanbooru/danbooruservice.h @@ -198,7 +198,7 @@ public: **/ int maxPosts() const; - void nextPostPage(); + Q_INVOKABLE void nextPostPage(); QStringList postTags() const; @@ -210,7 +210,16 @@ public: * @param blacklist A QSet including unwanted tags. * @return void */ - void setBlacklist(const QSet &blacklist); + void setBlacklist(const QStringList& blacklist); + + /** + * @brief Set the tag blacklist. + * + * If a tag is in the blacklist, posts tagged with it will not be downloaded. + * + **/ + + void setBlacklist(const QSet& blacklist); /** * @brief Set the maximum allowed rating for the board. @@ -221,13 +230,7 @@ public: **/ void setMaximumAllowedRating(DanbooruPost::Rating rating); - /** - * @brief Set the tag blacklist. - * - * If a tag is in the blacklist, posts tagged with it will not be downloaded. - * - **/ - void setBlackList(QStringList blacklist); + /**