general request about setWindowIcon(QIcon::fromTheme())

Aleix Pol aleixpol at kde.org
Fri Jan 15 13:02:04 UTC 2016


On Fri, Jan 15, 2016 at 12:48 PM, René J.V. <rjvbertin at gmail.com> wrote:
> Hi,
>
> A bit of a general request about the use of setWindowIcon( QIcon::fromTheme(...) ) :
> there are platforms on which QIcon::fromTheme() will basically always return the fallback icon (empty by default) because icon themes are not supported "out of the box" by Qt.
> If however the application was endowed with an icon at build time (I see this was done for KDevelop), chances are that at least some of the targets of the setWindowIcon() call have inherited the application on the that platform.
>
> I think it's better to preserve that icon rather than replace it with an empty icon, so I'm adding local distribution patches  (for MacPorts) that provide an explicit fallback to all those QIcon::fromTheme() calls:
>
> setWindowIcon( QIcon::fromTheme(name, windowIcon()) )
>
> I haven't tried to verify to what extent this indeed has an effect for all calls; it's probably best to add an explicit fallback systematically.
>
> I'm in the process of updating my patch for kdevplatform because a lot of the calls have been changed in a recent commit.
> I could file a RR when it's complete (as well as one for KDevelop), but I'd also appreciate if you could simply add the explicit fallback in the next round of updates you're applying to this particular aspect. Provided of course people agree with the approach ...

Your fallback icon approach sounds sane to me and I'd recommend to
just send a patch to review.

A KDE-wide standard could be discussed although this is not the
correct forum for that.

Aleix


More information about the KDevelop-devel mailing list