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

[Thumbnail] Skip potentially slow thumb generation for symlinks

The calling code in kio already checks if the directory itself is on a
slow (e.g. network) filesystem, but following symlinks inside it subverts
this check.

Skipping thumbnails has the effect of prefering plain files instead of
symlinks. This still gives a good approximation of the directory contents
(and even a better one if the symlinks point to files in the same
directory, as duplicates are avoided).
parent bdf9ddc7
......@@ -491,6 +491,14 @@ QImage ThumbnailProtocol::thumbForDirectory(const QString& directory);
if (dir.fileInfo().isSymbolicLink()) {
// Skip symbolic links, as these may point to e.g. network file
// systems or other slow storage. The calling code already
// checks for the directory itself, and if it is fine any
// contained plain file is fine as well.
auto fileSize = dir.fileInfo().size();
if ((fileSize == 0) || (fileSize > m_maxFileSize)) {
// don't create thumbnails for files that exceed
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