From kde-commits Sat Aug 23 14:51:45 2014 From: Maarten De Meyer Date: Sat, 23 Aug 2014 14:51:45 +0000 To: kde-commits Subject: [kio] src/widgets: Correctly save previews. Message-Id: X-MARC-Message: https://marc.info/?l=kde-commits&m=140880551429447 Git commit c49f2ad12f81883de450bf831c2206b448fa8d94 by Maarten De Meyer. Committed on 23/08/2014 at 14:13. Pushed by demeyer into branch 'master'. Correctly save previews. Save thumbnails in correct location and with a unique name. REVIEW: 119907 M +2 -2 src/widgets/previewjob.cpp http://commits.kde.org/kio/c49f2ad12f81883de450bf831c2206b448fa8d94 diff --git a/src/widgets/previewjob.cpp b/src/widgets/previewjob.cpp index c65d683..55a3fb7 100644 --- a/src/widgets/previewjob.cpp +++ b/src/widgets/previewjob.cpp @@ -83,7 +83,7 @@ public: shmaddr(0) { // http://specifications.freedesktop.org/thumbnail-spec/thumbnail-= spec-latest.html#DIRECTORY - thumbRoot =3D QStandardPaths::writableLocation(QStandardPaths::Cac= heLocation) + QLatin1String("/thumbnails/"); + thumbRoot =3D QStandardPaths::writableLocation(QStandardPaths::Gen= ericCacheLocation) + QLatin1String("/thumbnails/"); } = enum { STATE_STATORIG, // if the thumbnail exists @@ -679,7 +679,7 @@ void PreviewJobPrivate::slotThumbData(KIO::Job *, const= QByteArray &data) signature.append(" (v" + thumbnailerVersion + ')'); } thumb.setText("Software", signature); - QSaveFile saveFile(thumbPath + "kde-tmp-XXXXXX.png"); + QSaveFile saveFile(thumbPath + thumbName); if (saveFile.open(QIODevice::WriteOnly)) { if (thumb.save(&saveFile, "PNG")) { saveFile.commit();