Enlightenment CVS committal Author : onefang Project : e17 Module : apps/e
Dir : e17/apps/e/src/bin Modified Files: e_fdo_menu_to_order.c Log Message: Add debian quirk to search strategy. =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_fdo_menu_to_order.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -3 -r1.4 -r1.5 --- e_fdo_menu_to_order.c 30 Aug 2006 05:00:58 -0000 1.4 +++ e_fdo_menu_to_order.c 30 Aug 2006 18:54:54 -0000 1.5 @@ -12,51 +12,48 @@ 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 - * ? + /* NEW STRATEGY - + * + * if there is no applications.menu + * try debian-menu.menu instead. + * if all else fails + * run debians funky menu generator shit. */ - 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; - 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; + /* Find the main menu file. */ + menu_file = ecore_desktop_paths_file_find(ecore_desktop_paths_menus, + "applications.menu", -1, NULL, NULL); + if (!menu_file) + { + /* Try various quirks of various systems. */ + menu_file = ecore_desktop_paths_file_find(ecore_desktop_paths_menus, + "debian-menu.menu", -1, NULL, NULL); + } + + if (menu_file) + { + char *path; - path = ecore_file_get_dir(menu_file); - if (path) - { - Ecore_Desktop_Tree *menus; + 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? - } - } + /* 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); +// FIXME: Can't free this just yet, causes major memory corruption. +// ecore_desktop_tree_del(menus); + } + free(path); + + } + free(menu_file); + } } static int ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs