summaryrefslogtreecommitdiffstats
path: root/core/qthelper.cpp
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2018-02-18 14:07:15 +0100
committerGravatar Lubomir I. Ivanov <neolit123@gmail.com>2018-03-05 18:04:57 +0200
commitb750a48f0f834dcf33fc2518c877f498f3b3cff5 (patch)
tree9d71fdb457cf78fb2ef3569a9801c89612460324 /core/qthelper.cpp
parent83b287064896de96d8757c604c276f7521b714b8 (diff)
downloadsubsurface-b750a48f0f834dcf33fc2518c877f498f3b3cff5.tar.gz
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>
Diffstat (limited to 'core/qthelper.cpp')
-rw-r--r--core/qthelper.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/core/qthelper.cpp b/core/qthelper.cpp
index e7bf7dcf4..0029ca13a 100644
--- a/core/qthelper.cpp
+++ b/core/qthelper.cpp
@@ -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)