Cleanup: remove updateHash() function

updateHash() and hashPicture() did the same thing, with the exception
that hashPicture() marked the dive list as changed if a hash changed.
This seems like a good idea in any case, therefore always use
hashPicture().

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2018-02-17 12:21:13 +01:00 committed by Lubomir I. Ivanov
parent f8835751dc
commit a0d02bacf3
2 changed files with 1 additions and 10 deletions

View file

@ -120,7 +120,7 @@ SHashedImage::SHashedImage(struct picture *picture) : QImage()
load(filename);
if (!isNull()) {
// Make sure the hash still matches the image file
QtConcurrent::run(updateHash, clone_picture(picture));
QtConcurrent::run(hashPicture, clone_picture(picture));
} else {
// Interpret filename as URL
QtConcurrent::run(loadPicture, clone_picture(picture), false);

View file

@ -1185,15 +1185,6 @@ QString fileFromHash(const char *hash)
return localFilenameOf[QByteArray::fromHex(hash)];
}
// This needs to operate on a copy of picture as it frees it after finishing!
void updateHash(struct picture *picture) {
if (!picture)
return;
QByteArray hash = hashFile(fileFromHash(picture->hash));
learnHash(picture, hash);
picture_free(picture);
}
// This needs to operate on a copy of picture as it frees it after finishing!
void hashPicture(struct picture *picture)
{