mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
869ddc915d
commit
6b3b50cc2f
5 changed files with 107 additions and 3 deletions
|
|
@ -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]];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue