mirror of
https://bitbucket.org/smil3y/kde-workspace.git
synced 2025-02-23 10:22:49 +00:00
kioslave: create the base thumbnail path conditionally in thumbnail slave
only when a new thumbnail is to be saved there Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
b8011feac9
commit
b1409732e6
1 changed files with 2 additions and 4 deletions
|
@ -572,8 +572,6 @@ bool ThumbnailProtocol::createSubThumbnail(QImage& thumbnail, const QString& fil
|
||||||
const QString thumbName = hash + modTime + thumbExt;
|
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 + "large/", 0700);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QString thumbPath = m_thumbBasePath;
|
QString thumbPath = m_thumbBasePath;
|
||||||
|
@ -599,9 +597,9 @@ bool ThumbnailProtocol::createSubThumbnail(QImage& thumbnail, const QString& fil
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if(savedCorrectly)
|
if (savedCorrectly) {
|
||||||
{
|
|
||||||
Q_ASSERT(!tempFileName.isEmpty());
|
Q_ASSERT(!tempFileName.isEmpty());
|
||||||
|
KStandardDirs::makeDir(thumbPath, 0700);
|
||||||
KDE::rename(tempFileName, thumbPath + thumbName);
|
KDE::rename(tempFileName, thumbPath + thumbName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue