Commit 08bafb4a authored by Daniel Boles's avatar Daniel Boles

TreeMenu: Don't manually reinvent g_list_index()

g_list_index() "Gets the position of the element containing the given
data (starting from 0)." That is exactly what we were manually doing.
parent 009c2569
......@@ -988,18 +988,11 @@ static gint
menu_item_position (GtkTreeMenu *menu,
GtkWidget *item)
{
GList *children, *l;
GList *children;
gint position;
children = gtk_container_get_children (GTK_CONTAINER (menu));
for (position = 0, l = children; l; position++, l = l->next)
{
GtkWidget *iitem = l->data;
if (item == iitem)
break;
}
position = g_list_index (children, item);
g_list_free (children);
return position;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment