A few const changes

This commit is contained in:
Luca Beltrame 2018-08-24 18:24:57 +02:00
parent 372fb32bd3
commit 6ad1ff069d
Signed by: einar
GPG key ID: 8DF631FD021DB0C5

View file

@ -140,7 +140,7 @@ void MoebooruService::getPoolList(int limit)
poolList = poolList.mid(0, limit);
}
for (auto element : poolList) {
for (const QVariant element : qAsConst(poolList)) {
QVariantMap map = element.toMap();
DanbooruPool *pool = new DanbooruPool(map);
@ -263,7 +263,7 @@ void MoebooruService::getRelatedTags(const QStringList &tags,
for (iter = tagList.constBegin(); iter != tagList.constEnd(); ++iter) {
QList<QVariant> tags = iter.value().toList();
const QList<QVariant> tags = iter.value().toList();
if (tags.isEmpty()) {
continue;
@ -380,7 +380,7 @@ void MoebooruService::processPostList(KJob *job)
postList = postList.mid(0, m_maxPosts);
}
for (const auto element : postList) {
for (const QVariantMap element : qAsConst(postList)) {
DanbooruPost *post = new DanbooruPost(element);
@ -394,9 +394,9 @@ void MoebooruService::processPostList(KJob *job)
QPixmap pix;
qCDebug(LIBDANBOORU) << "About to donwload images";
qCDebug(LIBDANBOORU) << "About to download images";
if (0 && m_cache && m_cache->findPixmap(post->thumbnailUrl().url(), &pix)) {
if (m_cache && m_cache->findPixmap(post->thumbnailUrl().url(), &pix)) {
qDebug() << "reimplement";
post->setPixmap(pix);
@ -440,7 +440,7 @@ void MoebooruService::processPostList(KJob *job)
post->setPixmap(pix);
if (0 && m_cache)
if (m_cache)
{
//qCDebug(LIBDANBOORU) << "Inserting item in cache";
m_cache->insertPixmap(post->thumbnailUrl().url(), pix);