diff --git a/src/bin/e.h b/src/bin/e.h index 116ea7c00..569d1d6f3 100644 --- a/src/bin/e.h +++ b/src/bin/e.h @@ -62,6 +62,7 @@ #include #include #include +#include #include #include diff --git a/src/bin/e_fdo_menu_to_order.c b/src/bin/e_fdo_menu_to_order.c index 43da65ca1..34055b087 100644 --- a/src/bin/e_fdo_menu_to_order.c +++ b/src/bin/e_fdo_menu_to_order.c @@ -1,22 +1,4 @@ -/* This file currently lives in two places, the source code for E and the source code for e_utils e17genmenu - * - * It will soon go away from e17genmenu. It still needs to be cleaned up to E coding specs. - * - * The standard includes will be replaced with "e.h" when this is no longer needed for e17genmenu. - * - * FIXME: .order file usage in here and in e_apps.c need to be reviewed. - */ - -#include "config.h" -#include "e_fdo_menu_to_order.h" - -#include -#include -#include -#include -#include -#include -#include +#include "e.h" //#define DEBUG 1 @@ -29,29 +11,52 @@ static int _e_search_list(Ecore_List *list, const char *search); EAPI void e_fdo_menu_to_order(void) { + int i; + /* i added all the files i see in /etc/xdg/menus on debian. maybe we + * should list the contents of the xdg menu dir and load every *.menu file + * ? + */ + const char *menu_names[9] = + { + "applications.menu", + "gnome-applications.menu", + "gnome-preferences.menu", + "gnome-settings.menu", + "kde-applications.menu", + "kde-information.menu", + "kde-screensavers.menu", + "kde-settings.menu", + "debian-menu.menu" + }; char *menu_file; - - /* Find the main menu file. */ - menu_file = ecore_desktop_paths_file_find(ecore_desktop_paths_menus, "applications.menu", -1, NULL, NULL); - if (menu_file) - { - char *path; - - path = ecore_file_get_dir(menu_file); - if (path) - { - Ecore_Desktop_Tree *menus; - - /* convert the xml into menus */ - menus = ecore_desktop_menu_get(menu_file); - if (menus) - { - /* create the .eap and order files from the menu */ - ecore_desktop_tree_foreach(menus, 0, _e_menu_make_apps, path); - } - free(path); - } - } + + for (i = 0; i < 9; i++) + { + /* Find the main menu file. */ + menu_file = ecore_desktop_paths_file_find(ecore_desktop_paths_menus, + menu_names[i], -1, NULL, NULL); + if (menu_file) + { + char *path; + + path = ecore_file_get_dir(menu_file); + if (path) + { + Ecore_Desktop_Tree *menus; + + /* convert the xml into menus */ + menus = ecore_desktop_menu_get(menu_file); + if (menus) + { + /* create the .eap and order files from the menu */ + ecore_desktop_tree_foreach(menus, 0, _e_menu_make_apps, path); + } + free(path); + // FIXME: leak: menus? + } + // FIXME: leak: menu_file? + } + } } static int diff --git a/src/bin/e_main.c b/src/bin/e_main.c index 375a1fbc0..0e0e87399 100644 --- a/src/bin/e_main.c +++ b/src/bin/e_main.c @@ -885,7 +885,8 @@ _e_main_dirs_init(void) snprintf(buf, sizeof(buf), "%s/.e/e/applications/menu/all/.order", homedir); if (!ecore_file_exists(buf)) { - e_fdo_menu_to_order(); +// leave it to manual generation for now - ecore_desktop segv's badly. +// e_fdo_menu_to_order(); } /* FIXME: THIS is to get people started - shoudl be in a wizard */ snprintf(buf, sizeof(buf), "%s/.e/e/fileman/favorites", homedir);