Index: modules/menu/desktop-menuspec.c =================================================================== --- modules/menu/desktop-menuspec.c (revision 22113) +++ modules/menu/desktop-menuspec.c (working copy) @@ -123,7 +123,6 @@ else if(!strcmp(name, "OFFICE")) return xfce_themed_icon_lookup_category(XFCE_ICON_CATEGORY_OFFICE, _xfce_desktop_menu_icon_size); - else if(!strcmp(name, "SOUND")) return xfce_themed_icon_lookup_category(XFCE_ICON_CATEGORY_SOUND, _xfce_desktop_menu_icon_size); @@ -168,11 +167,11 @@ } if(!n) n = node; - if (cat_to_displayname) - foundcat = g_hash_table_lookup(cat_to_displayname, n->data); + if (cat_to_displayname) + foundcat = g_hash_table_lookup(cat_to_displayname, n->data); else - foundcat = NULL; - if(!foundcat) + foundcat = NULL; + if(!foundcat) foundcat = n->data; g_ptr_array_add(mtfpi->paths, g_strconcat("/", foundcat, NULL)); return TRUE; @@ -196,11 +195,11 @@ totlen = 0; revpath = g_ptr_array_new(); for(n=node; ((char *)n->data)[0] != '/'; n=n->parent) { - if (cat_to_displayname) - foundcat = g_hash_table_lookup(cat_to_displayname, n->data); + if (cat_to_displayname) + foundcat = g_hash_table_lookup(cat_to_displayname, n->data); else - foundcat = NULL; - if(!foundcat) { + foundcat = NULL; + if(!foundcat) { g_ptr_array_free(revpath, FALSE); revpath = NULL; break; Index: modules/menu/desktop-menu-dentry.c =================================================================== --- modules/menu/desktop-menu-dentry.c (revision 22113) +++ modules/menu/desktop-menu-dentry.c (working copy) @@ -80,9 +80,11 @@ "kpersonalizer", "kappfinder", "kfmclient", + "xscreensaver", + "*.kss", NULL }; -static GHashTable *blacklist = NULL; +static GList *blacklist = NULL; static gchar **legacy_dirs = NULL; static GHashTable *dir_to_cat = NULL; @@ -301,6 +303,16 @@ } } +static gint list_find(gconstpointer a, gconstpointer b) +{ + gchar *glist_elmt = (gchar *) a; + gchar *comp_elmt = (gchar *) b; + + if (*glist_elmt == '*') + return !g_str_has_suffix(comp_elmt, ++glist_elmt); + return g_ascii_strncasecmp(comp_elmt, glist_elmt, strlen (glist_elmt)); +} + static gboolean menu_dentry_parse_dentry(XfceDesktopMenu *desktop_menu, XfceDesktopEntry *de, MenuPathType pathtype, gboolean is_legacy, const gchar *extra_cat) @@ -314,13 +326,13 @@ const gchar *name; gchar tmppath[2048]; gboolean ret = FALSE; - + xfce_desktop_entry_get_string(de, "OnlyShowIn", FALSE, &onlyshowin); /* each element needs to be ';'-terminated. i'm not working around * broken files. */ if(onlyshowin && !strstr(onlyshowin, "XFCE;")) goto cleanup; - + xfce_desktop_entry_get_string(de, "Hidden", FALSE, &hidden); if(hidden && !g_ascii_strcasecmp(hidden, "true")) goto cleanup; @@ -331,24 +343,36 @@ xfce_desktop_entry_get_string(de, "TryExec", FALSE, &tryexec); menu_cleanup_executable(tryexec); + if(tryexec) { + /* check for blacklisted item */ + if(blacklist && g_list_find_custom(blacklist, tryexec, list_find)) + goto cleanup; + + /* Check for "TryExec" command in path */ p = g_find_program_in_path(tryexec); if(!p) goto cleanup; g_free(p); } - /* check for blacklisted item */ xfce_desktop_entry_get_string(de, "Exec", FALSE, &exec); if(!exec) goto cleanup; /* filter out quotes around the command (yeah, people do that!) */ menu_cleanup_executable(exec); - - if(blacklist && g_hash_table_lookup(blacklist, exec)) + + /* Check for "Exec" command in path, too */ + p = g_find_program_in_path(exec); + if(!p) goto cleanup; - + g_free(p); + + /* check for blacklisted item */ + if(blacklist && g_list_find_custom(blacklist, exec, list_find)) + goto cleanup; + xfce_desktop_entry_get_string(de, "Categories", TRUE, &categories); if(categories || !is_legacy) { /* hack: leave out items that look like they are KDE control panels */ @@ -644,9 +668,8 @@ } if(!blacklist) { - blacklist = g_hash_table_new(g_str_hash, g_str_equal); for(i=0; blacklist_arr[i]; i++) - g_hash_table_insert(blacklist, blacklist_arr[i], GINT_TO_POINTER(1)); + blacklist = g_list_append(blacklist, blacklist_arr[i]); } /* lookup applications/ directories */ Index: modules/menu/desktop-menu-file.c =================================================================== --- modules/menu/desktop-menu-file.c (revision 22113) +++ modules/menu/desktop-menu-file.c (working copy) @@ -254,7 +254,7 @@ i = _find_attribute(attribute_names, "name"); if(i == -1) - return; + return; j = -1; if(!state->desktop_menu->use_menu_icons)