Commit 1eeaf1a6 authored by Stefan Brüns's avatar Stefan Brüns
Browse files

Add mandatory metadata to thumbnail

According to the spec, at least Thumb::URI and Thumb::MTime are required.

KIO::PreviewJob discards any thumbnails without these and recreates
the thumbnails.
parent bf486c01
......@@ -734,6 +734,11 @@ bool ThumbnailProtocol::createSubThumbnail(QImage& thumbnail, const QString& fil
// The thumbnail has been created successfully. Store the thumbnail
// to the cache for future access.
if ( | QIODevice::Truncate)) {
QFileInfo fi(filePath);
thumbnail.setText(QStringLiteral("Thumb::URI"), QString::fromUtf8(fileUrl.toEncoded()));
thumbnail.setText(QStringLiteral("Thumb::MTime"), QString::number(fi.lastModified().toSecsSinceEpoch()));
thumbnail.setText(QStringLiteral("Thumb::Size"), QString::number(fi.size()));
savedCorrectly =, "PNG");
} else {
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment