KFileItemDelegate: Always reserve space for icons
ClosedPublic

Authored by fvogt on Aug 15 2017, 8:35 AM.

Details

Summary

Even null icons are drawn so also reserve space for them to avoid overlapping.

Test Plan

Diff Detail

Repository
R241 KIO
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
fvogt created this revision.Aug 15 2017, 8:35 AM
Restricted Application added a project: Frameworks. · View Herald TranscriptAug 15 2017, 8:35 AM
fvogt added a comment.Aug 15 2017, 8:37 AM

It would be possible to avoid drawing null QIcons as well, but that would result in broken alignment.

cfeck added a subscriber: cfeck.Aug 15 2017, 9:33 AM

BUG: 372207

The underlying issue is that KIconLoader's implementation of isNull (in virtual_hook) is not really meaningful.
In cases where a name for a nonexistent icon is passed, pixmap will draw the "unknown" icon, but isNull still returns true.

So the question is whether this is intentional or not. The API doesn't really make that clear.

If isNull should return false iff pixmap returns something other than an empty pixmap, the implementation for KIconLoader
would probably always return false...

In any case, I still think this diff isn't wrong by itself as the drawing of the pixmap is still unconditional and so should be reflected
in the text margin.

fvogt added a comment.Sep 16 2017, 3:33 PM

Ping #2.

If no reply until monday I'll assume this is ok.

This revision was automatically updated to reflect the committed changes.