Changeset 10b8bda in subsurface


Ignore:
Timestamp:
Dec 30, 2016, 10:43:00 AM (6 months ago)
Author:
Robert C. Helling <helling@…>
Branches:
master
Children:
529a4d49
Parents:
ca13492
git-author:
Robert C. Helling <helling@…> (12/15/16 05:31:20)
git-committer:
Robert C. Helling <helling@…> (12/30/16 10:43:00)
Message:

Fix picture hashing logic for pictures on the web.

Signed-off-by: Robert C. Helling <helling@…>

Location:
core
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • core/imagedownloader.cpp

    rc2c0cb4 r10b8bda  
    101101                // Let's try to load it locally via its hash
    102102                QString filename = fileFromHash(picture->hash);
     103                if (filename.isNull())
     104                        filename = QString(picture->filename);
    103105                if (filename.isNull()) {
    104106                        // That didn't produce a local filename.
  • core/qthelper.cpp

    r27b4ef32 r10b8bda  
    10761076void learnHash(struct picture *picture, QByteArray hash)
    10771077{
     1078        if (hash.isNull())
     1079                return;
    10781080        if (picture->hash)
    10791081                free(picture->hash);
     
    11011103QString fileFromHash(char *hash)
    11021104{
     1105        if (!hash || !*hash)
     1106                return "";
    11031107        QMutexLocker locker(&hashOfMutex);
    11041108
     
    11211125                return;
    11221126        char *oldHash = copy_string(picture->hash);
    1123         learnHash(picture, hashFile(QString(picture->filename)));
     1127        learnHash(picture, hashFile(localFilePath(picture->filename)));
    11241128        if (!same_string(picture->hash, "") && !same_string(picture->hash, oldHash))
    11251129                mark_divelist_changed((true));
Note: See TracChangeset for help on using the changeset viewer.