mirror of
https://bitbucket.org/smil3y/kde-workspace.git
synced 2025-02-23 18:32:50 +00:00
kioslave: use SHA1 algorithm for thumbnail name
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
0033503f4f
commit
3bed258dbf
1 changed files with 3 additions and 2 deletions
|
@ -715,8 +715,9 @@ bool ThumbnailProtocol::createSubThumbnail(QImage& thumbnail, const QString& fil
|
|||
// check whether a cached version of the file is available for
|
||||
// 128 x 128 or 256 x 256 pixels
|
||||
int cacheSize = 0;
|
||||
QByteArray md5 = QCryptographicHash::hash(QFile::encodeName(fileName.url()), QCryptographicHash::Md5);
|
||||
const QString thumbName = QFile::encodeName(md5.toHex()) + QLatin1String(".png");
|
||||
// NOTE: make sure the algorithm matches the one used in kdelibs/kio/kio/previewjob.cpp
|
||||
const QByteArray hash = QCryptographicHash::hash(QFile::encodeName(fileName.url()), QCryptographicHash::Sha1);
|
||||
const QString thumbName = QFile::encodeName(hash.toHex()) + QLatin1String(".png");
|
||||
if (m_thumbBasePath.isEmpty()) {
|
||||
m_thumbBasePath = QDir::homePath() + "/.thumbnails/";
|
||||
KStandardDirs::makeDir(m_thumbBasePath + "normal/", 0700);
|
||||
|
|
Loading…
Add table
Reference in a new issue