RFC: [Folder View] Use fallback icon if failed to load
AbandonedPublic

Authored by broulik on Mar 2 2017, 4:02 PM.

Details

Reviewers
hein
Group Reviewers
Plasma
Summary

When an icon failed to load, show the "unknown" icon instead of a gap.
We don't want to check for icon availability in the model for performance reasons but only once the delegate is created (when it comes into view).

Test Plan

GridView doesn't recycle items, so when the item goes out of view and comes back, it will essentially re-evaluate this.
Downside, if we failed to load an icon but have a previewer, we won't show the preview now. I don't think that's a common scenario - how come we can have a previewer for a format that is so exotic that we don't even have an icon for it?

Situations for when this can happen:

  • .desktop file with rubbish Icon or not installed icon
  • icon for mimetype for which we don't have an icon (some exotic mimetypes, kio iirc always sets icon name to one deduced from the mime type)

Diff Detail

Repository
R119 Plasma Desktop
Lint
Lint Skipped
Unit
Unit Tests Skipped
broulik created this revision.Mar 2 2017, 4:02 PM
Restricted Application added a project: Plasma. · View Herald TranscriptMar 2 2017, 4:02 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
hein edited edge metadata.Mar 2 2017, 4:29 PM

Should this be in IconItem instead? Q_PROPERTY(QString fallbackSource), etc.

mart added a subscriber: mart.Mar 2 2017, 4:33 PM
In D4900#91982, @hein wrote:

Should this be in IconItem instead? Q_PROPERTY(QString fallbackSource), etc.

you mean a second icon name for when loading the main one failed?

hein added a comment.Mar 2 2017, 4:55 PM

Yep, then the view caring about complexity like "GridView doesn't recycle items, so when the item goes out of view and comes back, it will essentially re-evaluate this." becomes unneeded, and the preview problem goes away because we don't throw the real source away.

mart added a comment.Mar 2 2017, 5:01 PM
In D4900#91990, @hein wrote:

Yep, then the view caring about complexity like "GridView doesn't recycle items, so when the item goes out of view and comes back, it will essentially re-evaluate this." becomes unneeded, and the preview problem goes away because we don't throw the real source away.

it may be a good idea, yes, i like :)

Should this be in IconItem instead? Q_PROPERTY(QString fallbackSource), etc.

Good idea. Back in the days we had KIconLoader always return a "unknown" icon which was changed because it should be the view's responsibility to provide a fallback but now we have gaps in quite a few places (I also have a patch for Dolphin for the same pending).

broulik abandoned this revision.Apr 24 2018, 3:25 PM

I think this is the wrong layer to do this