summaryrefslogtreecommitdiffstats
path: root/qthelper.cpp
diff options
context:
space:
mode:
authorGravatar Robert C. Helling <helling@atdotde.de>2015-03-02 16:18:16 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-03-16 12:42:36 -0700
commit6b3b50cc2f8083ebbc013c1d270c1ec1d1252a23 (patch)
tree634abaf36f1908b24f6128c1c02c31b3eba6360e /qthelper.cpp
parent869ddc915daf4616ee2e010ab06fa7802b7e6d5f (diff)
downloadsubsurface-6b3b50cc2f8083ebbc013c1d270c1ec1d1252a23.tar.gz
Load remote images
When loading an image by filename and by hash fails, try to interpret the filename as URL and download the image. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qthelper.cpp')
-rw-r--r--qthelper.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/qthelper.cpp b/qthelper.cpp
index 6b2f76eba..8ca15f7aa 100644
--- a/qthelper.cpp
+++ b/qthelper.cpp
@@ -850,6 +850,13 @@ QByteArray hashFile(const QString filename)
return hash.result();
}
+void learnHash(struct picture *picture, QByteArray hash)
+{
+ free(picture->hash);
+ hashOf[QString(picture->filename)] = hash;
+ picture->hash = strdup(hash.toHex());
+}
+
QString localFilePath(const QString originalFilename)
{
return localFilenameOf[hashOf[originalFilename]];