forked from enlightenment/enlightenment
Use efreet_desktop_new where appropriate
efreet_desktop_get (will in time) setup a lot of stuff to monitor changes. If we just use the results from efreet_desktop_get within one function and then free, this is unneeded overhead. efreet_desktop_free will more lightweight (but require a bit more mem alloc). SVN revision: 46847
This commit is contained in:
parent
be71ec56a9
commit
66b667f273
|
@ -294,7 +294,7 @@ _load_modules(const char *dir, Eina_Hash *types_hash)
|
||||||
snprintf(modpath + modpathlen, sizeof(modpath) - modpathlen,
|
snprintf(modpath + modpathlen, sizeof(modpath) - modpathlen,
|
||||||
"%s/module.desktop", mod);
|
"%s/module.desktop", mod);
|
||||||
if (!ecore_file_exists(modpath)) goto end_mod;
|
if (!ecore_file_exists(modpath)) goto end_mod;
|
||||||
if (!(desk = efreet_desktop_get(modpath))) goto end_mod;
|
if (!(desk = efreet_desktop_new(modpath))) goto end_mod;
|
||||||
|
|
||||||
if (desk->x)
|
if (desk->x)
|
||||||
type = eina_hash_find(desk->x, "X-Enlightenment-ModuleType");
|
type = eina_hash_find(desk->x, "X-Enlightenment-ModuleType");
|
||||||
|
|
|
@ -386,7 +386,7 @@ _set_description(void *data, const char *name)
|
||||||
|
|
||||||
snprintf(buf, sizeof(buf), "%s/module.desktop", e_module_dir_get(mod));
|
snprintf(buf, sizeof(buf), "%s/module.desktop", e_module_dir_get(mod));
|
||||||
if (!ecore_file_exists(buf)) return;
|
if (!ecore_file_exists(buf)) return;
|
||||||
if (!(desk = efreet_desktop_get(buf))) return;
|
if (!(desk = efreet_desktop_new(buf))) return;
|
||||||
if (desk->comment)
|
if (desk->comment)
|
||||||
e_widget_textblock_markup_set(cfdata->o_desc, desk->comment);
|
e_widget_textblock_markup_set(cfdata->o_desc, desk->comment);
|
||||||
efreet_desktop_free(desk);
|
efreet_desktop_free(desk);
|
||||||
|
|
|
@ -379,7 +379,7 @@ e_module_dialog_show(E_Module *m, const char *title, const char *body)
|
||||||
|
|
||||||
snprintf(buf, sizeof(buf), "%s/module.desktop", e_module_dir_get(m));
|
snprintf(buf, sizeof(buf), "%s/module.desktop", e_module_dir_get(m));
|
||||||
|
|
||||||
desktop = efreet_desktop_get(buf);
|
desktop = efreet_desktop_new(buf);
|
||||||
if ((desktop) && (desktop->icon))
|
if ((desktop) && (desktop->icon))
|
||||||
{
|
{
|
||||||
icon = efreet_icon_path_find(e_config->icon_theme, desktop->icon, 64);
|
icon = efreet_icon_path_find(e_config->icon_theme, desktop->icon, 64);
|
||||||
|
|
|
@ -191,7 +191,7 @@ _ilist_fill(E_Config_Dialog_Data *cfdata)
|
||||||
}
|
}
|
||||||
pdir = e_config_profile_dir_get(prof);
|
pdir = e_config_profile_dir_get(prof);
|
||||||
snprintf(buf, sizeof(buf), "%s/profile.desktop", pdir);
|
snprintf(buf, sizeof(buf), "%s/profile.desktop", pdir);
|
||||||
desk = efreet_desktop_get(buf);
|
desk = efreet_desktop_new(buf);
|
||||||
if (!desk)
|
if (!desk)
|
||||||
{
|
{
|
||||||
e_prefix_data_snprintf(buf, sizeof(buf), "data/config/%s/", prof);
|
e_prefix_data_snprintf(buf, sizeof(buf), "data/config/%s/", prof);
|
||||||
|
@ -199,7 +199,7 @@ _ilist_fill(E_Config_Dialog_Data *cfdata)
|
||||||
if (pdir)
|
if (pdir)
|
||||||
{
|
{
|
||||||
snprintf(buf, sizeof(buf), "%s/profile.desktop", pdir);
|
snprintf(buf, sizeof(buf), "%s/profile.desktop", pdir);
|
||||||
desk = efreet_desktop_get(buf);
|
desk = efreet_desktop_new(buf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
label = prof;
|
label = prof;
|
||||||
|
@ -249,7 +249,7 @@ _ilist_cb_selected(void *data)
|
||||||
|
|
||||||
pdir = e_config_profile_dir_get(cfdata->sel_profile);
|
pdir = e_config_profile_dir_get(cfdata->sel_profile);
|
||||||
snprintf(buf, sizeof(buf), "%s/profile.desktop", pdir);
|
snprintf(buf, sizeof(buf), "%s/profile.desktop", pdir);
|
||||||
desk = efreet_desktop_get(buf);
|
desk = efreet_desktop_new(buf);
|
||||||
if (!desk)
|
if (!desk)
|
||||||
{
|
{
|
||||||
e_prefix_data_snprintf(buf, sizeof(buf), "data/config/%s/", cfdata->sel_profile);
|
e_prefix_data_snprintf(buf, sizeof(buf), "data/config/%s/", cfdata->sel_profile);
|
||||||
|
@ -257,7 +257,7 @@ _ilist_cb_selected(void *data)
|
||||||
if (pdir)
|
if (pdir)
|
||||||
{
|
{
|
||||||
snprintf(buf, sizeof(buf), "%s/profile.desktop", pdir);
|
snprintf(buf, sizeof(buf), "%s/profile.desktop", pdir);
|
||||||
desk = efreet_desktop_get(buf);
|
desk = efreet_desktop_new(buf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ _profile_change(void *data, Evas_Object *obj)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
snprintf(buf, sizeof(buf), "%s/profile.desktop", dir);
|
snprintf(buf, sizeof(buf), "%s/profile.desktop", dir);
|
||||||
desk = efreet_desktop_get(buf);
|
desk = efreet_desktop_new(buf);
|
||||||
if (desk)
|
if (desk)
|
||||||
e_widget_textblock_markup_set(textblock, desk->comment);
|
e_widget_textblock_markup_set(textblock, desk->comment);
|
||||||
else
|
else
|
||||||
|
@ -96,7 +96,7 @@ wizard_page_show(E_Wizard_Page *pg)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
snprintf(buf, sizeof(buf), "%s/profile.desktop", dir);
|
snprintf(buf, sizeof(buf), "%s/profile.desktop", dir);
|
||||||
desk = efreet_desktop_get(buf);
|
desk = efreet_desktop_new(buf);
|
||||||
label = prof;
|
label = prof;
|
||||||
if ((desk) && (desk->name)) label = desk->name;
|
if ((desk) && (desk->name)) label = desk->name;
|
||||||
snprintf(buf, sizeof(buf), "%s/icon.edj", dir);
|
snprintf(buf, sizeof(buf), "%s/icon.edj", dir);
|
||||||
|
|
|
@ -120,6 +120,7 @@ _app_write(App *a)
|
||||||
a->name, a->generic, a->comment, a->exec, a->icon);
|
a->name, a->generic, a->comment, a->exec, a->icon);
|
||||||
if (a->extra) fprintf(f, "%s\n", a->extra);
|
if (a->extra) fprintf(f, "%s\n", a->extra);
|
||||||
fclose(f);
|
fclose(f);
|
||||||
|
/* TODO: This will leak */
|
||||||
efreet_desktop_get(buf);
|
efreet_desktop_get(buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue