e_int_config_profiles: When a profile gets deleted, also delete any

existing e_action for that profile.
This commit is contained in:
Christopher Michael 2021-01-20 14:48:34 -05:00
parent 3f2ddb4d1e
commit 361dc09285
1 changed files with 28 additions and 0 deletions

View File

@ -387,11 +387,39 @@ static void
_cb_dialog_yes(void *data)
{
Del_Profile_Confirm_Data *d;
Efreet_Desktop *desk = NULL;
char *pdir, buff[PATH_MAX];
const char *label;
d = data;
if (!data) return;
e_config_profile_del(d->cfdata->sel_profile);
pdir = e_config_profile_dir_get(d->cfdata->sel_profile);
snprintf(buff, sizeof(buff), "%s/profile.desktop", pdir);
desk = efreet_desktop_new(buff);
if (!desk)
{
e_prefix_data_snprintf(buff, sizeof(buff),
"data/config/%s/", d->cfdata->sel_profile);
free(pdir);
pdir = strdup(buff);
if (pdir)
{
snprintf(buff, sizeof(buff), "%s/profile.desktop", pdir);
desk = efreet_desktop_new(buff);
}
}
label = d->cfdata->sel_profile;
if ((desk) && (desk->name)) label = desk->name;
free(pdir);
if (desk) efreet_desktop_free(desk);
e_action_predef_name_del("Profile: Switch", label);
e_config_save_queue();
_ilist_fill(d->cfdata);
}