Port to categorized logging

This commit is contained in:
Luca Beltrame 2015-03-20 00:15:04 +01:00
parent 4021ccaf23
commit 0084798a2c
13 changed files with 125 additions and 23 deletions

View file

@ -24,7 +24,7 @@
// Qt
#include <QDebug>
#include "libdanbooru_debug.h"
// KDE
@ -88,7 +88,7 @@ void DanbooruService::getPostList()
QUrl danbooruUrl = requestUrl(m_url, POST_URL, m_username,
m_password, parameters, m_tags);
// qDebug() << "Final constructed post URL" << danbooruUrl;
// qCDebug(LIBDANBOORU) << "Final constructed post URL" << danbooruUrl;
KIO::StoredTransferJob *job = KIO::storedGet(danbooruUrl, KIO::NoReload,
KIO::HideProgressInfo);
@ -113,7 +113,7 @@ void DanbooruService::getTagList(int limit, QString name)
QUrl danbooruUrl = requestUrl(m_url, TAG_URL, m_username, m_password,
parameters);
// qDebug() << "Final constructed tag URL" << danbooruUrl.url();
// qCDebug(LIBDANBOORU) << "Final constructed tag URL" << danbooruUrl.url();
KIO::StoredTransferJob *job = KIO::storedGet(danbooruUrl, KIO::NoReload,
KIO::HideProgressInfo);
@ -135,7 +135,7 @@ void DanbooruService::getPool(int poolId, int page)
QUrl danbooruUrl = requestUrl(m_url, POOL_DATA_URL, m_username,
m_password, parameters);
// qDebug() << "Final constructed pool URL" << danbooruUrl.url();
// qCDebug(LIBDANBOORU) << "Final constructed pool URL" << danbooruUrl.url();
KIO::StoredTransferJob *job = KIO::storedGet(danbooruUrl, KIO::NoReload,
KIO::HideProgressInfo);
@ -164,7 +164,7 @@ void DanbooruService::getPoolList()
m_password, map);
}
// qDebug() << "Final constructed pool list URL" << danbooruUrl.url();
// qCDebug(LIBDANBOORU) << "Final constructed pool list URL" << danbooruUrl.url();
KIO::StoredTransferJob *job = KIO::storedGet(danbooruUrl, KIO::NoReload,
KIO::HideProgressInfo);
@ -198,7 +198,7 @@ void DanbooruService::getPoolList()
Q_EMIT(poolDownloaded(pool));
}
//qDebug() << "Pool download finished!";
//qCDebug(LIBDANBOORU) << "Pool download finished!";
Q_EMIT(poolDownloadFinished());
}
@ -235,7 +235,7 @@ void DanbooruService::getRelatedTags(const QStringList &tags,
QUrl danbooruUrl = requestUrl(m_url, RELATED_TAG_URL, m_username,
m_password, parameters, tags);
// qDebug() << "Final constructed related tag URL" << danbooruUrl;
// qCDebug(LIBDANBOORU) << "Final constructed related tag URL" << danbooruUrl;
StoredTransferJob *job = KIO::storedGet(
@ -398,7 +398,7 @@ void DanbooruService::processTagList(KJob *job) {
void DanbooruService::processPostList(KJob *job)
{
// qDebug() << "Got post data OK";
// qCDebug(LIBDANBOORU) << "Got post data OK";
if (job->error()) {
Q_EMIT(downloadError(job->errorString()));
@ -451,7 +451,7 @@ void DanbooruService::processPostList(KJob *job)
QPixmap pix;
// qDebug() << "About to donwload images";
// qCDebug(LIBDANBOORU) << "About to donwload images";
if (m_cache && m_cache->findPixmap(post->thumbnailUrl().url(), &pix)) {
@ -460,7 +460,7 @@ void DanbooruService::processPostList(KJob *job)
m_postsToFetch--;
if (m_postsToFetch == 0) {
qDebug() << "Post download finished";
qCDebug(LIBDANBOORU) << "Post download finished";
Q_EMIT(postDownloadFinished());
}
@ -500,18 +500,18 @@ void DanbooruService::processPostList(KJob *job)
if (m_cache)
{
//qDebug() << "Inserting item in cache";
//qCDebug(LIBDANBOORU) << "Inserting item in cache";
m_cache->insertPixmap(post->thumbnailUrl().url(), pix);
}
m_postsToFetch--; // One less post to do
//qDebug() << "Current posts remaining" << m_currentPosts;
//qCDebug(LIBDANBOORU) << "Current posts remaining" << m_currentPosts;
Q_EMIT(postDownloaded(post));
if (m_postsToFetch == 0)
{
qDebug() << "Post download finished";
qCDebug(LIBDANBOORU) << "Post download finished";
Q_EMIT(postDownloadFinished());
}