forked from enlightenment/enlightenment
look in PREFIX/etc for menu files too
SVN revision: 38991
This commit is contained in:
parent
f0ddca76a8
commit
116d7f7a4f
|
@ -7,27 +7,13 @@
|
||||||
static char *xdg_sel = NULL;
|
static char *xdg_sel = NULL;
|
||||||
static Eina_List *menus = NULL;
|
static Eina_List *menus = NULL;
|
||||||
|
|
||||||
EAPI int
|
static void
|
||||||
wizard_page_init(E_Wizard_Page *pg)
|
check_menu_dir(const char *dir)
|
||||||
{
|
{
|
||||||
const char *dirs[] =
|
|
||||||
{
|
|
||||||
"/etc/xdg",
|
|
||||||
"/usr/etc/xdg",
|
|
||||||
"/usr/local/etc/xdg",
|
|
||||||
"/usr/opt/etc/xdg",
|
|
||||||
"/usr/opt/xdg",
|
|
||||||
// FIXME: add more "known locations"
|
|
||||||
NULL
|
|
||||||
};
|
|
||||||
int i;
|
|
||||||
|
|
||||||
for (i = 0; dirs[i]; i++)
|
|
||||||
{
|
|
||||||
Ecore_List *files;
|
|
||||||
char buf[PATH_MAX], *file;
|
char buf[PATH_MAX], *file;
|
||||||
|
Ecore_List *files;
|
||||||
|
|
||||||
snprintf(buf, sizeof(buf), "%s/menus", dirs[i]);
|
snprintf(buf, sizeof(buf), "%s/menus", dir);
|
||||||
files = ecore_file_ls(buf);
|
files = ecore_file_ls(buf);
|
||||||
if (files)
|
if (files)
|
||||||
{
|
{
|
||||||
|
@ -36,7 +22,7 @@ wizard_page_init(E_Wizard_Page *pg)
|
||||||
{
|
{
|
||||||
if (e_util_glob_match(file, "*.menu"))
|
if (e_util_glob_match(file, "*.menu"))
|
||||||
{
|
{
|
||||||
snprintf(buf, sizeof(buf), "%s/menus/%s", dirs[i], file);
|
snprintf(buf, sizeof(buf), "%s/menus/%s", dir, file);
|
||||||
menus = eina_list_append(menus, strdup(buf));
|
menus = eina_list_append(menus, strdup(buf));
|
||||||
}
|
}
|
||||||
ecore_list_next(files);
|
ecore_list_next(files);
|
||||||
|
@ -44,6 +30,39 @@ wizard_page_init(E_Wizard_Page *pg)
|
||||||
ecore_list_destroy(files);
|
ecore_list_destroy(files);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EAPI int
|
||||||
|
wizard_page_init(E_Wizard_Page *pg)
|
||||||
|
{
|
||||||
|
char buf[PATH_MAX];
|
||||||
|
const char *dirs[] =
|
||||||
|
{
|
||||||
|
"/etc/xdg",
|
||||||
|
"/usr/etc/xdg",
|
||||||
|
"/usr/local/etc/xdg",
|
||||||
|
"/usr/opt/etc/xdg",
|
||||||
|
"/usr/opt/xdg",
|
||||||
|
"/usr/local/opt/etc/xdg",
|
||||||
|
"/usr/local/opt/xdg",
|
||||||
|
"/opt/etc/xdg",
|
||||||
|
"/opt/xdg",
|
||||||
|
// FIXME: add more "known locations"
|
||||||
|
NULL
|
||||||
|
};
|
||||||
|
int i, newdir;
|
||||||
|
|
||||||
|
for (i = 0; dirs[i]; i++) check_menu_dir(dirs[i]);
|
||||||
|
newdir = 1;
|
||||||
|
snprintf(buf, sizeof(buf), "%s/etc/xdg", e_prefix_get());
|
||||||
|
for (i = 0; dirs[i]; i++)
|
||||||
|
{
|
||||||
|
if (!strcmp(dirs[i], buf))
|
||||||
|
{
|
||||||
|
newdir = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (newdir) check_menu_dir(buf);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
EAPI int
|
EAPI int
|
||||||
|
|
Loading…
Reference in New Issue