forked from enlightenment/enlightenment
fdo header and src more e compliant :)
onefang - some data to go on for debian - segv land galore though deep inside ecore_desktop. cant track right now. also leaks... i smell leaks. SVN revision: 25046
This commit is contained in:
parent
2a5a0cd8ec
commit
2c54568bfb
|
@ -62,6 +62,7 @@
|
||||||
#include <Ecore_File.h>
|
#include <Ecore_File.h>
|
||||||
#include <Ecore_X_Atoms.h>
|
#include <Ecore_X_Atoms.h>
|
||||||
#include <Ecore_X_Cursor.h>
|
#include <Ecore_X_Cursor.h>
|
||||||
|
#include <Ecore_Desktop.h>
|
||||||
#include <Eet.h>
|
#include <Eet.h>
|
||||||
#include <Edje.h>
|
#include <Edje.h>
|
||||||
|
|
||||||
|
|
|
@ -1,22 +1,4 @@
|
||||||
/* This file currently lives in two places, the source code for E and the source code for e_utils e17genmenu
|
#include "e.h"
|
||||||
*
|
|
||||||
* 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 <stdlib.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <limits.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <Ecore.h>
|
|
||||||
#include <Ecore_Desktop.h>
|
|
||||||
#include <Ecore_File.h>
|
|
||||||
|
|
||||||
//#define DEBUG 1
|
//#define DEBUG 1
|
||||||
|
|
||||||
|
@ -29,29 +11,52 @@ static int _e_search_list(Ecore_List *list, const char *search);
|
||||||
EAPI void
|
EAPI void
|
||||||
e_fdo_menu_to_order(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;
|
char *menu_file;
|
||||||
|
|
||||||
/* Find the main menu file. */
|
for (i = 0; i < 9; i++)
|
||||||
menu_file = ecore_desktop_paths_file_find(ecore_desktop_paths_menus, "applications.menu", -1, NULL, NULL);
|
{
|
||||||
if (menu_file)
|
/* Find the main menu file. */
|
||||||
{
|
menu_file = ecore_desktop_paths_file_find(ecore_desktop_paths_menus,
|
||||||
char *path;
|
menu_names[i], -1, NULL, NULL);
|
||||||
|
if (menu_file)
|
||||||
path = ecore_file_get_dir(menu_file);
|
{
|
||||||
if (path)
|
char *path;
|
||||||
{
|
|
||||||
Ecore_Desktop_Tree *menus;
|
path = ecore_file_get_dir(menu_file);
|
||||||
|
if (path)
|
||||||
/* convert the xml into menus */
|
{
|
||||||
menus = ecore_desktop_menu_get(menu_file);
|
Ecore_Desktop_Tree *menus;
|
||||||
if (menus)
|
|
||||||
{
|
/* convert the xml into menus */
|
||||||
/* create the .eap and order files from the menu */
|
menus = ecore_desktop_menu_get(menu_file);
|
||||||
ecore_desktop_tree_foreach(menus, 0, _e_menu_make_apps, path);
|
if (menus)
|
||||||
}
|
{
|
||||||
free(path);
|
/* 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
|
static int
|
||||||
|
|
|
@ -885,7 +885,8 @@ _e_main_dirs_init(void)
|
||||||
snprintf(buf, sizeof(buf), "%s/.e/e/applications/menu/all/.order", homedir);
|
snprintf(buf, sizeof(buf), "%s/.e/e/applications/menu/all/.order", homedir);
|
||||||
if (!ecore_file_exists(buf))
|
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 */
|
/* FIXME: THIS is to get people started - shoudl be in a wizard */
|
||||||
snprintf(buf, sizeof(buf), "%s/.e/e/fileman/favorites", homedir);
|
snprintf(buf, sizeof(buf), "%s/.e/e/fileman/favorites", homedir);
|
||||||
|
|
Loading…
Reference in New Issue