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:
Carsten Haitzler 2006-08-22 23:39:08 +00:00
parent 2a5a0cd8ec
commit 2c54568bfb
3 changed files with 49 additions and 42 deletions

View File

@ -62,6 +62,7 @@
#include <Ecore_File.h>
#include <Ecore_X_Atoms.h>
#include <Ecore_X_Cursor.h>
#include <Ecore_Desktop.h>
#include <Eet.h>
#include <Edje.h>

View File

@ -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 <stdlib.h>
#include <stdio.h>
#include <limits.h>
#include <string.h>
#include <Ecore.h>
#include <Ecore_Desktop.h>
#include <Ecore_File.h>
#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

View File

@ -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);