Add debian quirk to search strategy.

SVN revision: 25219
This commit is contained in:
David Walter Seikel 2006-08-30 18:54:54 +00:00
parent 85c6948f32
commit 02da55f6f5
1 changed files with 37 additions and 40 deletions

View File

@ -12,51 +12,48 @@ EAPI void
e_fdo_menu_to_order(void) e_fdo_menu_to_order(void)
{ {
int i; int i;
/* i added all the files i see in /etc/xdg/menus on debian. maybe we /* NEW STRATEGY -
* should list the contents of the xdg menu dir and load every *.menu file *
* ? * 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; 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,
/* Find the main menu file. */ "applications.menu", -1, NULL, NULL);
menu_file = ecore_desktop_paths_file_find(ecore_desktop_paths_menus, if (!menu_file)
menu_names[i], -1, NULL, NULL); {
if (menu_file) /* Try various quirks of various systems. */
{ menu_file = ecore_desktop_paths_file_find(ecore_desktop_paths_menus,
char *path; "debian-menu.menu", -1, NULL, NULL);
}
if (menu_file)
{
char *path;
path = ecore_file_get_dir(menu_file); path = ecore_file_get_dir(menu_file);
if (path) if (path)
{ {
Ecore_Desktop_Tree *menus; Ecore_Desktop_Tree *menus;
/* convert the xml into menus */ /* convert the xml into menus */
menus = ecore_desktop_menu_get(menu_file); menus = ecore_desktop_menu_get(menu_file);
if (menus) if (menus)
{ {
/* create the .eap and order files from the menu */ /* create the .eap and order files from the menu */
ecore_desktop_tree_foreach(menus, 0, _e_menu_make_apps, path); ecore_desktop_tree_foreach(menus, 0, _e_menu_make_apps, path);
} // FIXME: Can't free this just yet, causes major memory corruption.
free(path); // ecore_desktop_tree_del(menus);
// FIXME: leak: menus? }
} free(path);
// FIXME: leak: menu_file?
} }
} free(menu_file);
}
} }
static int static int