Skip to content

Backport to glib-2-58: Fix g_icon_to_string() regression (doc inconsistency)

g_icon_new_for_string() docs states that it should return a single name when created with a single name. I add a second condition to this case: the themed icon must not include default fallbacks (i.e. it must not have been created with g_themed_icon_new_with_default_fallbacks()). Otherwise the return value of g_icon_new_for_string() would not recreate the same icon list when passed to g_icon_new_for_string() (which would be another documentation inconsistency).

g_icon_new_for_string() is now back to old behavior for this specific case.

I also revert the unit test for this case, and add a new unit test when using g_themed_icon_new_with_default_fallbacks() with a single name as well.

(Trivial backport from !305 (merged).)

Closes #1513 (closed).

Merge request reports