From 11cf7790eb87cecced8090dfa65ea6df0bf78047 Mon Sep 17 00:00:00 2001 From: Ondrej Jirman Date: Tue, 13 Nov 2007 18:36:02 +0000 Subject: ** Fix for bug #494320 2007-11-13 Ondrej Jirman ** Fix for bug #494320 * e-popup.c: (e_popup_create_menu): Add support for redefining existing menu items. svn path=/trunk/; revision=34530 --- e-util/e-popup.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'e-util/e-popup.c') diff --git a/e-util/e-popup.c b/e-util/e-popup.c index ce723a2368..c607b9045c 100644 --- a/e-util/e-popup.c +++ b/e-util/e-popup.c @@ -507,9 +507,15 @@ e_popup_create_menu(EPopup *emp, EPopupTarget *target, guint32 mask) /* create tree structure */ for (i=0;ilen;i++) { struct _item_node *inode = items->pdata[i], *pnode; + struct _item_node *nextnode = (i + 1 < items->len) ? items->pdata[i+1] : NULL; struct _EPopupItem *item = inode->item; const char *tmp; + if (nextnode && !strcmp (nextnode->item->path, item->path)) { + d(printf ("skipping item %s\n", item->path)); + continue; + } + g_string_truncate(ppath, 0); tmp = strrchr(item->path, '/'); if (tmp) { -- cgit v1.2.3