Set correct image attributes on directory thumbnail
Needs RevisionPublic

Authored by broulik on Sep 26 2018, 9:59 AM.

Details

Summary

Otherwise PreviewJob will refuse to re-use cache files generated by the directory thumbnailer.

Test Plan

Noticed that when I had a folder with a PDF in it (which takes a while to generate) that despite the folder thumbnails having generated a cache file, it would not use it when I entered the directory and instead recreate it again.

With this patch the thumbnails generated by the folder thumbnailer are accepted and previews when entering a folder with few files for the first time is noticeably faster. It doesn't change perception a lot when there are many files.

I don't have access to the plugin there so I don't add the version information to it. Not sure this could be a problem? It's a bit annoying that thumbnailer KIO duplicates so much code from the preview job already :/

Diff Detail

Repository
R320 KIO Extras
Lint
Lint Skipped
Unit
Unit Tests Skipped
broulik created this revision.Sep 26 2018, 9:59 AM
Restricted Application added projects: Dolphin, Frameworks. · View Herald TranscriptSep 26 2018, 9:59 AM
Restricted Application added subscribers: kfm-devel, kde-frameworks-devel. · View Herald Transcript
broulik requested review of this revision.Sep 26 2018, 9:59 AM

+1 from me too.

What happen to this? Put it to 19.04 for testing.

ngraham accepted this revision.Mar 22 2019, 2:20 PM
This revision is now accepted and ready to land.Mar 22 2019, 2:20 PM
dfaure requested changes to this revision.Dec 13 2019, 9:10 PM
dfaure added inline comments.
thumbnail/thumbnail.cpp
730

For local files, QFileInfo would be more straightforward, no?

You'd just use lastModified() on line 735 and size() on line 736.

KFileItem is mostly meant to encapsulate kioslave listDir/stat results.

This revision now requires changes to proceed.Dec 13 2019, 9:10 PM