aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2018-03-20 20:36:56 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2018-03-20 20:36:56 +0900
commita1994536a4a6496a0960550bf5d1e8691848bd0c (patch)
tree61f704be6b068bbf6b0a2320555d47762c02a953
parente desklock pam error - go back to previous text (diff)
downloadenlightenment-a1994536a4a6496a0960550bf5d1e8691848bd0c.tar.gz
move from data_home/apps/defaults.list to config_home/mimeapps.list
this moves to the newer mimeapps.list file in ~/.config from the older defaults.list. it also provides a migration (copy file ovr if target doesnt exist on e startup). this fixes https://phab.enlightenment.org/T6784 @fix
-rw-r--r--src/bin/e_exehist.c20
-rw-r--r--src/bin/e_open.c7
-rw-r--r--src/bin/e_utils.c3
-rw-r--r--src/modules/conf_applications/e_int_config_defapps.c8
-rw-r--r--src/modules/fileman/e_fwin.c4
5 files changed, 30 insertions, 12 deletions
diff --git a/src/bin/e_exehist.c b/src/bin/e_exehist.c
index ec7ef7197..488ca937c 100644
--- a/src/bin/e_exehist.c
+++ b/src/bin/e_exehist.c
@@ -40,6 +40,20 @@ static E_Exehist *_e_exehist = NULL;
static E_Powersave_Deferred_Action *_e_exehist_unload_defer = NULL;
static int _e_exehist_changes = 0;
+static void
+_upgrade_defaults_to_mimeapps(void)
+{
+ char buf[PATH_MAX], buf2[PATH_MAX];
+
+ snprintf(buf, sizeof(buf), "%s/mimeapps.list",
+ efreet_config_home_get());
+ if (ecore_file_exists(buf)) return;
+ ecore_file_mkpath(efreet_config_home_get());
+ snprintf(buf2, sizeof(buf2), "%s/applications/defaults.list",
+ efreet_data_home_get());
+ ecore_file_cp(buf2, buf);
+}
+
/* externally accessible functions */
EINTERN int
e_exehist_init(void)
@@ -65,6 +79,8 @@ e_exehist_init(void)
E_EVENT_EXEHIST_UPDATE = ecore_event_type_new();
+ _upgrade_defaults_to_mimeapps();
+
return 1;
}
@@ -313,8 +329,8 @@ e_exehist_mime_desktop_add(const char *mime, Efreet_Desktop *desktop)
f = efreet_util_path_to_file_id(desktop->orig_path);
if (!f) return;
- snprintf(buf, sizeof(buf), "%s/applications/defaults.list",
- efreet_data_home_get());
+ snprintf(buf, sizeof(buf), "%s/mimeapps.list",
+ efreet_config_home_get());
ini = efreet_ini_new(buf);
//fprintf(stderr, "try open %s = %p\n", buf, ini);
if (ini)
diff --git a/src/bin/e_open.c b/src/bin/e_open.c
index fa787e825..d79ee9977 100644
--- a/src/bin/e_open.c
+++ b/src/bin/e_open.c
@@ -113,8 +113,8 @@ handler_find(const char *mime)
char path[PATH_MAX];
const char *name;
- snprintf(path, sizeof(path), "%s/applications/defaults.list",
- efreet_data_home_get());
+ snprintf(path, sizeof(path), "%s/mimeapps.list",
+ efreet_config_home_get());
name = xdg_defaults_get(path, mime);
if (!name)
{
@@ -328,7 +328,8 @@ terminal_open(void)
s = efreet_data_home_get();
if (s)
{
- snprintf(buf, sizeof(buf), "%s/applications/defaults.list", s);
+ snprintf(buf, sizeof(buf), "%s/mimeapps.list",
+ efreet_config_home_get());
tdesktop = _terminal_get(buf);
}
if (tdesktop) goto have_desktop;
diff --git a/src/bin/e_utils.c b/src/bin/e_utils.c
index 5fb5bed79..44584c228 100644
--- a/src/bin/e_utils.c
+++ b/src/bin/e_utils.c
@@ -1151,7 +1151,8 @@ e_util_terminal_desktop_get(void)
s = efreet_data_home_get();
if (s)
{
- snprintf(buf, sizeof(buf), "%s/applications/defaults.list", s);
+ snprintf(buf, sizeof(buf), "%s/mimeapps.list",
+ efreet_config_home_get());
tdesktop = _e_util_default_terminal_get(buf);
}
if (tdesktop) return tdesktop;
diff --git a/src/modules/conf_applications/e_int_config_defapps.c b/src/modules/conf_applications/e_int_config_defapps.c
index c6d2d2893..f4b5f0583 100644
--- a/src/modules/conf_applications/e_int_config_defapps.c
+++ b/src/modules/conf_applications/e_int_config_defapps.c
@@ -94,8 +94,8 @@ _create_data(E_Config_Dialog *cfd EINA_UNUSED)
cfdata->desk_change_handler = ecore_event_handler_add
(EFREET_EVENT_DESKTOP_CACHE_UPDATE, _desks_update, cfdata);
- snprintf(buf, sizeof(buf), "%s/applications/defaults.list",
- efreet_data_home_get());
+ snprintf(buf, sizeof(buf), "%s/mimeapps.list",
+ efreet_config_home_get());
myini = efreet_ini_new(buf);
if (myini)
{
@@ -393,8 +393,8 @@ _basic_apply(E_Config_Dialog *cfd EINA_UNUSED, E_Config_Dialog_Data *cfdata)
if ((cfdata->terminal_desktop) && (cfdata->terminal_desktop[0]))
efreet_ini_string_set(cfdata->ini, "x-scheme-handler/terminal",
cfdata->terminal_desktop);
- snprintf(buf, sizeof(buf), "%s/applications/defaults.list",
- efreet_data_home_get());
+ snprintf(buf, sizeof(buf), "%s/mimeapps.list",
+ efreet_config_home_get());
efreet_ini_save(cfdata->ini, buf);
}
if ((cfdata->browser_custom) && (cfdata->browser_custom[0]))
diff --git a/src/modules/fileman/e_fwin.c b/src/modules/fileman/e_fwin.c
index 624fda642..208b6a92c 100644
--- a/src/modules/fileman/e_fwin.c
+++ b/src/modules/fileman/e_fwin.c
@@ -1238,8 +1238,8 @@ _e_fwin_suggested_apps_list_sort(const char *mime, Eina_List *desktops, Eina_Boo
Eina_List *order, *l;
Efreet_Desktop *desktop;
- snprintf(path, sizeof(path), "%s/applications/defaults.list",
- efreet_data_home_get());
+ snprintf(path, sizeof(path), "%s/mimeapps.list",
+ efreet_config_home_get());
order = _e_fwin_defaults_apps_get(mime, path);
if (!order)