From 6b3b50cc2f8083ebbc013c1d270c1ec1d1252a23 Mon Sep 17 00:00:00 2001 From: "Robert C. Helling" Date: Mon, 2 Mar 2015 16:18:16 +0100 Subject: 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 Signed-off-by: Dirk Hohndel --- qthelper.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'qthelper.cpp') 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]]; -- cgit v1.2.3-70-g09d2