[Thumbnails] Paint larger "one thumbnail" tile only when needed
ClosedPublic

Authored by broulik on Sep 10 2018, 11:41 AM.

Details

Summary

When there is only one thumbnail it is painted larger. This pixmap is always generated, even if we ended up creating more than one thumbnail.
This patch makes it remember the first valid thumbnail and paints the larger pixmap only as needed.

Test Plan

Thumbnails of folders with no, one, or multiple previews are still rendered correctly.
Saves up to 1 second generating the thumbnails here, however, I didn't really notice a huge impact in real world testing

Diff Detail

Repository
R320 KIO Extras
Lint
Lint Skipped
Unit
Unit Tests Skipped
broulik requested review of this revision.Sep 10 2018, 11:41 AM
broulik created this revision.
broulik updated this revision to Diff 41381.Sep 11 2018, 9:44 AM
  • Create QImage and QPainter also on-demand
broulik updated this revision to Diff 41382.Sep 11 2018, 10:00 AM
  • Use already existing hadFirstThumbnail variable
Restricted Application added projects: Dolphin, Frameworks. · View Herald TranscriptSep 25 2018, 8:38 AM
Restricted Application added subscribers: kfm-devel, kde-frameworks-devel. · View Herald Transcript
ngraham accepted this revision.Sep 25 2018, 4:09 PM

Seems fine to me. Code looks sane and behavior appears to be unchanged. Maybe faster, but that might just be confirmation bias talking. :)

This revision is now accepted and ready to land.Sep 25 2018, 4:09 PM
This revision was automatically updated to reflect the committed changes.