Use hashes of URLs for filenames, due to length constraints

This commit is contained in:
Brad Davis 2017-02-23 22:01:53 -08:00
parent 61e341db75
commit 594fe9b1be

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;