summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Di Menna <ninniuz@gmail.com>2011-10-03 15:44:38 +0200
committerAndrea Diamantini <adjam7@gmail.com>2011-10-03 15:44:38 +0200
commit1e8c15e2bd291888f5330771901ff58b4039d559 (patch)
treefedac163d34de9fafa322d2f2c44487414cd9705
parentGet sure private browing action is disabled if users refuse it (diff)
downloadrekonq-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
-rw-r--r--src/websnap.cpp6
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);
}