aboutsummaryrefslogtreecommitdiff
path: root/libdbusmenu-gtk
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2012-04-06 13:24:57 -0500
committerCharles Kerr <charles.kerr@canonical.com>2012-04-06 13:24:57 -0500
commitc9b182f4571ee7973288e9ab1075f4b002aef45b (patch)
treeb6ebf6c9d492ff8996560e963563ccbf74fbe1e3 /libdbusmenu-gtk
parent202e61a48003989bec69f68f24f41a3bb20e8e55 (diff)
downloadlibdbusmenu-c9b182f4571ee7973288e9ab1075f4b002aef45b.tar.gz
libdbusmenu-c9b182f4571ee7973288e9ab1075f4b002aef45b.tar.bz2
libdbusmenu-c9b182f4571ee7973288e9ab1075f4b002aef45b.zip
remove convoluted & unnecessary branch in update_icon()
Diffstat (limited to 'libdbusmenu-gtk')
-rw-r--r--libdbusmenu-gtk/parser.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/libdbusmenu-gtk/parser.c b/libdbusmenu-gtk/parser.c
index c56e28f..4492d01 100644
--- a/libdbusmenu-gtk/parser.c
+++ b/libdbusmenu-gtk/parser.c
@@ -61,7 +61,6 @@ static void checkbox_toggled (GtkWidget * widget,
DbusmenuMenuitem * mi);
static void update_icon (DbusmenuMenuitem * menuitem,
ParserData * pdata,
- GtkImageMenuItem * gmenuitem,
GtkImage * image);
static GtkWidget * find_menu_label (GtkWidget * widget);
static void label_notify_cb (GtkWidget * widget,
@@ -546,7 +545,7 @@ construct_dbusmenu_for_widget (GtkWidget * widget)
if (GTK_IS_IMAGE (image))
{
- update_icon (mi, pdata, GTK_IMAGE_MENU_ITEM(widget), GTK_IMAGE (image));
+ update_icon (mi, pdata, GTK_IMAGE (image));
}
}
@@ -703,7 +702,7 @@ checkbox_toggled (GtkWidget *widget, DbusmenuMenuitem *mi)
}
static void
-update_icon (DbusmenuMenuitem *menuitem, ParserData * pdata, GtkImageMenuItem * gmenuitem, GtkImage *image)
+update_icon (DbusmenuMenuitem *menuitem, ParserData * pdata, GtkImage *image)
{
GdkPixbuf * pixbuf = NULL;
const gchar * icon_name = NULL;
@@ -712,12 +711,8 @@ update_icon (DbusmenuMenuitem *menuitem, ParserData * pdata, GtkImageMenuItem *
GtkIconInfo * info;
gint width;
- /* Check to see if we're changing the image. If so, we need to track
- that little bugger */
- /* Why check for gmenuitem being NULL? Because there are some cases where
- we can't get it easily, and those mean it's not changed just the icon
- underneith, so we can ignore these larger impacts */
- if (image != GTK_IMAGE(pdata->image) && gmenuitem != NULL) {
+ /* Check to see if we're changing the image. If so, we need to track that little bugger */
+ if (image != GTK_IMAGE(pdata->image)) {
if (pdata->image != NULL) {
g_signal_handlers_disconnect_by_func(pdata->image, G_CALLBACK(image_notify_cb), menuitem);
@@ -936,7 +931,7 @@ image_notify_cb (GtkWidget *widget,
pspec->name == g_intern_static_string ("storage-type"))
{
ParserData *pdata = (ParserData *)g_object_get_data(G_OBJECT(mi), PARSER_DATA);
- update_icon (mi, pdata, NULL, GTK_IMAGE (widget));
+ update_icon (mi, pdata, GTK_IMAGE (widget));
}
}
@@ -1125,14 +1120,14 @@ widget_notify_cb (GtkWidget *widget,
GtkWidget *image = NULL;
g_object_get(widget, "image", &image, NULL);
ParserData *pdata = (ParserData *)g_object_get_data(G_OBJECT(child), PARSER_DATA);
- update_icon (child, pdata, GTK_IMAGE_MENU_ITEM(widget), GTK_IMAGE(image));
+ update_icon (child, pdata, GTK_IMAGE(image));
}
else if (pspec->name == g_intern_static_string ("image"))
{
GtkWidget *image;
image = GTK_WIDGET (g_value_get_object (&prop_value));
ParserData *pdata = (ParserData *)g_object_get_data(G_OBJECT(child), PARSER_DATA);
- update_icon (child, pdata, GTK_IMAGE_MENU_ITEM(widget), GTK_IMAGE (image));
+ update_icon (child, pdata, GTK_IMAGE (image));
}
else if (pspec->name == g_intern_static_string ("parent"))
{