discomfitor pushed a commit to branch enlightenment-0.21.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=939e3d8f202656c414870a669577726f73ade464

commit 939e3d8f202656c414870a669577726f73ade464
Author: Mike Blumenkrantz <[email protected]>
Date:   Fri Aug 25 14:47:05 2017 -0400

    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
---
 src/modules/conf_applications/e_int_config_apps.c | 70 ++++++++++++-----------
 1 file changed, 38 insertions(+), 32 deletions(-)

diff --git a/src/modules/conf_applications/e_int_config_apps.c 
b/src/modules/conf_applications/e_int_config_apps.c
index 91ac0baf3..26d939374 100644
--- a/src/modules/conf_applications/e_int_config_apps.c
+++ b/src/modules/conf_applications/e_int_config_apps.c
@@ -601,50 +601,56 @@ _fill_apps_list(E_Config_App_List *apps)
 static void
 _fill_xdg_list(E_Config_App_List *apps)
 {
-   Eina_List *files;
+   Eina_List *files, *dirs;
    Efreet_Desktop *desk = NULL;
-   const char *path = "/etc/xdg/autostart";
+   const char *path;
    char *file, *ext;
-   char buf[4096];
+   char buf[PATH_MAX], pbuf[PATH_MAX];
 
-   files = ecore_file_ls(path);
-   EINA_LIST_FREE(files, file)
+   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)
      {
-        Eina_List *ll;
-
-        if ((file[0] == '.') || !(ext = strrchr(file, '.')) || (strcmp(ext, 
".desktop")))
+        snprintf(pbuf, sizeof(pbuf), "%s/autostart", path);
+        files = ecore_file_ls(pbuf);
+        EINA_LIST_FREE(files, file)
           {
-             free(file);
-             continue;
-          }
-        snprintf(buf, sizeof(buf), "%s/%s", path, file);
-        free(file);
+             Eina_List *ll;
 
-        desk = efreet_desktop_new(buf);
-        if (!desk)
-          continue;
+             if ((file[0] == '.') || !(ext = strrchr(file, '.')) || 
(strcmp(ext, ".desktop")))
+               {
+                  free(file);
+                  continue;
+               }
+             snprintf(buf, sizeof(buf), "%s/%s", pbuf, file);
+             free(file);
 
-        ll = eina_list_search_unsorted_list(apps->desks, _cb_desks_sort, desk);
-        if (ll)
-          {
-             Efreet_Desktop *old;
+             desk = efreet_desktop_new(buf);
+             if (!desk)
+               continue;
 
-             old = eina_list_data_get(ll);
-             /*
-              * This fixes when we have several .desktop with the same name,
-              * and the only difference is that some of them are for specific
-              * desktops.
-              */
-             if ((old->only_show_in) && (!desk->only_show_in))
+             ll = eina_list_search_unsorted_list(apps->desks, _cb_desks_sort, 
desk);
+             if (ll)
                {
-                  efreet_desktop_free(old);
-                  eina_list_data_set(ll, desk);
+                  Efreet_Desktop *old;
+
+                  old = eina_list_data_get(ll);
+                  /*
+                   * This fixes when we have several .desktop with the same 
name,
+                   * and the only difference is that some of them are for 
specific
+                   * desktops.
+                   */
+                  if ((old->only_show_in) && (!desk->only_show_in))
+                    {
+                       efreet_desktop_free(old);
+                       eina_list_data_set(ll, desk);
+                    }
+                  else
+                    efreet_desktop_free(desk);
                }
              else
-               efreet_desktop_free(desk);
+               apps->desks = eina_list_append(apps->desks, desk);
           }
-        else
-          apps->desks = eina_list_append(apps->desks, desk);
      }
 
    apps->desks = eina_list_sort(apps->desks, -1, _cb_desks_sort);

-- 


Reply via email to