app: reorganize a bit gimp_widget_load_icon().
commit80d2a02b58264338cc7e41f117c6d0d9d2e23f47
authorJehan <jehan@girinstud.io>
Mon, 25 Jun 2018 13:32:24 +0000 (25 15:32 +0200)
committerJehan <jehan@girinstud.io>
Mon, 25 Jun 2018 14:01:46 +0000 (25 16:01 +0200)
tree616887bd0d0a4129c0488bc2cc4e02b8bfc3bf19
parent5b6126146aec878b6c56171e03feab56b8104299
app: reorganize a bit gimp_widget_load_icon().

Massimo spotted some warning with clang in #1608 about pixbuf being used
initialized. Rather than just initializing it, I am actually
reorganizing a bit more the function because there was a bit of a logics
bug. In some weird case, it would have still been possible for this
function to return NULL instead of a magenta square (the case was: the
icon was not present in the icon theme; then wilber-eek was either not
present or failed to load).

This new code organization is more clearer, as a step by step, should
better identify the various failure cases and always return an allocated
GdkPixbuf.
app/widgets/gimpwidgets-utils.c