After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 753285 - g_menu_item_set_icon fails if called with NULL icon
g_menu_item_set_icon fails if called with NULL icon
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gio
2.44.x
Other All
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2015-08-05 15:24 UTC by Yanko Kaneti
Modified: 2015-08-10 17:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
EogWindow: Avoid null menu item icons on open with.. menu (969 bytes, patch)
2015-08-05 15:24 UTC, Yanko Kaneti
none Details | Review
fix assertion to allow a NULL icon (869 bytes, patch)
2015-08-09 21:20 UTC, Felix Riemann
accepted-commit_now Details | Review

Description Yanko Kaneti 2015-08-05 15:24:43 UTC
Some apps, especially old or misconfigured ones don't have
icons or at least GNOME doesn't know about them
Comment 1 Yanko Kaneti 2015-08-05 15:24:49 UTC
Created attachment 308801 [details] [review]
EogWindow: Avoid null menu item icons on open with.. menu
Comment 2 Felix Riemann 2015-08-09 16:58:28 UTC
Can you give some more details about the error?
Is it triggering error messages or does it break the menus?
According to the API docs g_menu_item_set_icon() should be able to handle a NULL icon and as such the check in your patch shouldn't be needed.
Comment 3 Yanko Kaneti 2015-08-09 18:12:08 UTC
(eog:28250): GLib-GIO-CRITICAL **: g_menu_item_set_icon: assertion 'G_IS_ICON (icon)' failed

This should be avoided
Comment 4 Felix Riemann 2015-08-09 21:18:34 UTC
Ah, that's actually a GIO bug then. The function logs a critical if the icon is NULL although it explicitly allows a NULL-icon.
Comment 5 Felix Riemann 2015-08-09 21:20:29 UTC
Created attachment 308985 [details] [review]
fix assertion to allow a NULL icon

This fixes the assertion to respect a NULL icon.
Comment 6 Matthias Clasen 2015-08-10 14:49:33 UTC
Review of attachment 308985 [details] [review]:

looks right
Comment 7 Felix Riemann 2015-08-10 17:07:08 UTC
And pushed to master.

---
This problem has been fixed in the unstable development version. The fix will be available in the next major software release. You may need to upgrade your Linux distribution to obtain that newer version.