Use kdelibs coding style
This commit is contained in:
parent
0084798a2c
commit
d965371d23
31 changed files with 201 additions and 234 deletions
|
@ -17,7 +17,6 @@
|
|||
* along with Danbooru Client. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
// STL
|
||||
|
||||
#include <algorithm>
|
||||
|
@ -100,7 +99,6 @@ void DanbooruService::getPostList()
|
|||
|
||||
}
|
||||
|
||||
|
||||
void DanbooruService::getTagList(int limit, QString name)
|
||||
{
|
||||
QMap<QString, QString> parameters;
|
||||
|
@ -202,7 +200,7 @@ void DanbooruService::getPoolList()
|
|||
Q_EMIT(poolDownloadFinished());
|
||||
}
|
||||
|
||||
);
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
|
@ -237,7 +235,6 @@ void DanbooruService::getRelatedTags(const QStringList &tags,
|
|||
|
||||
// qCDebug(LIBDANBOORU) << "Final constructed related tag URL" << danbooruUrl;
|
||||
|
||||
|
||||
StoredTransferJob *job = KIO::storedGet(
|
||||
danbooruUrl, KIO::NoReload,
|
||||
KIO::HideProgressInfo
|
||||
|
@ -291,7 +288,6 @@ void DanbooruService::getRelatedTags(const QStringList &tags,
|
|||
|
||||
}
|
||||
|
||||
|
||||
const QSet< QString > DanbooruService::blacklist() const
|
||||
{
|
||||
return m_blacklist;
|
||||
|
@ -322,7 +318,6 @@ int DanbooruService::currentPage() const
|
|||
return m_currentPage;
|
||||
}
|
||||
|
||||
|
||||
const DanbooruPost::Ratings DanbooruService::maximumAllowedRating() const
|
||||
{
|
||||
|
||||
|
@ -347,7 +342,6 @@ void DanbooruService::nextPoolPage()
|
|||
getPoolList();
|
||||
}
|
||||
|
||||
|
||||
QStringList DanbooruService::postTags() const
|
||||
{
|
||||
return m_tags;
|
||||
|
@ -362,7 +356,8 @@ void DanbooruService::reset()
|
|||
|
||||
// Slots
|
||||
|
||||
void DanbooruService::processTagList(KJob *job) {
|
||||
void DanbooruService::processTagList(KJob *job)
|
||||
{
|
||||
|
||||
if (job->error()) {
|
||||
Q_EMIT(downloadError(job->errorString()));
|
||||
|
@ -387,7 +382,7 @@ void DanbooruService::processTagList(KJob *job) {
|
|||
QVariantMap map = element.toMap();
|
||||
DanbooruTag *tag = new DanbooruTag(map);
|
||||
|
||||
if(!tag) {
|
||||
if (!tag) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -437,7 +432,6 @@ void DanbooruService::processPostList(KJob *job)
|
|||
|
||||
for (auto element : postList) {
|
||||
|
||||
|
||||
QVariantMap map = element.toMap();
|
||||
DanbooruPost *post = new DanbooruPost(map);
|
||||
|
||||
|
@ -469,7 +463,6 @@ void DanbooruService::processPostList(KJob *job)
|
|||
StoredTransferJob *pixmapJob = KIO::storedGet(post->thumbnailUrl(),
|
||||
KIO::NoReload, KIO::HideProgressInfo);
|
||||
|
||||
|
||||
// We don't want to overload the servers, so set some rational
|
||||
// priority
|
||||
|
||||
|
@ -523,7 +516,6 @@ void DanbooruService::processPostList(KJob *job)
|
|||
|
||||
}
|
||||
|
||||
|
||||
void DanbooruService::downloadAllTags(KJob *job)
|
||||
{
|
||||
Q_UNUSED(job)
|
||||
|
@ -554,7 +546,7 @@ void DanbooruService::setBlacklist(const QStringList &blacklist)
|
|||
|
||||
}
|
||||
|
||||
void DanbooruService::setBoardUrl(const QUrl& url)
|
||||
void DanbooruService::setBoardUrl(const QUrl &url)
|
||||
{
|
||||
m_url = url;
|
||||
}
|
||||
|
@ -579,7 +571,7 @@ void DanbooruService::setMaximumAllowedRating(DanbooruPost::Rating rating)
|
|||
|
||||
}
|
||||
|
||||
void DanbooruService::setUserName(const QString& username)
|
||||
void DanbooruService::setUserName(const QString &username)
|
||||
{
|
||||
if (username.isEmpty()) {
|
||||
return;
|
||||
|
@ -587,34 +579,36 @@ void DanbooruService::setUserName(const QString& username)
|
|||
m_username = username;
|
||||
}
|
||||
|
||||
void DanbooruService::setPassword(const QString& password)
|
||||
void DanbooruService::setPassword(const QString &password)
|
||||
{
|
||||
if(password.isEmpty()) {
|
||||
if (password.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
m_password = password;
|
||||
}
|
||||
|
||||
void DanbooruService::setPostTags(const QStringList& tags)
|
||||
void DanbooruService::setPostTags(const QStringList &tags)
|
||||
{
|
||||
if (!tags.isEmpty()) {
|
||||
m_tags = tags;
|
||||
}
|
||||
}
|
||||
|
||||
void DanbooruService::setImageCache(KImageCache* cache)
|
||||
void DanbooruService::setImageCache(KImageCache *cache)
|
||||
{
|
||||
m_cache = cache;
|
||||
}
|
||||
|
||||
void DanbooruService::setMaxPosts(int number) {
|
||||
void DanbooruService::setMaxPosts(int number)
|
||||
{
|
||||
|
||||
m_maxPosts = number < 100 ? number : 100;
|
||||
|
||||
}
|
||||
|
||||
void DanbooruService::setCurrentPage(int page) {
|
||||
void DanbooruService::setCurrentPage(int page)
|
||||
{
|
||||
m_currentPage = page;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue