mirror of
https://bitbucket.org/smil3y/kde-workspace.git
synced 2025-02-24 02:42:50 +00:00
kioslave: sync thumbnail name code with kdelibs
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
3cc7924be3
commit
f46cea0ed1
1 changed files with 5 additions and 1 deletions
|
@ -56,6 +56,7 @@
|
||||||
#include <config-workspace.h> // For HAVE_NICE
|
#include <config-workspace.h> // For HAVE_NICE
|
||||||
#include <kio/thumbcreator.h>
|
#include <kio/thumbcreator.h>
|
||||||
#include <kio/thumbsequencecreator.h>
|
#include <kio/thumbsequencecreator.h>
|
||||||
|
#include <kio/netaccess.h>
|
||||||
#include <kconfiggroup.h>
|
#include <kconfiggroup.h>
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
@ -593,7 +594,10 @@ bool ThumbnailProtocol::createSubThumbnail(QImage& thumbnail, const QString& fil
|
||||||
int cacheSize = 0;
|
int cacheSize = 0;
|
||||||
// NOTE: make sure the algorithm and name match those used in kdelibs/kio/kio/previewjob.cpp
|
// NOTE: make sure the algorithm and name match those used in kdelibs/kio/kio/previewjob.cpp
|
||||||
const QByteArray hash = QFile::encodeName(fileName.url()).toHex();
|
const QByteArray hash = QFile::encodeName(fileName.url()).toHex();
|
||||||
const QString thumbName = hash + thumbExt;
|
KIO::UDSEntry thumbEntry;
|
||||||
|
KIO::NetAccess::stat(fileName, thumbEntry, nullptr);
|
||||||
|
const QString modTime = QString::number(thumbEntry.numberValue(KIO::UDSEntry::UDS_MODIFICATION_TIME));
|
||||||
|
const QString thumbName = hash + modTime + thumbExt;
|
||||||
if (m_thumbBasePath.isEmpty()) {
|
if (m_thumbBasePath.isEmpty()) {
|
||||||
m_thumbBasePath = QDir::homePath() + "/.thumbnails/";
|
m_thumbBasePath = QDir::homePath() + "/.thumbnails/";
|
||||||
KStandardDirs::makeDir(m_thumbBasePath + "normal/", 0700);
|
KStandardDirs::makeDir(m_thumbBasePath + "normal/", 0700);
|
||||||
|
|
Loading…
Add table
Reference in a new issue