handle xdg "autostart" directories in apps dialogs
a valid autostart directory can exist in any xdg data/config directory according to spec, so ensure we check everywhere when listing them
This commit is contained in:
parent
db264cca49
commit
07ea23b5b9
|
@ -601,13 +601,18 @@ _fill_apps_list(E_Config_App_List *apps)
|
||||||
static void
|
static void
|
||||||
_fill_xdg_list(E_Config_App_List *apps)
|
_fill_xdg_list(E_Config_App_List *apps)
|
||||||
{
|
{
|
||||||
Eina_List *files;
|
Eina_List *files, *dirs;
|
||||||
Efreet_Desktop *desk = NULL;
|
Efreet_Desktop *desk = NULL;
|
||||||
const char *path = "/etc/xdg/autostart";
|
const char *path;
|
||||||
char *file, *ext;
|
char *file, *ext;
|
||||||
char buf[4096];
|
char buf[PATH_MAX], pbuf[PATH_MAX];
|
||||||
|
|
||||||
files = ecore_file_ls(path);
|
dirs = eina_list_merge(eina_list_clone(efreet_config_dirs_get()), eina_list_clone(efreet_data_dirs_get()));
|
||||||
|
dirs = eina_list_append(dirs, efreet_data_home_get());
|
||||||
|
EINA_LIST_FREE(dirs, path)
|
||||||
|
{
|
||||||
|
snprintf(pbuf, sizeof(pbuf), "%s/autostart", path);
|
||||||
|
files = ecore_file_ls(pbuf);
|
||||||
EINA_LIST_FREE(files, file)
|
EINA_LIST_FREE(files, file)
|
||||||
{
|
{
|
||||||
Eina_List *ll;
|
Eina_List *ll;
|
||||||
|
@ -617,7 +622,7 @@ _fill_xdg_list(E_Config_App_List *apps)
|
||||||
free(file);
|
free(file);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
snprintf(buf, sizeof(buf), "%s/%s", path, file);
|
snprintf(buf, sizeof(buf), "%s/%s", pbuf, file);
|
||||||
free(file);
|
free(file);
|
||||||
|
|
||||||
desk = efreet_desktop_new(buf);
|
desk = efreet_desktop_new(buf);
|
||||||
|
@ -646,6 +651,7 @@ _fill_xdg_list(E_Config_App_List *apps)
|
||||||
else
|
else
|
||||||
apps->desks = eina_list_append(apps->desks, desk);
|
apps->desks = eina_list_append(apps->desks, desk);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
apps->desks = eina_list_sort(apps->desks, -1, _cb_desks_sort);
|
apps->desks = eina_list_sort(apps->desks, -1, _cb_desks_sort);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue