Dive pictures: turn SHashedImage class into getHashedImage() function

SHashedImage was a subclass of QImage, which fetched the image according
to the filename hashes. Turn this into a function, as this is much more
idiomatic and flexible.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2018-03-04 16:40:06 +01:00 committed by Dirk Hohndel
parent 630862971f
commit 5d372cfda3
3 changed files with 14 additions and 22 deletions

View file

@ -65,7 +65,7 @@ static void scaleImages(PictureEntry &entry, int maxSize)
// Rescale in such a case to avoid resizing artifacts.
if (thumbnail.isNull() || (thumbnail.size().width() < maxSize && thumbnail.size().height() < maxSize)) {
qDebug() << "No thumbnail in cache for" << entry.filename;
thumbnail = SHashedImage(entry.picture).scaled(maxSize, maxSize, Qt::KeepAspectRatio);
thumbnail = getHashedImage(entry.picture).scaled(maxSize, maxSize, Qt::KeepAspectRatio);
addThumbnailToCache(thumbnail, entry);
}