diff options
author | Andrea Di Menna <ninniuz@gmail.com> | 2011-10-03 15:44:38 +0200 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2011-10-03 15:44:38 +0200 |
commit | 1e8c15e2bd291888f5330771901ff58b4039d559 (patch) | |
tree | fedac163d34de9fafa322d2f2c44487414cd9705 /src | |
parent | Get sure private browing action is disabled if users refuse it (diff) | |
download | rekonq-1e8c15e2bd291888f5330771901ff58b4039d559.tar.xz |
Improve the mechanism of thumnbs file names generation
We are now using an md5 hash instead of base64 strings. Please, read
review 102760 description about.
REVIEW: 102760
REVIEWED-BY: adjam
Diffstat (limited to 'src')
-rw-r--r-- | src/websnap.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/websnap.cpp b/src/websnap.cpp index d041156e..f8b57d70 100644 --- a/src/websnap.cpp +++ b/src/websnap.cpp @@ -40,6 +40,8 @@ #include <QtCore/QSize> #include <QtCore/QFile> +#include <QCryptographicHash> + #include <QtGui/QPainter> #include <QtGui/QAction> @@ -138,7 +140,9 @@ QString WebSnap::imagePathFromUrl(const KUrl &url) QUrl temp = QUrl(url.url()); QByteArray name = temp.toEncoded(QUrl::RemoveScheme | QUrl::RemoveUserInfo | QUrl::StripTrailingSlash); - return KStandardDirs::locateLocal("cache", QString("thumbs/") + name.toBase64() + ".png", true); + QByteArray hashedName = QCryptographicHash::hash(name, QCryptographicHash::Md5).toHex(); + + return KStandardDirs::locateLocal("cache", QString("thumbs/") + hashedName + ".png", true); } |