Merge lp:~charlesk/libdbusmenu/lop-1082516 into lp:libdbusmenu/13.04

Proposed by Charles Kerr
Status: Merged
Approved by: Allan LeSage
Approved revision: 435
Merged at revision: 434
Proposed branch: lp:~charlesk/libdbusmenu/lop-1082516
Merge into: lp:libdbusmenu/13.04
Diff against target: 12 lines (+1/-1)
1 file modified
libdbusmenu-gtk/client.c (+1/-1)
To merge this branch: bzr merge lp:~charlesk/libdbusmenu/lop-1082516
Reviewer Review Type Date Requested Status
Mathieu Trudel-Lapierre Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+136276@code.launchpad.net

Commit message

Confirm that icon_name is non-NULL before passing it to gtk_icon_theme_has_icon()

Description of the change

Looks like the problem is coming from configuration #5 in test-gtk-label.json, specifically this entry:

 > {"id": 89,
 > "type": "standard",
 > "icon-name": "blank-icon",
 > "label": "blank"}

"blank-icon" is the magic string used by DBUSMENU_MENUITEM_ICON_NAME_BLANK, which in libdbusmenu-gtk/client.c is processed by image_property_handle() to give the menuitem a blank GtkImage.

In a subsequent call to image_property_handle() we call gtk_image_get_icon_name() on the existing image iff its storage type is GTK_IMAGE_ICON_NAME or GTK_IMAGE_EMPTY. This is legal use of that gtk function, but in the case listed above, the name that's returned is NULL, so we need to test for that before using icon_name elsewhere in image_property_handle().

To post a comment you must log in.
lp:~charlesk/libdbusmenu/lop-1082516 updated
435. By Charles Kerr

whoops! remove a stray g_message() that got committed

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

Err, wow.. that's getting things a bit compilicated (re: jenkins).

The fix itself looks good, but there are still test failures: http://paste.ubuntu.com/1390284/

review: Needs Information
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Charles Kerr (charlesk) wrote :

Whoo!

Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

Approving. Fix looks good per my test in sbuild; though there are further issues that need to be fixed.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libdbusmenu-gtk/client.c'
2--- libdbusmenu-gtk/client.c 2012-10-24 14:50:13 +0000
3+++ libdbusmenu-gtk/client.c 2012-11-26 21:48:20 +0000
4@@ -1182,7 +1182,7 @@
5 if (gtkimage != NULL && (gtk_image_get_storage_type(GTK_IMAGE(gtkimage)) == GTK_IMAGE_ICON_NAME || gtk_image_get_storage_type(GTK_IMAGE(gtkimage)) == GTK_IMAGE_EMPTY)) {
6 const gchar *icon_name = NULL;
7 gtk_image_get_icon_name (GTK_IMAGE(gtkimage), &icon_name, NULL);
8- if (gtk_icon_theme_has_icon(gtk_icon_theme_get_default(), icon_name)) {
9+ if ((icon_name != NULL) && gtk_icon_theme_has_icon(gtk_icon_theme_get_default(), icon_name)) {
10 return;
11 }
12 }

Subscribers

People subscribed via source and target branches

to all changes: