[KPhotoAlbum] suggested solution to the icon problem

Johannes Zarl-Zierl johannes at zarl-zierl.at
Thu Jan 4 15:13:22 GMT 2018

Hi Andreas,

Sorry for not responding to your previous mail in a timely manner (I have a 
draft response sitting in my mailbox, but have had no time to finish it, yet).
Also: thanks for sharing the insights into mangled icons with us. It enabled 
me to recreate the issue in a virtualbox Ubuntu image.

On Donnerstag, 4. Jänner 2018 15:08:44 CET Andreas Schleth wrote:
> QIcon::fromTheme has a variant with 2 parameters: 1. as before some
> named icon from a theme, 2. a fallback QIcon. I suggest, we use this
> variant and provide fallback icons where needed.

You're right: Providing fallback icons (in a resource file) is probably the 
way to go.

> Also I think that all the cases with icon names as in
> QString::fromLatin1("...") oder QString::fromUtf8("...") could probably
> replaced with QLatin1String("...") as long as the strings will not be
> translated.

Yes - though I would be surprised if there was a measurable performance 
difference for our usage of strings.

> As to the reason for the fail in Ubuntu/Mint: it is the theme (or
> missing icon names in the Mint/Ubuntu themes). If I choose a KDE Theme
> in Mint, the problem gets better (more icons show), but the are shown in
> different sizes. However, we cannot force the user to choose a certain
> desktop icon theme just for KPA. Therefore, I vote for the fallback
> solution.

I'm still wondering how this happens in the first place: On my virtualized 
Ubuntu 16.04 LTS I see that:

KPA uses the ubuntu-mono-dark icon theme, with:
Available icon sizes:  (QSize(16, 16), QSize(22, 22), QSize(24, 24), QSize(32, 
32), QSize(48, 48))
Actual icon size:  QSize(48, 48)
Pixmap rect  QRect(0,0 70x70)

Yet, the displayed pixmap has (by the way of a screen ruler) ~20px in height.

I would really like to know how this can happen…


More information about the Kphotoalbum mailing list