mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Cleanup: Don't store hash in picture struct in learnHash()
learnHash() is called either on a local picture structure [DiveListView::loadImageFromURL()] or on a cloned picture structure [ImageDownloader::saveImage()]. In neither case the picture structure is passed to the frontend. Therefore, storing the new hash in the picture struct is not necessary. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
83b2870648
commit
b750a48f0f
3 changed files with 5 additions and 8 deletions
|
|
@ -1149,15 +1149,12 @@ QByteArray hashFile(const QString filename)
|
|||
}
|
||||
}
|
||||
|
||||
void learnHash(struct picture *picture, QByteArray hash)
|
||||
void learnHash(const struct picture *picture, QByteArray hash)
|
||||
{
|
||||
if (hash.isNull())
|
||||
return;
|
||||
if (picture->hash)
|
||||
free(picture->hash);
|
||||
QMutexLocker locker(&hashOfMutex);
|
||||
hashOf[QString(picture->filename)] = hash;
|
||||
picture->hash = strdup(hash.toHex());
|
||||
}
|
||||
|
||||
static bool haveHash(const QString &filename)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue