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 T6784

@fix
feature/wayland/multi-output
Carsten Haitzler 5 years ago
parent 55c8ac4625
commit a1994536a4
  1. 20
      src/bin/e_exehist.c
  2. 7
      src/bin/e_open.c
  3. 3
      src/bin/e_utils.c
  4. 8
      src/modules/conf_applications/e_int_config_defapps.c
  5. 4
      src/modules/fileman/e_fwin.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)

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

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

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

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

Loading…
Cancel
Save