Merge pull request #9750 from jherico/smarter_textures

Use hashes of URLs for filenames, due to length constraints
This commit is contained in:
Brad Davis 2017-02-24 08:44:52 -08:00 committed by GitHub
commit b06768d379

View file

@ -18,7 +18,7 @@
#include <QStandardPaths>
#include <QFileInfo>
#include <QDir>
#include <QCryptographicHash>
#include <Profile.h>
#include "ModelLogging.h"
@ -103,7 +103,8 @@ gpu::Texture* cacheTexture(const std::string& name, gpu::Texture* srcTexture, bo
}
});
std::string cleanedName = QUrl::toPercentEncoding(name.c_str()).toStdString();
std::string cleanedName = QCryptographicHash::hash(QUrl::toPercentEncoding(name.c_str()), QCryptographicHash::Sha1).toHex().toStdString();
std::string cacheFilename(ktxCacheFolder.toStdString());
cacheFilename += "/";
cacheFilename += cleanedName;