* estickies,

* etk,
	* PROTO/exalt,
	* E-MODULES-EXTRA/diskio,
	* E-MODULES-EXTRA/drawer,
	* E-MODULES-EXTRA/penguins,
	* E-MODULES-EXTRA/slideshow,
	* E-MODULES-EXTRA/mail,
	* E-MODULES-EXTRA/forecasts,
	* E-MODULES-EXTRA/iiirk,
	* E-MODULES-EXTRA/places,
	* e,
	* ewl,
	* ecore,
	* elitaire,
	* entrance,
	* e_dbus,
	* efreet: Here we go, move from Ecore_List to Eina_List.

	NOTE: This patch is huge, I did test it a lot, and I hope nothing is
	broken. But if you think something change after this commit, please
	contact me ASAP.


SVN revision: 39200
This commit is contained in:
Cedric BAIL 2009-02-25 11:03:47 +00:00
parent e0cfef818f
commit db419867dd
48 changed files with 804 additions and 1362 deletions

View File

@ -1074,7 +1074,7 @@ static int _cb_sort_files(char *f1, char *f2)
EAPI Eina_List *
e_config_profile_list(void)
{
Ecore_List *files;
Eina_List *files;
char buf[PATH_MAX];
const char *homedir;
const char *dir;
@ -1087,16 +1087,15 @@ e_config_profile_list(void)
{
char *file;
ecore_list_sort(files, ECORE_COMPARE_CB(_cb_sort_files), ECORE_SORT_MIN);
ecore_list_first_goto(files);
while ((file = ecore_list_current(files)))
files = eina_list_sort(files, 0, (Eina_Compare_Cb)_cb_sort_files);
EINA_LIST_FREE(files, file)
{
snprintf(buf, sizeof(buf), "%s/.e/e/config/%s", homedir, file);
if (ecore_file_is_dir(buf))
flist = eina_list_append(flist, strdup(file));
ecore_list_next(files);
flist = eina_list_append(flist, file);
else
free(file);
}
ecore_list_destroy(files);
}
dir = e_prefix_data_get();
snprintf(buf, sizeof(buf), "%s/data/config", dir);
@ -1105,24 +1104,24 @@ e_config_profile_list(void)
{
char *file;
ecore_list_sort(files, ECORE_COMPARE_CB(_cb_sort_files), ECORE_SORT_MIN);
ecore_list_first_goto(files);
while ((file = ecore_list_current(files)))
files = eina_list_sort(files, 0, (Eina_Compare_Cb)_cb_sort_files);
EINA_LIST_FREE(files, file)
{
const char *tmp;
Eina_List *l;
snprintf(buf, sizeof(buf), "%s/data/config/%s", dir, file);
if (ecore_file_is_dir(buf))
{
Eina_List *l;
EINA_LIST_FOREACH(flist, l, tmp)
if (!strcmp(file, tmp)) break;
for (l = flist; l; l = l->next)
{
if (!strcmp(file, l->data)) break;
if (!l) flist = eina_list_append(flist, file);
else free(file);
}
if (!l) flist = eina_list_append(flist, strdup(file));
else
free(file);
}
ecore_list_next(files);
}
ecore_list_destroy(files);
}
return flist;
}
@ -1141,7 +1140,7 @@ e_config_profile_add(const char *prof)
EAPI void
e_config_profile_del(const char *prof)
{
Ecore_List *files;
Eina_List *files;
char buf[4096];
const char *homedir;
@ -1152,15 +1151,13 @@ e_config_profile_del(const char *prof)
{
char *file;
ecore_list_first_goto(files);
while ((file = ecore_list_current(files)))
EINA_LIST_FREE(files, file)
{
snprintf(buf, sizeof(buf), "%s/.e/e/config/%s/%s",
homedir, prof, file);
ecore_file_unlink(buf);
ecore_list_next(files);
free(file);
}
ecore_list_destroy(files);
}
snprintf(buf, sizeof(buf), "%s/.e/e/config/%s", homedir, prof);
ecore_file_rmdir(buf);
@ -1417,181 +1414,127 @@ _e_config_save_cb(void *data)
static void
_e_config_free(E_Config *ecf)
{
if (!ecf) return;
while (ecf->modules)
{
E_Config_Binding_Signal *ebs;
E_Config_Binding_Mouse *ebm;
E_Config_Binding_Wheel *ebw;
E_Config_Syscon_Action *sca;
E_Config_Binding_Key *ebk;
E_Font_Fallback *eff;
E_Config_Module *em;
E_Font_Default *efd;
E_Config_Theme *et;
E_Color_Class *cc;
E_Path_Dir *epd;
E_Remember *rem;
em = ecf->modules->data;
ecf->modules = eina_list_remove_list(ecf->modules, ecf->modules);
if (!ecf) return;
EINA_LIST_FREE(ecf->modules, em)
{
if (em->name) eina_stringshare_del(em->name);
E_FREE(em);
}
while (ecf->font_fallbacks)
EINA_LIST_FREE(ecf->font_fallbacks, eff)
{
E_Font_Fallback *eff;
eff = ecf->font_fallbacks->data;
ecf->font_fallbacks = eina_list_remove_list(ecf->font_fallbacks, ecf->font_fallbacks);
if (eff->name) eina_stringshare_del(eff->name);
E_FREE(eff);
}
while (ecf->font_defaults)
EINA_LIST_FREE(ecf->font_defaults, efd)
{
E_Font_Default *efd;
efd = ecf->font_defaults->data;
ecf->font_defaults = eina_list_remove_list(ecf->font_defaults, ecf->font_defaults);
if (efd->text_class) eina_stringshare_del(efd->text_class);
if (efd->font) eina_stringshare_del(efd->font);
E_FREE(efd);
}
while (ecf->themes)
EINA_LIST_FREE(ecf->themes, et)
{
E_Config_Theme *et;
et = ecf->themes->data;
ecf->themes = eina_list_remove_list(ecf->themes, ecf->themes);
if (et->category) eina_stringshare_del(et->category);
if (et->file) eina_stringshare_del(et->file);
E_FREE(et);
}
while (ecf->mouse_bindings)
EINA_LIST_FREE(ecf->mouse_bindings, ebm)
{
E_Config_Binding_Mouse *eb;
eb = ecf->mouse_bindings->data;
ecf->mouse_bindings = eina_list_remove_list(ecf->mouse_bindings, ecf->mouse_bindings);
if (eb->action) eina_stringshare_del(eb->action);
if (eb->params) eina_stringshare_del(eb->params);
E_FREE(eb);
if (ebm->action) eina_stringshare_del(ebm->action);
if (ebm->params) eina_stringshare_del(ebm->params);
E_FREE(ebm);
}
while (ecf->key_bindings)
EINA_LIST_FREE(ecf->key_bindings, ebk)
{
E_Config_Binding_Key *eb;
eb = ecf->key_bindings->data;
ecf->key_bindings = eina_list_remove_list(ecf->key_bindings, ecf->key_bindings);
if (eb->key) eina_stringshare_del(eb->key);
if (eb->action) eina_stringshare_del(eb->action);
if (eb->params) eina_stringshare_del(eb->params);
E_FREE(eb);
if (ebk->key) eina_stringshare_del(ebk->key);
if (ebk->action) eina_stringshare_del(ebk->action);
if (ebk->params) eina_stringshare_del(ebk->params);
E_FREE(ebk);
}
while (ecf->signal_bindings)
EINA_LIST_FREE(ecf->signal_bindings, ebs)
{
E_Config_Binding_Signal *eb;
eb = ecf->signal_bindings->data;
ecf->signal_bindings = eina_list_remove_list(ecf->signal_bindings, ecf->signal_bindings);
if (eb->signal) eina_stringshare_del(eb->signal);
if (eb->source) eina_stringshare_del(eb->source);
if (eb->action) eina_stringshare_del(eb->action);
if (eb->params) eina_stringshare_del(eb->params);
E_FREE(eb);
if (ebs->signal) eina_stringshare_del(ebs->signal);
if (ebs->source) eina_stringshare_del(ebs->source);
if (ebs->action) eina_stringshare_del(ebs->action);
if (ebs->params) eina_stringshare_del(ebs->params);
E_FREE(ebs);
}
while (ecf->wheel_bindings)
EINA_LIST_FREE(ecf->wheel_bindings, ebw)
{
E_Config_Binding_Wheel *eb;
eb = ecf->wheel_bindings->data;
ecf->wheel_bindings = eina_list_remove_list(ecf->wheel_bindings, ecf->wheel_bindings);
if (eb->action) eina_stringshare_del(eb->action);
if (eb->params) eina_stringshare_del(eb->params);
E_FREE(eb);
if (ebw->action) eina_stringshare_del(ebw->action);
if (ebw->params) eina_stringshare_del(ebw->params);
E_FREE(ebw);
}
while (ecf->path_append_data)
EINA_LIST_FREE(ecf->path_append_data, epd)
{
E_Path_Dir *epd;
epd = ecf->path_append_data->data;
ecf->path_append_data = eina_list_remove_list(ecf->path_append_data, ecf->path_append_data);
if (epd->dir) eina_stringshare_del(epd->dir);
E_FREE(epd);
}
while (ecf->path_append_images)
EINA_LIST_FREE(ecf->path_append_images, epd)
{
E_Path_Dir *epd;
epd = ecf->path_append_images->data;
ecf->path_append_images = eina_list_remove_list(ecf->path_append_images, ecf->path_append_images);
if (epd->dir) eina_stringshare_del(epd->dir);
E_FREE(epd);
}
while (ecf->path_append_fonts)
EINA_LIST_FREE(ecf->path_append_fonts, epd)
{
E_Path_Dir *epd;
epd = ecf->path_append_fonts->data;
ecf->path_append_fonts = eina_list_remove_list(ecf->path_append_fonts, ecf->path_append_fonts);
if (epd->dir) eina_stringshare_del(epd->dir);
E_FREE(epd);
}
while (ecf->path_append_themes)
EINA_LIST_FREE(ecf->path_append_themes, epd)
{
E_Path_Dir *epd;
epd = ecf->path_append_themes->data;
ecf->path_append_themes = eina_list_remove_list(ecf->path_append_themes, ecf->path_append_themes);
if (epd->dir) eina_stringshare_del(epd->dir);
E_FREE(epd);
}
while (ecf->path_append_init)
EINA_LIST_FREE(ecf->path_append_init, epd)
{
E_Path_Dir *epd;
epd = ecf->path_append_init->data;
ecf->path_append_init = eina_list_remove_list(ecf->path_append_init, ecf->path_append_init);
if (epd->dir) eina_stringshare_del(epd->dir);
E_FREE(epd);
}
while (ecf->path_append_icons)
EINA_LIST_FREE(ecf->path_append_icons, epd)
{
E_Path_Dir *epd;
epd = ecf->path_append_icons->data;
ecf->path_append_icons = eina_list_remove_list(ecf->path_append_icons, ecf->path_append_icons);
if (epd->dir) eina_stringshare_del(epd->dir);
E_FREE(epd);
}
while (ecf->path_append_modules)
EINA_LIST_FREE(ecf->path_append_modules, epd)
{
E_Path_Dir *epd;
epd = ecf->path_append_modules->data;
ecf->path_append_modules = eina_list_remove_list(ecf->path_append_modules, ecf->path_append_modules);
if (epd->dir) eina_stringshare_del(epd->dir);
E_FREE(epd);
}
while (ecf->path_append_backgrounds)
EINA_LIST_FREE(ecf->path_append_backgrounds, epd)
{
E_Path_Dir *epd;
epd = ecf->path_append_backgrounds->data;
ecf->path_append_backgrounds = eina_list_remove_list(ecf->path_append_backgrounds, ecf->path_append_backgrounds);
if (epd->dir) eina_stringshare_del(epd->dir);
E_FREE(epd);
}
while (ecf->path_append_messages)
EINA_LIST_FREE(ecf->path_append_messages, epd)
{
E_Path_Dir *epd;
epd = ecf->path_append_messages->data;
ecf->path_append_messages = eina_list_remove_list(ecf->path_append_messages, ecf->path_append_messages);
if (epd->dir) eina_stringshare_del(epd->dir);
E_FREE(epd);
}
while (ecf->remembers)
EINA_LIST_FREE(ecf->remembers, rem)
{
E_Remember *rem;
rem = ecf->remembers->data;
ecf->remembers = eina_list_remove_list(ecf->remembers, ecf->remembers);
if (rem->name) eina_stringshare_del(rem->name);
if (rem->class) eina_stringshare_del(rem->class);
if (rem->title) eina_stringshare_del(rem->title);
if (rem->role) eina_stringshare_del(rem->role);
if (rem->prop.border) eina_stringshare_del(rem->prop.border);
if (rem->prop.command) eina_stringshare_del(rem->prop.command);
E_FREE(rem);
}
while (ecf->color_classes)
EINA_LIST_FREE(ecf->color_classes, cc)
{
E_Color_Class *cc;
cc = ecf->color_classes->data;
ecf->color_classes = eina_list_remove_list(ecf->color_classes, ecf->color_classes);
if (cc->name) eina_stringshare_del(cc->name);
E_FREE(cc);
}
@ -1611,17 +1554,13 @@ _e_config_free(E_Config *ecf)
if (ecf->wallpaper_import_last_path) eina_stringshare_del(ecf->wallpaper_import_last_path);
if (ecf->theme_default_border_style) eina_stringshare_del(ecf->theme_default_border_style);
if (ecf->desklock_custom_desklock_cmd) eina_stringshare_del(ecf->desklock_custom_desklock_cmd);
while (ecf->syscon.actions)
EINA_LIST_FREE(ecf->syscon.actions, sca)
{
E_Config_Syscon_Action *sca;
sca = ecf->syscon.actions->data;
if (sca->action) eina_stringshare_del(sca->action);
if (sca->params) eina_stringshare_del(sca->params);
if (sca->button) eina_stringshare_del(sca->button);
if (sca->icon) eina_stringshare_del(sca->icon);
E_FREE(sca);
ecf->syscon.actions = eina_list_remove_list(ecf->syscon.actions, ecf->syscon.actions);
}
E_FREE(ecf);
}

View File

@ -27,22 +27,22 @@ e_configure_init(void)
static void
_e_configure_efreet_desktop_update(void)
{
Ecore_List *settings_desktops, *system_desktops;
Eina_List *settings_desktops, *system_desktops;
Eina_List *remove_items = NULL;
Eina_List *remove_cats = NULL;
Eina_List *l;
Efreet_Desktop *desktop;
Eina_List *l, *ll, *remove_items = NULL, *remove_cats = NULL;
E_Configure_Cat *ecat;
void *data;
char buf[1024];
/* remove anything with a desktop entry */
for (l = e_configure_registry; l; l = l->next)
{
E_Configure_Cat *ecat;
ecat = l->data;
for (ll = ecat->items; ll; ll = ll->next)
EINA_LIST_FOREACH(e_configure_registry, l, ecat)
{
E_Configure_It *eci;
Eina_List *ll;
eci = ll->data;
EINA_LIST_FOREACH(ecat->items, ll, eci)
if (eci->desktop)
{
snprintf(buf, sizeof(buf), "%s/%s", ecat->cat, eci->item);
@ -50,18 +50,15 @@ _e_configure_efreet_desktop_update(void)
remove_cats = eina_list_append(remove_cats, strdup(ecat->cat));
}
}
}
while (remove_items)
EINA_LIST_FREE(remove_items, data)
{
e_configure_registry_item_del(remove_items->data);
free(remove_items->data);
remove_items = eina_list_remove_list(remove_items, remove_items);
e_configure_registry_item_del(data);
free(data);
}
while (remove_cats)
EINA_LIST_FREE(remove_cats, data)
{
e_configure_registry_category_del(remove_cats->data);
free(remove_cats->data);
remove_cats = eina_list_remove_list(remove_cats, remove_cats);
e_configure_registry_category_del(data);
free(data);
}
/* get desktops */
@ -70,8 +67,7 @@ _e_configure_efreet_desktop_update(void)
if ((!settings_desktops) || (!system_desktops)) return;
/* get ones in BOTH lists */
ecore_list_first_goto(settings_desktops);
while ((desktop = ecore_list_next(settings_desktops)))
EINA_LIST_FOREACH(settings_desktops, l, desktop)
{
char *s;
char *cfg_cat_name;
@ -82,7 +78,7 @@ _e_configure_efreet_desktop_update(void)
char *label;
int cfg_pri;
if (!ecore_list_goto(system_desktops, desktop)) continue;
if (!eina_list_data_find(system_desktops, desktop)) continue;
cfg_cat = NULL;
cfg_icon = NULL;
cfg_cat_cfg = NULL;
@ -237,61 +233,51 @@ e_configure_registry_generic_item_add(const char *path, int pri, const char *lab
EAPI void
e_configure_registry_item_del(const char *path)
{
E_Configure_Cat *ecat;
Eina_List *l;
char *cat;
const char *item;
char *cat;
/* path is "category/item" */
cat = ecore_file_dir_get(path);
if (!cat) return;
item = ecore_file_file_get(path);
for (l = e_configure_registry; l; l = l->next)
{
E_Configure_Cat *ecat;
ecat = l->data;
EINA_LIST_FOREACH(e_configure_registry, l, ecat)
if (!strcmp(cat, ecat->cat))
{
E_Configure_It *eci;
Eina_List *ll;
for (ll = ecat->items; ll; ll = ll->next)
{
E_Configure_It *eci;
eci = ll->data;
EINA_LIST_FOREACH(ecat->items, ll, eci)
if (!strcmp(item, eci->item))
{
ecat->items = eina_list_remove_list(ecat->items, ll);
eina_stringshare_del(eci->item);
eina_stringshare_del(eci->label);
eina_stringshare_del(eci->icon);
if (eci->icon_file) eina_stringshare_del(eci->icon_file);
if (eci->desktop) efreet_desktop_free(eci->desktop);
free(eci);
goto done;
break;
}
break;
}
goto done;
}
}
done:
free(cat);
}
EAPI void
e_configure_registry_category_add(const char *path, int pri, const char *label, const char *icon_file, const char *icon)
{
E_Configure_Cat *ecat2;
E_Configure_Cat *ecat;
Eina_List *l;
/* if it exists - ignore this */
for (l = e_configure_registry; l; l = l->next)
{
E_Configure_Cat *ecat2;
ecat2 = l->data;
EINA_LIST_FOREACH(e_configure_registry, l, ecat2)
if (!strcmp(ecat2->cat, path)) return;
}
ecat = E_NEW(E_Configure_Cat, 1);
if (!ecat) return;
@ -301,46 +287,37 @@ e_configure_registry_category_add(const char *path, int pri, const char *label,
ecat->label = eina_stringshare_add(label);
if (icon_file) ecat->icon_file = eina_stringshare_add(icon_file);
if (icon) ecat->icon = eina_stringshare_add(icon);
for (l = e_configure_registry; l; l = l->next)
{
E_Configure_Cat *ecat2;
ecat2 = l->data;
EINA_LIST_FOREACH(e_configure_registry, l, ecat2)
if (ecat2->pri > ecat->pri)
{
e_configure_registry = eina_list_prepend_relative_list(e_configure_registry, ecat, l);
return;
}
}
e_configure_registry = eina_list_append(e_configure_registry, ecat);
}
EAPI void
e_configure_registry_category_del(const char *path)
{
E_Configure_Cat *ecat;
Eina_List *l;
char *cat;
cat = ecore_file_dir_get(path);
if (!cat) return;
for (l = e_configure_registry; l; l = l->next)
{
E_Configure_Cat *ecat;
ecat = l->data;
EINA_LIST_FOREACH(e_configure_registry, l, ecat)
if (!strcmp(cat, ecat->cat))
{
if (ecat->items) goto done;
if (ecat->items) break;
e_configure_registry = eina_list_remove_list(e_configure_registry, l);
eina_stringshare_del(ecat->cat);
eina_stringshare_del(ecat->label);
if (ecat->icon) eina_stringshare_del(ecat->icon);
if (ecat->icon_file) eina_stringshare_del(ecat->icon_file);
free(ecat);
goto done;
break;
}
}
done:
free(cat);
}
@ -352,6 +329,7 @@ static struct {
EAPI void
e_configure_registry_call(const char *path, E_Container *con, const char *params)
{
E_Configure_Cat *ecat;
Eina_List *l;
char *cat;
const char *item;
@ -360,20 +338,13 @@ e_configure_registry_call(const char *path, E_Container *con, const char *params
cat = ecore_file_dir_get(path);
if (!cat) return;
item = ecore_file_file_get(path);
for (l = e_configure_registry; l; l = l->next)
{
E_Configure_Cat *ecat;
ecat = l->data;
EINA_LIST_FOREACH(e_configure_registry, l, ecat)
if (!strcmp(cat, ecat->cat))
{
E_Configure_It *eci;
Eina_List *ll;
for (ll = ecat->items; ll; ll = ll->next)
{
E_Configure_It *eci;
eci = ll->data;
EINA_LIST_FOREACH(ecat->items, ll, eci)
if (!strcmp(item, eci->item))
{
if (eci->func) eci->func(con, params);
@ -389,13 +360,11 @@ e_configure_registry_call(const char *path, E_Container *con, const char *params
e_exec(e_util_zone_current_get(con->manager),
eci->desktop, NULL, NULL, "config");
}
goto done;
break;
}
break;
}
goto done;
}
}
done:
free(cat);
}
@ -410,6 +379,7 @@ e_configure_registry_custom_desktop_exec_callback_set(void (*func) (const void *
EAPI int
e_configure_registry_exists(const char *path)
{
E_Configure_Cat *ecat;
Eina_List *l;
char *cat;
const char *item;
@ -419,35 +389,26 @@ e_configure_registry_exists(const char *path)
cat = ecore_file_dir_get(path);
if (!cat) return 0;
item = ecore_file_file_get(path);
for (l = e_configure_registry; l; l = l->next)
{
E_Configure_Cat *ecat;
ecat = l->data;
EINA_LIST_FOREACH(e_configure_registry, l, ecat)
if (!strcmp(cat, ecat->cat))
{
E_Configure_It *eci;
Eina_List *ll;
if (!item)
{
ret = 1;
goto done;
break;
}
for (ll = ecat->items; ll; ll = ll->next)
{
E_Configure_It *eci;
eci = ll->data;
EINA_LIST_FOREACH(ecat->items, ll, eci)
if (!strcmp(item, eci->item))
{
ret = 1;
goto done;
break;
}
break;
}
goto done;
}
}
done:
free(cat);
return ret;
}

View File

@ -358,6 +358,7 @@ _e_desktop_edit_basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfd
{
E_Desktop_Edit *editor;
Efreet_Desktop *desktop;
char *str;
editor = cfdata->editor;
desktop = editor->desktop;
@ -375,11 +376,12 @@ _e_desktop_edit_basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfd
IFFREE(cfdata->desktop->startup_wm_class);
IFDUP(cfdata->startup_wm_class, cfdata->desktop->startup_wm_class);
if (cfdata->desktop->categories)
ecore_list_destroy(cfdata->desktop->categories);
EINA_LIST_FREE(cfdata->desktop->categories, str)
eina_stringshare_del(str);
cfdata->desktop->categories = efreet_desktop_string_list_parse(cfdata->categories);
if (cfdata->desktop->mime_types)
ecore_list_destroy(cfdata->desktop->mime_types);
EINA_LIST_FREE(cfdata->desktop->mime_types, str)
eina_stringshare_del(str);
cfdata->desktop->mime_types = efreet_desktop_string_list_parse(cfdata->mimes);
IFFREE(cfdata->desktop->icon);

View File

@ -98,7 +98,7 @@ e_exec_shutdown(void)
EAPI E_Exec_Instance *
e_exec(E_Zone *zone, Efreet_Desktop *desktop, const char *exec,
Ecore_List *files, const char *launch_method)
Eina_List *files, const char *launch_method)
{
E_Exec_Launch *launch;
E_Exec_Instance *inst = NULL;
@ -367,15 +367,12 @@ static Evas_Bool
_e_exec_startup_id_pid_find(const Eina_Hash *hash __UNUSED__, const void *key __UNUSED__, void *value, void *data)
{
E_Exec_Search *search;
Eina_List *instances, *l;
E_Exec_Instance *inst;
Eina_List *l;
search = data;
instances = value;
for (l = instances; l; l = l->next)
{
E_Exec_Instance *inst;
inst = l->data;
EINA_LIST_FOREACH(value, l, inst)
if (((search->startup_id > 0) && (search->startup_id == inst->startup_id)) ||
((inst->exe) && (search->pid > 1) &&
(search->pid == ecore_exe_pid_get(inst->exe))))
@ -383,7 +380,7 @@ _e_exec_startup_id_pid_find(const Eina_Hash *hash __UNUSED__, const void *key __
search->desktop = inst->desktop;
return 0;
}
}
return 1;
}

View File

@ -20,7 +20,7 @@ struct _E_Exec_Instance
EAPI int e_exec_init(void);
EAPI int e_exec_shutdown(void);
EAPI E_Exec_Instance *e_exec(E_Zone *zone, Efreet_Desktop *desktop, const char *exec, Ecore_List *files, const char *launch_method);
EAPI E_Exec_Instance *e_exec(E_Zone *zone, Efreet_Desktop *desktop, const char *exec, Eina_List *files, const char *launch_method);
EAPI Efreet_Desktop *e_exec_startup_id_pid_find(int startup_id, pid_t pid);

View File

@ -2911,30 +2911,26 @@ static void
_e_fm2_queue_free(Evas_Object *obj)
{
E_Fm2_Smart_Data *sd;
E_Fm2_Icon *ic;
sd = evas_object_smart_data_get(obj);
if (!sd) return;
/* just free the icons in the queue and the queue itself */
while (sd->queue)
{
_e_fm2_icon_free(sd->queue->data);
sd->queue = eina_list_remove_list(sd->queue, sd->queue);
}
EINA_LIST_FREE(sd->queue, ic)
_e_fm2_icon_free(ic);
}
static void
_e_fm2_regions_free(Evas_Object *obj)
{
E_Fm2_Smart_Data *sd;
E_Fm2_Region *rg;
sd = evas_object_smart_data_get(obj);
if (!sd) return;
/* free up all regions */
while (sd->regions.list)
{
_e_fm2_region_free(sd->regions.list->data);
sd->regions.list = eina_list_remove_list(sd->regions.list, sd->regions.list);
}
EINA_LIST_FREE(sd->regions.list, rg)
_e_fm2_region_free(rg);
}
static void
@ -4217,12 +4213,8 @@ _e_fm2_region_free(E_Fm2_Region *rg)
{
E_Fm2_Icon *ic;
while (rg->list)
{
ic = rg->list->data;
EINA_LIST_FREE(rg->list, ic)
ic->region = NULL;
rg->list = eina_list_remove_list(rg->list, rg->list);
}
free(rg);
}
@ -7195,20 +7187,14 @@ _e_fm2_context_list_sort(const void *data1, const void *data2)
static void
_e_fm2_icon_menu_post_cb(void *data, E_Menu *m)
{
E_Fm2_Context_Menu_Data *md;
E_Fm2_Icon *ic;
ic = data;
ic->menu = NULL;
while (_e_fm2_menu_contexts)
{
E_Fm2_Context_Menu_Data *md;
md = _e_fm2_menu_contexts->data;
_e_fm2_menu_contexts = eina_list_remove_list(_e_fm2_menu_contexts,
_e_fm2_menu_contexts);
EINA_LIST_FREE(_e_fm2_menu_contexts, md)
E_FREE(md);
}
}
static void
_e_fm2_icon_menu_item_cb(void *data, E_Menu *m, E_Menu_Item *mi)
@ -8153,10 +8139,8 @@ _e_fm2_live_process_end(Evas_Object *obj)
E_Fm2_Action *a;
sd = evas_object_smart_data_get(obj);
while (sd->live.actions)
EINA_LIST_FREE(sd->live.actions, a)
{
a = sd->live.actions->data;
sd->live.actions = eina_list_remove_list(sd->live.actions, sd->live.actions);
eina_stringshare_del(a->file);
eina_stringshare_del(a->file2);
eina_stringshare_del(a->finf.lnk);

View File

@ -305,7 +305,8 @@ static void
_e_dbus_cb_dev_all(void *user_data, void *reply_data, DBusError *error)
{
E_Hal_Manager_Get_All_Devices_Return *ret = reply_data;
char *device;
Eina_List *l;
char *udi;
if (!ret || !ret->strings) return;
@ -315,13 +316,9 @@ _e_dbus_cb_dev_all(void *user_data, void *reply_data, DBusError *error)
return;
}
ecore_list_first_goto(ret->strings);
while ((device = ecore_list_next(ret->strings)))
EINA_LIST_FOREACH(ret->strings, l, udi)
{
// printf("DB INIT DEV+: %s\n", device);
char *udi;
udi = device;
// printf("DB INIT DEV+: %s\n", udi);
e_hal_device_query_capability(_e_dbus_conn, udi, "storage",
_e_dbus_cb_store_is, strdup(udi));
e_hal_device_query_capability(_e_dbus_conn, udi, "volume",
@ -333,6 +330,7 @@ static void
_e_dbus_cb_dev_store(void *user_data, void *reply_data, DBusError *error)
{
E_Hal_Manager_Find_Device_By_Capability_Return *ret = reply_data;
Eina_List *l;
char *device;
if (!ret || !ret->strings) return;
@ -343,8 +341,7 @@ _e_dbus_cb_dev_store(void *user_data, void *reply_data, DBusError *error)
return;
}
ecore_list_first_goto(ret->strings);
while ((device = ecore_list_next(ret->strings)))
EINA_LIST_FOREACH(ret->strings, l, device)
{
// printf("DB STORE+: %s\n", device);
e_storage_add(device);
@ -355,6 +352,7 @@ static void
_e_dbus_cb_dev_vol(void *user_data, void *reply_data, DBusError *error)
{
E_Hal_Manager_Find_Device_By_Capability_Return *ret = reply_data;
Eina_List *l;
char *device;
if (!ret || !ret->strings) return;
@ -365,8 +363,7 @@ _e_dbus_cb_dev_vol(void *user_data, void *reply_data, DBusError *error)
return;
}
ecore_list_first_goto(ret->strings);
while ((device = ecore_list_next(ret->strings)))
EINA_LIST_FOREACH(ret->strings, l, device)
{
// printf("DB VOL+: %s\n", device);
e_volume_add(device);
@ -856,7 +853,7 @@ e_volume_mount(E_Volume *v)
{
char buf[256];
char *mount_point;
Ecore_List *opt = NULL;
Eina_List *opt = NULL;
if (!v || !v->mount_point || strncmp(v->mount_point, "/media/", 7))
return;
@ -868,13 +865,12 @@ e_volume_mount(E_Volume *v)
// || (!strcmp(v->fstype, "iso9660")) || (!strcmp(v->fstype, "udf"))
)
{
opt = ecore_list_new();
snprintf(buf, sizeof(buf), "uid=%i", (int)getuid());
ecore_list_append(opt, buf);
opt = eina_list_append(opt, buf);
}
e_hal_device_volume_mount(_e_dbus_conn, v->udi, mount_point,
v->fstype, opt, NULL, v);
if (opt) ecore_list_destroy(opt);
opt = eina_list_free(opt);
}
static void
@ -1077,12 +1073,7 @@ _e_fm_monitor_start_try(E_Fm_Task *task)
}
fclose(f);
/* append whats left */
while (files)
{
f2 = eina_list_append(f2, files->data);
files = eina_list_remove_list(files, files);
}
files = f2;
files = eina_list_merge(f2, files);
}
}
ed->fq = files;
@ -1119,15 +1110,12 @@ _e_fm_monitor_start_try(E_Fm_Task *task)
static void
_e_fm_monitor_end(int id, const char *path)
{
Eina_List *l;
E_Fm_Task *task;
for (l = _e_dirs; l; l = l->next)
{
Eina_List *l;
E_Dir *ed;
EINA_LIST_FOREACH(_e_dirs, l, ed)
/* look for the dire entry to stop monitoring */
ed = l->data;
if ((id == ed->id) && (!strcmp(ed->dir, path)))
{
/* if this is not the real monitoring node - unref the
@ -1156,7 +1144,6 @@ _e_fm_monitor_end(int id, const char *path)
_e_dirs = eina_list_remove_list(_e_dirs, l);
break;
}
}
task = _e_fm_task_get(id);
if (task) _e_fm_task_remove(task);
@ -1173,18 +1160,13 @@ _e_fm_task_get(int id)
static Eina_List *
_e_fm_task_node_get(int id)
{
Eina_List *l = _e_fm_tasks;
E_Fm_Task *task;
Eina_List *l;
while (l)
{
task = eina_list_data_get(l);
EINA_LIST_FOREACH(_e_fm_tasks, l, task)
if (task->id == id)
return l;
l = eina_list_next(l);
}
return NULL;
}
@ -1722,11 +1704,7 @@ _e_cb_recent_clean(void *data)
ed = data;
ed->cleaning = 1;
t_now = ecore_time_get();
for (l = ed->recent_mods; l;)
{
m = l->data;
pl = l;
l = l->next;
EINA_LIST_FOREACH_SAFE(ed->recent_mods, pl, l, m)
if ((m->mod) && ((t_now - m->timestamp) >= DEF_MOD_BACKOFF))
{
ed->recent_mods = eina_list_remove_list(ed->recent_mods, pl);
@ -1734,7 +1712,6 @@ _e_cb_recent_clean(void *data)
eina_stringshare_del(m->path);
free(m);
}
}
ed->cleaning = 0;
if (ed->recent_mods) return 1;
ed->recent_clean = NULL;
@ -2020,18 +1997,15 @@ static char *
_e_str_list_remove(Eina_List **list, char *str)
{
Eina_List *l;
for (l = *list; l; l = l->next)
{
char *s;
s = l->data;
EINA_LIST_FOREACH(*list, l, s)
if (!strcmp(s, str))
{
*list = eina_list_remove_list(*list, l);
return s;
}
}
return NULL;
}
@ -2050,6 +2024,7 @@ _e_fm_reorder(const char *file, const char *dst, const char *relative, int after
{
FILE *forder;
Eina_List *files = NULL, *l;
char *str;
forder = fopen(order, "r");
if (forder)
@ -2067,23 +2042,21 @@ _e_fm_reorder(const char *file, const char *dst, const char *relative, int after
fclose(forder);
}
/* remove dest file from .order - if there */
for (l = files; l; l = l->next)
EINA_LIST_FOREACH(files, l, str)
if (!strcmp(str, file))
{
if (!strcmp(l->data, file))
{
free(l->data);
free(str);
files = eina_list_remove_list(files, l);
break;
}
}
/* now insert dest into list or replace entry */
for (l = files; l; l = l->next)
EINA_LIST_FOREACH(files, l, str)
{
if (!strcmp(l->data, relative))
if (!strcmp(str, relative))
{
if (after == 2) /* replace */
{
free(l->data);
free(str);
l->data = strdup(file);
}
else if (after == 0) /* before */
@ -2101,11 +2074,10 @@ _e_fm_reorder(const char *file, const char *dst, const char *relative, int after
forder = fopen(order, "w");
if (forder)
{
while (files)
EINA_LIST_FREE(files, str)
{
fprintf(forder, "%s\n", (char *)files->data);
free(files->data);
files = eina_list_remove_list(files, files);
fprintf(forder, "%s\n", str);
free(str);
}
fclose(forder);
}
@ -2115,24 +2087,20 @@ _e_fm_reorder(const char *file, const char *dst, const char *relative, int after
static void
_e_dir_del(E_Dir *ed)
{
void *data;
E_Mod *m;
eina_stringshare_del(ed->dir);
if (ed->idler) ecore_idler_del(ed->idler);
if (ed->recent_clean)
ecore_timer_del(ed->recent_clean);
while (ed->recent_mods)
EINA_LIST_FREE(ed->recent_mods, m)
{
E_Mod *m;
m = ed->recent_mods->data;
eina_stringshare_del(m->path);
free(m);
ed->recent_mods = eina_list_remove_list(ed->recent_mods, ed->recent_mods);
}
while (ed->fq)
{
free(ed->fq->data);
ed->fq = eina_list_remove_list(ed->fq, ed->fq);
}
EINA_LIST_FREE(ed->fq, data)
free(data);
free(ed);
}

View File

@ -359,7 +359,7 @@ e_fm2_mime_handler_glob_handlers_call_all(Evas_Object *obj, const char *path, co
}
/* run a handlers test function */
EAPI Evas_Bool
EAPI Eina_Bool
e_fm2_mime_handler_test(E_Fm2_Mime_Handler *handler, Evas_Object *obj, const char *path)
{
if ((!handler) || (!obj) || (!path)) return 0;

View File

@ -3473,11 +3473,12 @@ _e_gadcon_layout_smart_width_smart_sort_reverse_cb(const void *d1, const void *d
void
_e_gadcon_layout_smart_gadcons_width_adjust(E_Smart_Data *sd, int min, int cur)
{
E_Gadcon_Layout_Item *bi2 = NULL;
E_Gadcon_Layout_Item *bi = NULL;
Eina_List *l, *l2;
int need, limit, reduce_total, reduce;
int max_size;
int c;
Eina_List *l, *l2;
E_Gadcon_Layout_Item *bi, *bi2;
if (sd->horizontal)
{

View File

@ -444,6 +444,7 @@ _e_init_evas_new(Ecore_X_Window root, int w, int h, Ecore_X_Window *winret)
Ecore_Evas *ee;
Evas *e;
Eina_List *l;
const char *path;
if ((engine == 0) || (engine == 1))
{
@ -479,7 +480,7 @@ _e_init_evas_new(Ecore_X_Window root, int w, int h, Ecore_X_Window *winret)
evas_image_cache_set(e, 4096 * 1024);
evas_font_cache_set(e, 512 * 1024);
for (l = fpath; l; l = l->next) evas_font_path_append(e, l->data);
EINA_LIST_FOREACH(fpath, l, path) evas_font_path_append(e, l->data);
if (font_hinting == 0)
{

View File

@ -1095,7 +1095,8 @@ _e_border_menu_cb_ibar_add_pre(void *data, E_Menu *m, E_Menu_Item *mi)
{
E_Menu *sm;
E_Border *bd;
Ecore_List *dirs;
Eina_List *dirs;
Eina_List *l;
char buf[4096], *file;
const char *homedir;
@ -1106,7 +1107,7 @@ _e_border_menu_cb_ibar_add_pre(void *data, E_Menu *m, E_Menu_Item *mi)
if (!dirs) return;
sm = e_menu_new();
while ((file = ecore_list_next(dirs)))
EINA_LIST_FOREACH(dirs, l, file)
{
E_Menu_Item *smi;

View File

@ -17,7 +17,7 @@ struct _CFModule
struct _CFType
{
const char *key, *name, *icon;
Evas_Hash *modules;
Eina_Hash *modules;
};
struct _CFTypes
@ -241,15 +241,16 @@ _fill_type_hash(void)
static void
_load_modules(const char *dir)
{
Ecore_List *files = NULL;
Eina_List *files = NULL;
Eina_List *l;
char *mod = NULL;
char *file;
if (!dir) return;
if (!(files = ecore_file_ls(dir))) return;
/* get all modules in this path_dir */
ecore_list_first_goto(files);
while ((mod = ecore_list_next(files)))
EINA_LIST_FOREACH(files, l, mod)
{
Efreet_Desktop *desk = NULL;
CFType *cft = NULL;
@ -312,7 +313,8 @@ _load_modules(const char *dir)
eina_hash_direct_add(cft->modules, cfm->short_name, cfm);
}
free(mod);
if (files) ecore_list_destroy(files);
EINA_LIST_FREE(files, file)
free(file);
}
static void
@ -494,17 +496,17 @@ _list_widget_load(Evas_Object *obj, Eina_List *list)
{
Evas *evas;
Eina_List *ml = NULL;
CFModule *mod;
if ((!obj) || (!list)) return;
evas = evas_object_evas_get(obj);
for (ml = list; ml; ml = ml->next)
EINA_LIST_FOREACH(list, ml, mod)
{
CFModule *mod = NULL;
Evas_Object *ic = NULL;
char *path;
char buf[4096];
if (!(mod = ml->data)) continue;
if (!mod) continue;
if (mod->orig_path)
{
path = ecore_file_dir_get(mod->orig_path);

View File

@ -473,13 +473,13 @@ static void
_e_int_menus_apps_scan(E_Menu *m, Efreet_Menu *menu)
{
E_Menu_Item *mi;
Eina_List *l;
if (menu->entries)
{
Efreet_Menu *entry;
ecore_list_first_goto(menu->entries);
while ((entry = ecore_list_next(menu->entries)))
EINA_LIST_FOREACH(menu->entries, l, entry)
{
mi = e_menu_item_new(m);
@ -1149,20 +1149,15 @@ _e_int_menus_clients_item_create(E_Border *bd, E_Menu *m)
static void
_e_int_menus_clients_free_hook(void *obj)
{
Eina_List *borders;
E_Border *bd;
E_Menu *m;
Eina_List *borders = NULL;
m = obj;
borders = e_object_data_get(E_OBJECT(m));
while (borders)
{
E_Border *bd;
bd = borders->data;
borders = eina_list_remove_list(borders, borders);
EINA_LIST_FREE(borders, bd)
e_object_unref(E_OBJECT(bd));
}
}
static void
_e_int_menus_clients_item_cb(void *data, E_Menu *m, E_Menu_Item *mi)
@ -1262,20 +1257,15 @@ _e_int_menus_lost_clients_pre_cb(void *data, E_Menu *m)
static void
_e_int_menus_lost_clients_free_hook(void *obj)
{
Eina_List *borders;
E_Border *bd;
E_Menu *m;
Eina_List *borders = NULL;
m = obj;
borders = e_object_data_get(E_OBJECT(m));
while (borders)
{
E_Border *bd;
bd = borders->data;
borders = eina_list_remove_list(borders, borders);
EINA_LIST_FREE(borders, bd)
e_object_unref(E_OBJECT(bd));
}
}
static void
_e_int_menus_lost_clients_item_cb(void *data, E_Menu *m, E_Menu_Item *mi)
@ -1294,31 +1284,23 @@ _e_int_menus_lost_clients_item_cb(void *data, E_Menu *m, E_Menu_Item *mi)
static void
_e_int_menus_augmentation_add(E_Menu *m, Eina_List *augmentation)
{
Eina_List *l = NULL;
for (l = augmentation; l; l = l->next)
{
E_Int_Menu_Augmentation *aug;
Eina_List *l;
aug = l->data;
EINA_LIST_FOREACH(augmentation, l, aug)
if (aug->add.func) aug->add.func(aug->add.data, m);
}
}
static void
_e_int_menus_augmentation_del(E_Menu *m, Eina_List *augmentation)
{
Eina_List *l = NULL;
for (l = augmentation; l; l = l->next)
{
E_Int_Menu_Augmentation *aug;
Eina_List *l;
aug = l->data;
EINA_LIST_FOREACH(augmentation, l, aug)
if (aug->del.func) aug->del.func(aug->del.data, m);
}
}
static void
_e_int_menus_shelves_pre_cb(void *data, E_Menu *m)

View File

@ -278,23 +278,18 @@ e_intl_language_list(void)
Eina_List *next;
Eina_List *dir_list;
Eina_List *all_languages;
E_Path_Dir *epd;
all_languages = NULL;
dir_list = e_path_dir_list_get(path_messages);
for (next = dir_list ; next ; next = next->next)
EINA_LIST_FOREACH(dir_list, next, epd)
{
E_Path_Dir *epd;
Eina_List *dir_languages;
epd = next->data;
dir_languages = _e_intl_language_dir_scan(epd->dir);
while (dir_languages)
{
char *language;
language = dir_languages->data;
dir_languages = eina_list_remove_list(dir_languages, dir_languages);
dir_languages = _e_intl_language_dir_scan(epd->dir);
EINA_LIST_FREE(dir_languages, language)
if ((_e_intl_language_list_find(all_languages, language)) ||
((strlen(language) > 2) && (!_e_intl_locale_validate(language))))
{
@ -303,7 +298,6 @@ e_intl_language_list(void)
else
all_languages = eina_list_append(all_languages, language);
}
}
e_path_dir_list_free(dir_list);
@ -314,17 +308,13 @@ static int
_e_intl_language_list_find(Eina_List *language_list, char *language)
{
Eina_List *l;
char *lang;
if (!language_list) return 0;
if (!language) return 0;
for (l = language_list; l; l = l->next)
{
char *lang;
lang = l->data;
EINA_LIST_FOREACH(language_list, l, lang)
if (!strcmp(lang, language)) return 1;
}
return 0;
}
@ -387,32 +377,15 @@ e_intl_input_method_list(void)
{
Eina_List *input_methods;
Eina_List *im_list;
Eina_List *l;
char *imc_path;
im_list = NULL;
/* Personal Path */
input_methods = _e_intl_imc_dir_scan(e_intl_imc_personal_path_get());
for (l = input_methods; l; l = l->next)
{
imc_path = l->data;
im_list = eina_list_append(im_list, imc_path);
}
while (input_methods)
input_methods = eina_list_remove_list(input_methods, input_methods);
im_list = _e_intl_imc_dir_scan(e_intl_imc_personal_path_get());
/* System Path */
input_methods = _e_intl_imc_dir_scan(e_intl_imc_system_path_get());
for (l = input_methods; l; l = l->next)
{
imc_path = l->data;
im_list = eina_list_append(im_list, imc_path);
}
while (input_methods)
input_methods = eina_list_remove_list(input_methods, input_methods);
im_list = eina_list_merge(im_list, input_methods);
return im_list;
}
@ -488,6 +461,7 @@ static char *
_e_intl_language_path_find(char *language)
{
char *directory;
char *data;
Eina_List *dir_list;
Eina_List *search_list;
Eina_List *next_dir;
@ -527,13 +501,8 @@ _e_intl_language_path_find(char *language)
e_path_dir_list_free(dir_list);
while (search_list)
{
char *data;
data = search_list->data;
EINA_LIST_FREE(search_list, data)
free(data);
search_list = eina_list_remove_list(search_list, search_list);
}
return directory;
}
@ -542,7 +511,7 @@ static Eina_List *
_e_intl_language_dir_scan(const char *dir)
{
Eina_List *languages;
Ecore_List *files;
Eina_List *files;
char *file;
languages = NULL;
@ -550,19 +519,19 @@ _e_intl_language_dir_scan(const char *dir)
files = ecore_file_ls(dir);
if (!files) return NULL;
ecore_list_first_goto(files);
if (files)
{
while ((file = ecore_list_next(files)))
EINA_LIST_FREE(files, file)
{
char file_path[PATH_MAX];
snprintf(file_path, sizeof(file_path),"%s/%s/LC_MESSAGES/%s.mo",
dir, file, PACKAGE);
if (ecore_file_exists(file_path) && !ecore_file_is_dir(file_path))
languages = eina_list_append(languages, strdup(file));
languages = eina_list_append(languages, file);
else
free(file);
}
ecore_list_destroy(files);
}
return languages;
}
@ -579,7 +548,6 @@ _e_intl_locale_alias_get(const char *language)
Eina_Hash *alias_hash;
char *alias;
char *lower_language;
char *noenc_language;
int i;
if ((language == NULL) || (!strncmp(language, "POSIX", strlen("POSIX"))))
@ -906,6 +874,7 @@ _e_intl_locale_validate(const char *locale)
{
Eina_List *all_locales;
E_Locale_Parts *locale_parts;
char *locale_next;
char *locale_lr;
char *locale_cs_canonic;
int found;
@ -936,11 +905,7 @@ _e_intl_locale_validate(const char *locale)
all_locales = _e_intl_locale_system_locales_get();
/* Match locale with one from the list */
while (all_locales)
{
char *locale_next;
locale_next = all_locales->data;
EINA_LIST_FREE(all_locales, locale_next)
if (found == 0)
{
E_Locale_Parts *locale_parts_next;
@ -1009,9 +974,6 @@ _e_intl_locale_validate(const char *locale)
E_FREE(locale_lr_next);
}
all_locales = eina_list_remove_list(all_locales, all_locales);
free(locale_next);
}
e_intl_locale_parts_free(locale_parts);
free(locale_lr);
E_FREE(locale_cs_canonic);
@ -1055,19 +1017,13 @@ _e_intl_locale_search_order_get(const char *locale)
static Eina_List *
_e_intl_imc_dir_scan(const char *dir)
{
Eina_List *imcs;
Ecore_List *files;
Eina_List *imcs = NULL;
Eina_List *files;
char *file;
imcs = NULL;
files = ecore_file_ls(dir);
if (!files) return NULL;
ecore_list_first_goto(files);
if (files)
{
while ((file = ecore_list_next(files)))
EINA_LIST_FREE(files, file)
{
if (strstr(file, ".imc") != NULL)
{
@ -1076,8 +1032,8 @@ _e_intl_imc_dir_scan(const char *dir)
snprintf(buf, sizeof(buf), "%s/%s", dir, file);
imcs = eina_list_append(imcs, strdup(buf));
}
free(file);
}
ecore_list_destroy(files);
}
return imcs;
}

View File

@ -762,15 +762,15 @@ main(int argc, char **argv)
e_init_status_set(_("Setting up Paths"));
TS("efreet paths");
{
Ecore_List *list;
Eina_List *list;
list = efreet_icon_extra_list_get();
if (list)
{
snprintf(buf, sizeof(buf), "%s/.e/e/icons", e_user_homedir_get());
ecore_list_prepend(list, (void *)eina_stringshare_add(buf));
list = eina_list_prepend(list, (void *)eina_stringshare_add(buf));
snprintf(buf, sizeof(buf), "%s/data/icons", e_prefix_data_get());
ecore_list_prepend(list, (void *)eina_stringshare_add(buf));
list = eina_list_prepend(list, (void *)eina_stringshare_add(buf));
}
}
efreet_icon_extension_add(".edj");

View File

@ -1063,7 +1063,7 @@ _e_menu_item_free(E_Menu_Item *mi)
{
mi->submenu->parent_item = NULL;
e_object_unref(E_OBJECT(mi->submenu)); /* added on submenu_set() */
e_object_del(E_OBJECT(mi->submenu));
/* e_object_del(E_OBJECT(mi->submenu)); */
}
if (mi->menu->realized) _e_menu_item_unrealize(mi);
mi->menu->items = eina_list_remove(mi->menu->items, mi);

View File

@ -36,7 +36,7 @@ e_module_init(void)
EAPI int
e_module_shutdown(void)
{
Eina_List *l;
E_Module *m;
#ifdef HAVE_VALGRIND
/* do a leak check now before we dlclose() all those plugins, cause
@ -46,25 +46,18 @@ e_module_shutdown(void)
#endif
_e_modules = eina_list_reverse(_e_modules);
for (l = _e_modules; l; l = l->next)
{
E_Module *m;
m = l->data;
if ((m->enabled) && (!m->error))
EINA_LIST_FREE(_e_modules, m)
{
if (m && m->enabled && !m->error)
{
m->func.save(m);
m->func.shutdown(m);
m->enabled = 0;
}
e_object_del(E_OBJECT(m));
}
l = _e_modules;
_e_modules = NULL;
while (l)
{
e_object_del(E_OBJECT(l->data));
l = eina_list_remove_list(l, l);
}
return 1;
}
@ -469,13 +462,11 @@ e_module_priority_set(E_Module *m, int priority)
static void
_e_module_free(E_Module *m)
{
E_Config_Module *em;
Eina_List *l;
for (l = e_config->modules; l; l = l->next)
EINA_LIST_FOREACH(e_config->modules, l, em)
{
E_Config_Module *em;
em = l->data;
if (!em) continue;
if (!e_util_strcmp(em->name, m->name))
{

View File

@ -283,7 +283,8 @@ _e_prefix_share_hunt(void)
*/
if (!_prefix_path_data)
{
Ecore_List *files;
Eina_List *files;
Eina_List *l;
snprintf(buf, sizeof(buf), "%s", _prefix_path);
p = strrchr(buf, '/');
@ -293,8 +294,7 @@ _e_prefix_share_hunt(void)
{
char *file;
ecore_list_first_goto(files);
while ((file = ecore_list_current(files)))
EINA_LIST_FOREACH(files, l, file)
{
snprintf(buf2, sizeof(buf2), "%s/%s/"MAGIC_DAT, buf, file);
if (ecore_file_exists(buf2))
@ -305,9 +305,12 @@ _e_prefix_share_hunt(void)
_prefix_path_locale = strdup(buf2);
break;
}
ecore_list_next(files);
}
ecore_list_destroy(files);
while (files)
{
free(eina_list_data_get(files));
files = eina_list_remove_list(files, files);
}
}
}

View File

@ -618,7 +618,9 @@ e_util_shell_env_path_eval(char *path)
* $HOME/bin/$HOSTNAME/blah -> /home/user/bin/localhost/blah
* etc. etc.
*/
char buf[4096], *pd, *p, *v1, *v2, *s, *v, *vp;
char buf[4096], *pd, *p, *v2, *s, *vp;
char *v = NULL;
char *v1 = NULL;
int esc = 0, invar = 0;
for (p = path, pd = buf; (pd < (buf + sizeof(buf) - 1)); p++)

View File

@ -430,7 +430,7 @@ struct _Sys_Class_Power_Supply_Uevent
unsigned char have_current_now : 1;
};
static Ecore_List *events = NULL;
static Eina_List *events = NULL;
static Ecore_Timer *sys_class_delay_check = NULL;
static int
@ -451,18 +451,14 @@ linux_sys_class_power_supply_cb_re_init(void *data)
if (events)
{
while ((sysev = ecore_list_first_goto(events)))
EINA_LIST_FREE(events, sysev)
{
ecore_list_remove(events);
if (sysev->fd_handler)
ecore_main_fd_handler_del(sysev->fd_handler);
if (sysev->fd >= 0) close(sysev->fd);
free(sysev->name);
free(sysev);
}
ecore_list_destroy(events);
events = NULL;
}
linux_sys_class_power_supply_init();
re_init_timer = NULL;
@ -496,8 +492,7 @@ linux_sys_class_power_supply_cb_event_fd_active(void *data, Ecore_Fd_Handler *fd
}
if (lost)
{
ecore_list_goto(events, sysev);
ecore_list_remove(events);
events = eina_list_remove(events, sysev);
if (sysev->fd_handler)
ecore_main_fd_handler_del(sysev->fd_handler);
@ -631,32 +626,38 @@ linux_sys_class_power_supply_is_battery(char *name)
static void
linux_sys_class_power_supply_init(void)
{
Eina_List *l;
if (events)
{
Sys_Class_Power_Supply_Uevent *sysev;
ecore_list_first_goto(events);
while ((sysev = ecore_list_next(events)))
EINA_LIST_FOREACH(events, l, sysev)
linux_sys_class_power_supply_sysev_init(sysev);
}
else
{
Ecore_List *bats;
Eina_List *bats;
char *name;
char buf[4096];
bats = ecore_file_ls("/sys/class/power_supply/");
if (bats)
{
events = ecore_list_new();
while ((name = ecore_list_next(bats)))
events = NULL;
EINA_LIST_FREE(bats, name)
{
Sys_Class_Power_Supply_Uevent *sysev;
if (!(linux_sys_class_power_supply_is_battery(name)))
{
free(name);
continue;
}
sysev = E_NEW(Sys_Class_Power_Supply_Uevent, 1);
sysev->name = strdup(name);
sysev->name = name;
snprintf(buf, sizeof(buf), "/sys/class/power_supply/%s/uevent", name);
sysev->fd = open(buf, O_RDONLY);
if (sysev->fd >= 0)
@ -665,10 +666,9 @@ linux_sys_class_power_supply_init(void)
linux_sys_class_power_supply_cb_event_fd_active,
sysev,
NULL, NULL);
ecore_list_append(events, sysev);
events = eina_list_append(events, sysev);
linux_sys_class_power_supply_sysev_init(sysev);
}
ecore_list_destroy(bats);
}
}
}
@ -676,6 +676,7 @@ linux_sys_class_power_supply_init(void)
static void
linux_sys_class_power_supply_check(void)
{
Eina_List *l;
char *name;
char buf[4096];
@ -694,8 +695,7 @@ linux_sys_class_power_supply_check(void)
total_pwr_now = 0;
total_pwr_max = 0;
time_left = 0;
ecore_list_first_goto(events);
while ((sysev = ecore_list_next(events)))
EINA_LIST_FOREACH(events, l, sysev)
{
char *tmp;
int present = 0;
@ -944,8 +944,8 @@ linux_acpi_cb_event_fd_active(void *data, Ecore_Fd_Handler *fd_handler)
static void
linux_acpi_init(void)
{
Ecore_List *powers;
Ecore_List *bats;
Eina_List *powers;
Eina_List *bats;
bats = ecore_file_ls("/proc/acpi/battery");
if (bats)
@ -957,7 +957,8 @@ linux_acpi_init(void)
if (powers)
{
char *name;
while ((name = ecore_list_next(powers)))
EINA_LIST_FREE(powers, name)
{
char buf[4096];
FILE *f;
@ -977,14 +978,15 @@ linux_acpi_init(void)
free(tmp);
}
}
free(name);
}
ecore_list_destroy(powers);
}
have_battery = 0;
acpi_max_full = 0;
acpi_max_design = 0;
while ((name = ecore_list_next(bats)))
EINA_LIST_FREE(bats, name)
{
char buf[4096];
FILE *f;
@ -1021,8 +1023,9 @@ linux_acpi_init(void)
}
fclose(f);
}
free(name);
}
ecore_list_destroy(bats);
}
if (!acpid)
{
@ -1056,7 +1059,7 @@ linux_acpi_init(void)
static void
linux_acpi_check(void)
{
Ecore_List *bats;
Eina_List *bats;
battery_full = -1;
time_left = -1;
@ -1070,7 +1073,7 @@ linux_acpi_check(void)
int rate = 0;
int capacity = 0;
while ((name = ecore_list_next(bats)))
EINA_LIST_FREE(bats, name)
{
char buf[4096];
FILE *f;
@ -1120,8 +1123,9 @@ linux_acpi_check(void)
}
fclose(f);
}
free(name);
}
ecore_list_destroy(bats);
if (acpi_max_full > 0)
battery_full = 100 * (long long)capacity / acpi_max_full;
else if (acpi_max_design > 0)
@ -1267,7 +1271,7 @@ linux_pmu_check(void)
{
FILE *f;
char buf[4096];
Ecore_List *bats;
Eina_List *bats;
char *name;
int ac = 0;
int flags = 0;
@ -1295,7 +1299,7 @@ linux_pmu_check(void)
{
have_battery = 1;
have_power = ac;
while ((name = ecore_list_next(bats)))
EINA_LIST_FREE(bats, name)
{
if (strncmp(name, "battery", 7)) continue;
snprintf(buf, sizeof(buf), "/proc/pmu/%s", name);
@ -1345,8 +1349,9 @@ linux_pmu_check(void)
seconds = MAX(timeleft, seconds);
}
}
free(name);
}
ecore_list_destroy(bats);
if (max_charge > 0) battery_full = ((long long)charge * 100) / max_charge;
else battery_full = 0;
time_left = seconds;
@ -1381,17 +1386,16 @@ linux_pmu_check(void)
static int
dir_has_contents(const char *dir)
{
Ecore_List *bats;
bats = ecore_file_ls(dir);
if (bats)
{
Eina_List *bats;
char *file;
int count;
count = ecore_list_count(bats);
ecore_list_destroy(bats);
bats = ecore_file_ls(dir);
count = eina_list_count(bats);
EINA_LIST_FREE(bats, file)
free(file);
if (count > 0) return 1;
}
return 0;
}

View File

@ -354,6 +354,8 @@ static void
_battery_hal_shutdown(void)
{
E_DBus_Connection *conn;
Hal_Ac_Adapter *hac;
Hal_Battery *hbat;
conn = e_dbus_bus_get(DBUS_BUS_SYSTEM);
if (!conn) return;
@ -372,25 +374,17 @@ _battery_hal_shutdown(void)
e_dbus_signal_handler_del(conn, battery_config->hal.dev_del);
battery_config->hal.dev_del = NULL;
}
while (hal_ac_adapters)
EINA_LIST_FREE(hal_ac_adapters, hac)
{
Hal_Ac_Adapter *hac;
hac = hal_ac_adapters->data;
e_dbus_signal_handler_del(conn, hac->prop_change);
eina_stringshare_del(hac->udi);
free(hac);
hal_ac_adapters = eina_list_remove_list(hal_ac_adapters, hal_ac_adapters);
}
while (hal_batteries)
EINA_LIST_FREE(hal_batteries, hbat)
{
Hal_Battery *hbat;
hbat = hal_batteries->data;
e_dbus_signal_handler_del(conn, hbat->prop_change);
eina_stringshare_del(hbat->udi);
free(hbat);
hal_batteries = eina_list_remove_list(hal_batteries, hal_batteries);
}
}
@ -593,26 +587,27 @@ _battery_hal_ac_adapter_del(const char *udi)
static void
_battery_hal_find_battery(void *user_data, void *reply_data, DBusError *error)
{
Eina_List *l;
char *device;
E_Hal_Manager_Find_Device_By_Capability_Return *ret;
ret = reply_data;
if (ecore_list_count(ret->strings) < 1) return;
ecore_list_first_goto(ret->strings);
while ((device = ecore_list_next(ret->strings)))
if (eina_list_count(ret->strings) < 1) return;
EINA_LIST_FOREACH(ret->strings, l, device)
_battery_hal_battery_add(device);
}
static void
_battery_hal_find_ac(void *user_data, void *reply_data, DBusError *err)
{
Eina_List *l;
char *device;
E_Hal_Manager_Find_Device_By_Capability_Return *ret;
ret = reply_data;
if (ecore_list_count(ret->strings) < 1) return;
ecore_list_first_goto(ret->strings);
while ((device = ecore_list_next(ret->strings)))
if (eina_list_count(ret->strings) < 1) return;
EINA_LIST_FOREACH(ret->strings, l, device)
_battery_hal_ac_adapter_add(device);
}
@ -885,13 +880,11 @@ static void
_battery_update(int full, int time_left, int have_battery, int have_power)
{
Eina_List *l;
Instance *inst;
static double debounce_time = 0.0;
for (l = battery_config->instances; l; l = l->next)
EINA_LIST_FOREACH(battery_config->instances, l, inst)
{
Instance *inst;
inst = l->data;
if (have_power != battery_config->have_power)
{
if (have_power)

View File

@ -110,11 +110,8 @@ _gc_id_new(E_Gadcon_Client_Class *client_class)
static void
_cb_mouse_up(void *data, Evas *evas, Evas_Object *obj, void *event_info)
{
Evas_Event_Mouse_Up *ev;
E_Action *a;
ev = event_info;
if (ev->button != 1) return;
a = e_action_find("configuration");
if ((a) && (a->func.go)) a->func.go(NULL, NULL);
}

View File

@ -14,7 +14,7 @@ struct _E_Config_Dialog_Data
Evas_Object *o_all, *o_sel;
Evas_Object *o_add, *o_del;
Evas_Object *o_up, *o_down;
Ecore_List *apps;
Eina_List *apps;
};
/* local protos */
@ -23,8 +23,8 @@ static void *_create_data(E_Config_Dialog *cfd);
static void _free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
static Evas_Object *_basic_create(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata);
static int _basic_apply(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
static Ecore_List *_load_menu(const char *path);
static Ecore_List *_load_order(const char *path);
static Eina_List *_load_menu(const char *path);
static Eina_List *_load_order(const char *path);
static void _fill_apps(E_Config_Dialog_Data *cfdata);
static void _fill_list(E_Config_Dialog_Data *cfdata);
static int _cb_sort_desks(Efreet_Desktop *d1, Efreet_Desktop *d2);
@ -215,6 +215,7 @@ static void
_free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
{
E_Config_Data *data;
Efreet_Desktop *desktop;
data = cfdata->data;
if (data)
@ -225,7 +226,8 @@ _free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
if (data->filename) eina_stringshare_del(data->filename);
E_FREE(data);
}
if (cfdata->apps) ecore_list_destroy(cfdata->apps);
EINA_LIST_FREE(cfdata->apps, desktop)
efreet_desktop_free(desktop);
E_FREE(cfdata);
}
@ -295,44 +297,43 @@ _basic_apply(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
return ret;
}
static Ecore_List *
static Eina_List *
_load_menu(const char *path)
{
Efreet_Menu *menu, *entry;
Ecore_List *apps = NULL;
Eina_List *apps = NULL;
Eina_List *l;
apps = ecore_list_new();
ecore_list_free_cb_set(apps, ECORE_FREE_CB(efreet_desktop_free));
apps = NULL;
menu = efreet_menu_parse(path);
if ((!menu) || (!menu->entries)) return apps;
ecore_list_first_goto(menu->entries);
while ((entry = ecore_list_next(menu->entries)))
EINA_LIST_FOREACH(menu->entries, l, entry)
{
if (entry->type != EFREET_MENU_ENTRY_DESKTOP) continue;
efreet_desktop_ref(entry->desktop);
ecore_list_append(apps, entry->desktop);
apps = eina_list_append(apps, entry->desktop);
}
efreet_menu_free(menu);
return apps;
}
static Ecore_List *
static Eina_List *
_load_order(const char *path)
{
E_Order *order = NULL;
Eina_List *l = NULL;
Ecore_List *apps = NULL;
Eina_List *apps = NULL;
apps = ecore_list_new();
ecore_list_free_cb_set(apps, ECORE_FREE_CB(efreet_desktop_free));
apps = NULL;
if (!path) return apps;
order = e_order_new(path);
if (!order) return apps;
for (l = order->desktops; l; l = l->next)
{
efreet_desktop_ref(l->data);
ecore_list_append(apps, l->data);
apps = eina_list_append(apps, l->data);
}
/* FIXME: The test below will never be true ! */
if (l) eina_list_free(l);
e_object_del(E_OBJECT(order));
return apps;
@ -341,48 +342,42 @@ _load_order(const char *path)
static void
_fill_apps(E_Config_Dialog_Data *cfdata)
{
Ecore_List *desks = NULL, *l = NULL;
Eina_List *desks = NULL, *l = NULL;
Efreet_Desktop *desk = NULL;
Evas *evas;
int w;
l = ecore_list_new();
ecore_list_free_cb_set(l, ECORE_FREE_CB(efreet_desktop_free));
l = NULL;
evas = evas_object_evas_get(cfdata->o_all);
desks = efreet_util_desktop_name_glob_list("*");
if (desks)
desks = eina_list_sort(desks, 0, _cb_sort_desks);
EINA_LIST_FREE(desks, desk)
{
ecore_list_sort(desks, ECORE_COMPARE_CB(_cb_sort_desks), ECORE_SORT_MIN);
ecore_list_first_goto(desks);
while ((desk = ecore_list_next(desks)))
{
if (!ecore_list_find(l, ECORE_COMPARE_CB(_cb_sort_desks), desk))
if (!eina_list_search_unsorted(l, _cb_sort_desks, desk))
{
efreet_desktop_ref(desk);
ecore_list_append(l, desk);
l = eina_list_append(l, desk);
}
efreet_desktop_free(desk);
}
ecore_list_destroy(desks);
}
if (l) ecore_list_sort(l, ECORE_COMPARE_CB(_cb_sort_desks), ECORE_SORT_MIN);
l = eina_list_sort(l, 0, _cb_sort_desks);
evas_event_freeze(evas);
edje_freeze();
e_widget_ilist_freeze(cfdata->o_all);
e_widget_ilist_clear(cfdata->o_all);
if (l)
{
ecore_list_first_goto(l);
while ((desk = ecore_list_next(l)))
EINA_LIST_FREE(l, desk)
{
Evas_Object *icon = NULL;
icon = e_util_desktop_icon_add(desk, 24, evas);
e_widget_ilist_append(cfdata->o_all, icon, desk->name,
_all_list_cb_selected, cfdata, desk->orig_path);
}
ecore_list_destroy(l);
efreet_desktop_free(desk);
}
e_widget_ilist_go(cfdata->o_all);
@ -406,10 +401,8 @@ _fill_list(E_Config_Dialog_Data *cfdata)
edje_freeze();
e_widget_ilist_freeze(cfdata->o_sel);
e_widget_ilist_clear(cfdata->o_sel);
if (cfdata->apps)
{
ecore_list_first_goto(cfdata->apps);
while ((desk = ecore_list_next(cfdata->apps)))
EINA_LIST_FREE(cfdata->apps, desk)
{
Evas_Object *icon = NULL;
@ -417,8 +410,6 @@ _fill_list(E_Config_Dialog_Data *cfdata)
e_widget_ilist_append(cfdata->o_sel, icon, desk->name,
_sel_list_cb_selected, cfdata, desk->orig_path);
}
ecore_list_destroy(cfdata->apps);
}
cfdata->apps = NULL;
e_widget_ilist_go(cfdata->o_sel);

View File

@ -308,13 +308,13 @@ _basic_check_changed(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfda
Ecore_X_Screen_Refresh_Rate *rt;
r = e_widget_ilist_selected_get(cfdata->res_list);
if (r < 0) return;
if (r < 0) return 0;
res = evas_list_nth(cfdata->resolutions, r);
if (!res) return;
if (!res) return 0;
r = e_widget_ilist_selected_get(cfdata->rate_list);
if (r < 0) return;
if (r < 0) return 0;
rt = evas_list_nth(res->rates, r);
if (!rt) return;
if (!rt) return 0;
return (e_config->display_res_restore != cfdata->restore) ||
(res->size.width != cfdata->orig_size.width) ||

View File

@ -420,7 +420,7 @@ _basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
}
static Evas_Bool
_font_hash_cb(const Evas_Hash *hash __UNUSED__, const void *key __UNUSED__, void *data, void *fdata)
_font_hash_cb(const Eina_Hash *hash __UNUSED__, const void *key __UNUSED__, void *data, void *fdata)
{
E_Config_Dialog_Data *cfdata;
E_Font_Properties *efp;
@ -1034,7 +1034,7 @@ _font_list_load(E_Config_Dialog_Data *cfdata, const char *cur_font)
fonts = evas_font_available_list(evas);
cfdata->font_hash = e_font_available_list_parse(fonts);
evas_hash_foreach(cfdata->font_hash, _font_hash_cb, cfdata);
eina_hash_foreach(cfdata->font_hash, _font_hash_cb, cfdata);
if (cfdata->font_list)
{
cfdata->font_list =

View File

@ -62,20 +62,20 @@ e_int_config_icon_themes(E_Container *con, const char *params __UNUSED__)
static void
_fill_data(E_Config_Dialog_Data *cfdata)
{
Ecore_List *icon_themes;
Eina_List *icon_themes;
Eina_List *l;
icon_themes = efreet_icon_theme_list_get();
if (icon_themes)
{
Efreet_Icon_Theme *theme;
ecore_list_first_goto(icon_themes);
while ((theme = ecore_list_next(icon_themes)))
EINA_LIST_FOREACH(icon_themes, l, theme)
cfdata->icon_themes = eina_list_append(cfdata->icon_themes, theme);
cfdata->icon_themes = eina_list_sort(cfdata->icon_themes,
eina_list_count(cfdata->icon_themes),
_sort_icon_themes);
ecore_list_destroy(icon_themes);
icon_themes = eina_list_free(icon_themes);
}
cfdata->themename = strdup(e_config->icon_theme);
@ -338,9 +338,13 @@ _ilist_cb_change(void *data, Evas_Object *obj)
{
E_Config_Dialog_Data *cfdata;
Efreet_Icon_Theme *theme;
Eina_List *l;
char *dir = NULL;
char *text;
size_t length = 0, size = 4096;
const char *inherit;
char *path;
int first = 1;
cfdata = data;
if (!cfdata->gui.comment) return;
@ -360,28 +364,10 @@ _ilist_cb_change(void *data, Evas_Object *obj)
strcat(text, theme->comment);
strcat(text, "\n");
}
if (theme->paths.count == 1)
{
length += strlen(theme->paths.path) + 8;
while (length >= size)
{
size += 4096;
text = realloc(text, size);
}
dir = theme->paths.path;
strcat(text, "path = ");
strcat(text, dir);
strcat(text, "\n");
}
else if (theme->paths.count > 1)
{
char *path;
int first = 1;
ecore_list_first_goto(theme->paths.path);
while ((path = ecore_list_next(theme->paths.path)))
EINA_LIST_FOREACH(theme->paths, l, path)
{
length += strlen(theme->paths.path) + 16;
length += strlen(path) + 16;
while (length >= size)
{
size += 4096;
@ -400,17 +386,12 @@ _ilist_cb_change(void *data, Evas_Object *obj)
strcat(text, path);
}
}
strcat(text, "\n");
}
if (theme->inherits)
{
const char *inherit;
int first = 1;
if (theme->paths) strcat(text, "\n");
ecore_list_first_goto(theme->inherits);
while ((inherit = ecore_list_next(theme->inherits)))
first = 1;
EINA_LIST_FOREACH(theme->inherits, l, inherit)
{
length += strlen(theme->paths.path) + 32;
length += strlen(inherit) + 32;
while (length >= size)
{
size += 4096;
@ -428,8 +409,8 @@ _ilist_cb_change(void *data, Evas_Object *obj)
strcat(text, inherit);
}
}
strcat(text, "\n");
}
if (theme->inherits) strcat(text, "\n");
e_widget_textblock_plain_set(cfdata->gui.comment, text);
free(text);
if (dir)

View File

@ -1029,7 +1029,7 @@ _auto_apply_changes(E_Config_Dialog_Data *cfdata)
E_Action_Group *actg;
E_Action_Description *actd;
const char **action, **params;
const char **action = NULL, **params = NULL;
if ((!cfdata->locals.cur) || (!cfdata->locals.cur[0])) return;
@ -1345,7 +1345,7 @@ _grab_mouse_down_cb(void *data, int type, void *event)
{
Eina_List *l;
E_Config_Dialog_Data *cfdata;
E_Config_Binding_Mouse *eb;
E_Config_Binding_Mouse *eb = NULL;
E_Config_Binding_Wheel *bw;
int mod = E_BINDING_MODIFIER_NONE, n;

View File

@ -39,7 +39,8 @@ _cb_sort(const void *data1, const void *data2)
{
const E_Remember *rem1 = NULL;
const E_Remember *rem2 = NULL;
const char *d1, *d2;
const char *d1 = NULL;
const char *d2 = NULL;
if (!(rem1 = data1)) return 1;
if (!(rem2 = data2)) return -1;

View File

@ -45,7 +45,6 @@ static void _e_exebuf_next(void);
static void _e_exebuf_prev(void);
static void _e_exebuf_complete(void);
static void _e_exebuf_backspace(void);
static void _e_exebuf_delete(void);
static void _e_exebuf_clear(void);
static void _e_exebuf_matches_update(void);
static void _e_exebuf_hist_update(void);
@ -247,16 +246,14 @@ e_exebuf_show(E_Zone *zone)
el = e_config_domain_load("exebuf_exelist_cache", exelist_edd);
if (el)
{
while (el->list)
{
E_Exe *ee;
ee = el->list->data;
EINA_LIST_FREE(el->list, ee)
{
exe_list = eina_list_append(exe_list, strdup(ee->path));
eina_stringshare_del(ee->path);
free(ee);
el->list = eina_list_remove_list(el->list, el->list);
}
free(el);
}
@ -287,6 +284,9 @@ e_exebuf_show(E_Zone *zone)
EAPI void
e_exebuf_hide(void)
{
Ecore_Event *ev;
char *str;
if (!exebuf) return;
evas_event_freeze(exebuf->evas);
@ -317,11 +317,10 @@ e_exebuf_hide(void)
evas_event_thaw(exebuf->evas);
e_object_del(E_OBJECT(exebuf));
exebuf = NULL;
while (handlers)
{
ecore_event_handler_del(handlers->data);
handlers = eina_list_remove_list(handlers, handlers);
}
EINA_LIST_FREE(handlers, ev)
ecore_event_handler_del(ev);
ecore_x_window_del(input_window);
e_grabinput_release(input_window, input_window);
input_window = 0;
@ -332,26 +331,18 @@ e_exebuf_hide(void)
closedir(exe_dir);
exe_dir = NULL;
}
while (exe_path)
{
free(exe_path->data);
exe_path = eina_list_remove_list(exe_path, exe_path);
}
EINA_LIST_FREE(exe_path, str)
free(str);
if (exe_list_idler)
{
ecore_idler_del(exe_list_idler);
exe_list_idler = NULL;
}
while (exe_list)
{
free(exe_list->data);
exe_list = eina_list_remove_list(exe_list, exe_list);
}
while (exe_list2)
{
free(exe_list2->data);
exe_list2 = eina_list_remove_list(exe_list2, exe_list2);
}
EINA_LIST_FREE(exe_list, str)
free(str);
EINA_LIST_FREE(exe_list2, str)
free(str);
which_list = NO_LIST;
exe_sel = NULL;
}
@ -372,30 +363,22 @@ _e_exebuf_exe_free(E_Exebuf_Exe *exe)
static void
_e_exebuf_matches_clear(void)
{
while (eap_matches)
{
e_object_unref(E_OBJECT(eap_matches->data));
eap_matches = eina_list_remove_list(eap_matches, eap_matches);
}
while (exe_matches)
{
free(exe_matches->data);
exe_matches = eina_list_remove_list(exe_matches, exe_matches);
}
Efreet_Desktop *desktop;
E_Exebuf_Exe *exe;
char *file;
EINA_LIST_FREE(eap_matches, desktop)
e_object_unref(E_OBJECT(desktop));
EINA_LIST_FREE(exe_matches, file)
free(file);
evas_event_freeze(exebuf->evas);
e_box_freeze(eap_list_object);
e_box_freeze(exe_list_object);
while (exes)
{
_e_exebuf_exe_free((E_Exebuf_Exe *)(exes->data));
exes = eina_list_remove_list(exes, exes);
}
while (eaps)
{
_e_exebuf_exe_free((E_Exebuf_Exe *)(eaps->data));
eaps = eina_list_remove_list(eaps, eaps);
}
EINA_LIST_FREE(exes, exe)
_e_exebuf_exe_free(exe);
EINA_LIST_FREE(eaps, exe)
_e_exebuf_exe_free(exe);
e_box_thaw(exe_list_object);
e_box_thaw(eap_list_object);
evas_event_thaw(exebuf->evas);
@ -984,9 +967,11 @@ static void
_e_exebuf_matches_update(void)
{
char *path, *file, buf[4096];
Efreet_Desktop *desktop;
Eina_Hash *added = NULL;
Ecore_List *list;
Eina_List *list;
Eina_List *l;
char *exe;
int i, max;
_e_exebuf_matches_clear();
@ -994,15 +979,8 @@ _e_exebuf_matches_update(void)
snprintf(buf, sizeof(buf), "*%s*", cmd_buf);
list = efreet_util_desktop_name_glob_list(buf);
if (list)
EINA_LIST_FREE(list, desktop)
{
Efreet_Desktop *desktop;
ecore_list_first_goto(list);
while ((desktop = ecore_list_next(list)))
{
char *exe;
exe = ecore_file_app_exe_get(desktop->exec);
if (exe)
{
@ -1016,20 +994,11 @@ _e_exebuf_matches_update(void)
free(exe);
}
}
ecore_list_destroy(list);
}
snprintf(buf, sizeof(buf), "%s*", cmd_buf);
list = efreet_util_desktop_exec_glob_list(buf);
if (list)
EINA_LIST_FREE(list, desktop)
{
Efreet_Desktop *desktop;
ecore_list_first_goto(list);
while ((desktop = ecore_list_next(list)))
{
char *exe;
exe = ecore_file_app_exe_get(desktop->exec);
if (exe)
{
@ -1043,20 +1012,11 @@ _e_exebuf_matches_update(void)
free(exe);
}
}
ecore_list_destroy(list);
}
snprintf(buf, sizeof(buf), "*%s*", cmd_buf);
list = efreet_util_desktop_generic_name_glob_list(buf);
if (list)
EINA_LIST_FREE(list, desktop)
{
Efreet_Desktop *desktop;
ecore_list_first_goto(list);
while ((desktop = ecore_list_next(list)))
{
char *exe;
exe = ecore_file_app_exe_get(desktop->exec);
if (exe)
{
@ -1070,20 +1030,11 @@ _e_exebuf_matches_update(void)
free(exe);
}
}
ecore_list_destroy(list);
}
snprintf(buf, sizeof(buf), "*%s*", cmd_buf);
list = efreet_util_desktop_comment_glob_list(buf);
if (list)
EINA_LIST_FREE(list, desktop)
{
Efreet_Desktop *desktop;
ecore_list_first_goto(list);
while ((desktop = ecore_list_next(list)))
{
char *exe;
exe = ecore_file_app_exe_get(desktop->exec);
if (exe)
{
@ -1097,20 +1048,13 @@ _e_exebuf_matches_update(void)
free(exe);
}
}
ecore_list_destroy(list);
}
if (added) eina_hash_free(added);
added = NULL;
snprintf(buf, sizeof(buf), "%s*", cmd_buf);
if (exe_list)
EINA_LIST_FOREACH(exe_list, l, path)
{
Eina_List *l;
for (l = exe_list; l; l = l->next)
{
path = l->data;
file = (char *)ecore_file_file_get(path);
if (file)
{
@ -1126,7 +1070,6 @@ _e_exebuf_matches_update(void)
}
}
}
}
if (added) eina_hash_free(added);
added = NULL;
@ -1239,18 +1182,19 @@ _e_exebuf_matches_update(void)
static void
_e_exebuf_hist_update(void)
{
Eina_List *list = NULL, *l = NULL;
Eina_List *list;
char *file;
edje_object_signal_emit(bg_object, "e,action,show,history", "e");
list = eina_list_reverse(e_exehist_list_get());
for (l = list; l; l = l->next)
EINA_LIST_FREE(list, file)
{
E_Exebuf_Exe *exe;
Evas_Coord mw, mh;
Evas_Object *o;
exe = calloc(1, sizeof(E_Exebuf_Exe));
exe->file = l->data;
exe->file = file;
eaps = eina_list_prepend(eaps, exe);
o = edje_object_add(exebuf->evas);
exe->bg_object = o;
@ -1286,21 +1230,19 @@ _e_exebuf_hist_update(void)
9999, mh /* max */
);
}
eina_list_free(list);
}
static void
_e_exebuf_hist_clear(void)
{
E_Exebuf_Exe *exe;
edje_object_signal_emit(bg_object, "e,action,hide,history", "e");
evas_event_freeze(exebuf->evas);
e_box_freeze(eap_list_object);
e_box_freeze(exe_list_object);
while (eaps)
{
_e_exebuf_exe_free((E_Exebuf_Exe *)(eaps->data));
eaps = eina_list_remove_list(eaps, eaps);
}
EINA_LIST_FREE(eaps, exe)
_e_exebuf_exe_free(exe);
e_box_thaw(exe_list_object);
e_box_thaw(eap_list_object);
evas_event_thaw(exebuf->evas);
@ -1309,7 +1251,6 @@ _e_exebuf_hist_clear(void)
e_box_align_set(exe_list_object, 0.5, 1.0);
exe_sel = NULL;
which_list = NO_LIST;
}
static void
@ -1397,7 +1338,7 @@ _e_exebuf_cb_key_down(void *data, int type, void *event)
else if (!strcmp(ev->keysymbol, "BackSpace"))
_e_exebuf_backspace();
else if (!strcmp(ev->keysymbol, "Delete"))
_e_exebuf_delete();
_e_exebuf_backspace();
else
{
if (ev->key_compose)
@ -1598,7 +1539,7 @@ _e_exebuf_idler(void *data)
{
while (exe_list)
{
free(exe_list->data);
free(eina_list_data_get(exe_list));
exe_list = eina_list_remove_list(exe_list, exe_list);
}
exe_list = exe_list2;
@ -1622,7 +1563,7 @@ _e_exebuf_idler(void *data)
e_config_domain_save("exebuf_exelist_cache", exelist_edd, el);
while (el->list)
{
ee = el->list->data;
ee = eina_list_data_get(el->list);
eina_stringshare_del(ee->path);
free(ee);
el->list = eina_list_remove_list(el->list, el->list);
@ -1669,14 +1610,14 @@ _e_exebuf_idler(void *data)
*/
closedir(exe_dir);
exe_dir = NULL;
free(exe_path->data);
free(eina_list_data_get(exe_path));
exe_path = eina_list_remove_list(exe_path, exe_path);
}
}
/* obviously the dir open failed - so remove the first path item */
else
{
free(exe_path->data);
free(eina_list_data_get(exe_path));
exe_path = eina_list_remove_list(exe_path, exe_path);
}
/* we have mroe scannign to do */

View File

@ -125,15 +125,10 @@ e_fwin_init(void)
EAPI int
e_fwin_shutdown(void)
{
Eina_List *l;
E_Fwin *fwin;
l = fwins;
fwins = NULL;
while (l)
{
e_object_del(E_OBJECT(l->data));
l = eina_list_remove_list(l, l);
}
EINA_LIST_FREE(fwins, fwin)
e_object_del(E_OBJECT(fwin));
eina_stringshare_shutdown();
@ -248,12 +243,10 @@ EAPI void
e_fwin_zone_shutdown(E_Zone *zone)
{
Eina_List *f;
for (f = fwins; f; f = f->next)
{
E_Fwin *win;
win = f->data;
EINA_LIST_FOREACH(fwins, f, win)
{
if (win->zone != zone) continue;
e_object_del(E_OBJECT(win));
win = NULL;
@ -264,15 +257,14 @@ EAPI void
e_fwin_reload_all(void)
{
Eina_List *l, *ll, *lll;
E_Manager *man;
E_Container *con;
E_Manager *man;
E_Fwin *fwin;
E_Zone *zone;
/* Reload/recreate zones cause of property changes */
for (l = fwins; l; l = l->next)
EINA_LIST_FOREACH(fwins, l, fwin)
{
E_Fwin *fwin;
fwin = l->data;
if (!fwin) continue; //safety
if (fwin->zone)
e_fwin_zone_shutdown(fwin->zone);
@ -285,17 +277,10 @@ e_fwin_reload_all(void)
}
/* Hook into zones */
for (l = e_manager_list(); l; l = l->next)
EINA_LIST_FOREACH(e_manager_list(), l, man)
EINA_LIST_FOREACH(man->containers, ll, con)
EINA_LIST_FOREACH(con->zones, lll, zone)
{
man = l->data;
for (ll = man->containers; ll; ll = ll->next)
{
con = ll->data;
for (lll = con->zones; lll; lll = lll->next)
{
E_Zone *zone;
zone = lll->data;
if (e_fwin_zone_find(zone)) continue;
if ((zone->container->num == 0) && (zone->num == 0) &&
(fileman_config->view.show_desktop_icons))
@ -313,21 +298,15 @@ e_fwin_reload_all(void)
}
}
}
}
}
EAPI int
e_fwin_zone_find(E_Zone *zone)
{
Eina_List *f;
for (f = fwins; f; f = f->next)
{
E_Fwin *win;
win = f->data;
EINA_LIST_FOREACH(fwins, f, win)
if (win->zone == zone) return 1;
}
return 0;
}
@ -820,7 +799,8 @@ _e_fwin_cb_open(void *data, E_Dialog *dia)
char pcwd[4096], buf[4096];
Eina_List *selected, *l;
E_Fm2_Icon_Info *ici;
Ecore_List *files = NULL;
Eina_List *files = NULL;
char *file;
fad = data;
if (fad->app1)
@ -838,8 +818,7 @@ _e_fwin_cb_open(void *data, E_Dialog *dia)
selected = e_fm2_selected_list_get(fad->fwin->fm_obj);
if (selected)
{
files = ecore_list_new();
ecore_list_free_cb_set(files, free);
files = NULL;
for (l = selected; l; l = l->next)
{
E_Fwin_Exec_Type ext;
@ -873,7 +852,7 @@ _e_fwin_cb_open(void *data, E_Dialog *dia)
{
if (ici->mime && desktop)
e_exehist_mime_desktop_add(ici->mime, desktop);
ecore_list_append(files, strdup(ici->file));
files = eina_list_append(files, strdup(ici->file));
}
}
eina_list_free(selected);
@ -901,7 +880,8 @@ _e_fwin_cb_open(void *data, E_Dialog *dia)
if (!strcmp(fad->exec_cmd, ""))
efreet_desktop_free(desktop);
ecore_list_destroy(files);
EINA_LIST_FREE(files, file)
free(file);
}
chdir(pcwd);
}
@ -1073,14 +1053,16 @@ _e_fwin_file_open_dialog(E_Fwin *fwin, Eina_List *files, int always)
Evas_Coord mw, mh;
Evas_Object *o, *of, *oi, *ot;
Evas *evas;
Eina_List *l = NULL, *apps = NULL, *mlist = NULL;
Ecore_List *cats = NULL;
Eina_List *l = NULL, *ll, *apps = NULL, *mlist = NULL;
Eina_List *ml;
Eina_List *cats = NULL;
Eina_Hash *mimes = NULL;
Efreet_Desktop *desk = NULL;
E_Fwin_Apps_Dialog *fad;
E_Fm2_Icon_Info *ici;
char buf[PATH_MAX];
const char *f;
char *mime;
int need_dia = 0;
if (fwin->fad)
@ -1090,9 +1072,8 @@ _e_fwin_file_open_dialog(E_Fwin *fwin, Eina_List *files, int always)
}
if (!always)
{
for (l = files; l; l = l->next)
EINA_LIST_FOREACH(files, l, ici)
{
ici = l->data;
if ((ici->link) && (ici->mount))
{
if (!fileman_config->view.open_dirs_in_place || fwin->zone)
@ -1288,9 +1269,7 @@ _e_fwin_file_open_dialog(E_Fwin *fwin, Eina_List *files, int always)
}
/* 1. build hash of mimetypes */
for (l = files; l; l = l->next)
{
ici = l->data;
EINA_LIST_FOREACH(files, l, ici)
if (!((ici->link) && (ici->mount)))
{
if (_e_fwin_file_is_exec(ici) == E_FWIN_EXEC_NONE)
@ -1314,7 +1293,6 @@ _e_fwin_file_open_dialog(E_Fwin *fwin, Eina_List *files, int always)
}
}
}
}
/* 2. for each mimetype list apps that handle it */
if (mimes)
{
@ -1323,21 +1301,10 @@ _e_fwin_file_open_dialog(E_Fwin *fwin, Eina_List *files, int always)
}
/* 3. add apps to a list so its a unique app list */
apps = NULL;
if (mlist)
EINA_LIST_FOREACH(mlist, l, mime)
{
Ecore_List *ml;
for (l = mlist; l; l = l->next)
{
ml = efreet_util_desktop_mime_list(l->data);
if (ml)
{
ecore_list_first_goto(ml);
while ((desk = ecore_list_next(ml)))
apps = eina_list_append(apps, desk);
ecore_list_destroy(ml);
}
}
ml = efreet_util_desktop_mime_list(mime);
apps = eina_list_merge(apps, ml);
}
if (!always)
@ -1358,27 +1325,23 @@ _e_fwin_file_open_dialog(E_Fwin *fwin, Eina_List *files, int always)
*/
if (eina_list_count(mlist) <= 1)
{
char *file;
char pcwd[4096];
Ecore_List *files_list = NULL;
Eina_List *files_list = NULL;
need_dia = 1;
if (mlist) desk = e_exehist_mime_desktop_get(mlist->data);
getcwd(pcwd, sizeof(pcwd));
chdir(e_fm2_real_path_get(fwin->fm_obj));
files_list = ecore_list_new();
ecore_list_free_cb_set(files_list, free);
for (l = files; l; l = l->next)
{
ici = l->data;
files_list = NULL;
EINA_LIST_FOREACH(files, l, ici)
if (_e_fwin_file_is_exec(ici) == E_FWIN_EXEC_NONE)
ecore_list_append(files_list, strdup(ici->file));
}
for (l = files; l; l = l->next)
files_list = eina_list_append(files_list, strdup(ici->file));
EINA_LIST_FOREACH(files, l, ici)
{
E_Fwin_Exec_Type ext;
ici = l->data;
ext = _e_fwin_file_is_exec(ici);
if (ext != E_FWIN_EXEC_NONE)
{
@ -1399,18 +1362,19 @@ _e_fwin_file_open_dialog(E_Fwin *fwin, Eina_List *files, int always)
need_dia = 0;
}
}
ecore_list_destroy(files_list);
EINA_LIST_FREE(files_list, file)
free(file);
chdir(pcwd);
if (!need_dia)
{
if (apps) eina_list_free(apps);
eina_list_free(mlist);
apps = eina_list_free(apps);
mlist = eina_list_free(mlist);
return;
}
}
}
if (mlist) eina_list_free(mlist);
mlist = eina_list_free(mlist);
fad = E_NEW(E_Fwin_Apps_Dialog, 1);
if (fwin->win)
@ -1462,7 +1426,7 @@ _e_fwin_file_open_dialog(E_Fwin *fwin, Eina_List *files, int always)
e_widget_table_object_append(ot, of, 0, 0, 1, 1, 1, 1, 1, 1);
}
if (l) eina_list_free(l);
l = eina_list_free(l);
of = e_widget_framelist_add(evas, _("All Applications"), 0);
o = e_widget_ilist_add(evas, 24, 24, &(fad->app2));
@ -1472,29 +1436,22 @@ _e_fwin_file_open_dialog(E_Fwin *fwin, Eina_List *files, int always)
edje_freeze();
e_widget_ilist_freeze(o);
cats = efreet_util_desktop_name_glob_list("*");
ecore_list_sort(cats, ECORE_COMPARE_CB(_e_fwin_dlg_cb_desk_sort), ECORE_SORT_MIN);
ecore_list_first_goto(cats);
while ((desk = ecore_list_next(cats)))
{
cats = eina_list_sort(cats, 0, _e_fwin_dlg_cb_desk_sort);
EINA_LIST_FREE(cats, desk)
if (!eina_list_data_find(l, desk))
l = eina_list_append(l, desk);
}
if (cats) ecore_list_destroy(cats);
if (l) l = eina_list_sort(l, -1, _e_fwin_dlg_cb_desk_list_sort);
l = eina_list_sort(l, -1, _e_fwin_dlg_cb_desk_list_sort);
/* reuse mlist var here */
for (mlist = l; mlist; mlist = mlist->next)
EINA_LIST_FREE(mlist, desk)
{
Evas_Object *icon = NULL;
desk = mlist->data;
if (!desk) continue;
icon = e_util_desktop_icon_add(desk, 24, evas);
e_widget_ilist_append(o, icon, desk->name, NULL, NULL,
efreet_util_path_to_file_id(desk->orig_path));
}
if (mlist) eina_list_free(mlist);
if (l) eina_list_free(l);
e_widget_ilist_go(o);
e_widget_ilist_thaw(o);

View File

@ -45,8 +45,6 @@ Manager *Man = NULL;
void
gadman_init(E_Module *m)
{
Eina_List *l;
/* Create Manager */
Man = calloc(1, sizeof(Manager));
if (!Man) return;

View File

@ -260,23 +260,18 @@ _cb_confirm_dialog_destroy(void *data)
static void
_load_tlist(E_Config_Dialog_Data *cfdata)
{
Ecore_List *dirs;
Eina_List *dirs;
const char *home;
char buf[4096], *file;
int selnum = -1;
int i = 0;
e_widget_ilist_clear(cfdata->tlist);
home = e_user_homedir_get();
snprintf(buf, sizeof(buf), "%s/.e/e/applications/bar", home);
dirs = ecore_file_ls(buf);
if (dirs)
{
int i;
i = 0;
while ((file = ecore_list_next(dirs)))
EINA_LIST_FREE(dirs, file)
{
if (file[0] == '.') continue;
snprintf(buf, sizeof(buf), "%s/.e/e/applications/bar/%s", home, file);
@ -287,9 +282,10 @@ _load_tlist(E_Config_Dialog_Data *cfdata)
selnum = i;
i++;
}
free(file);
}
ecore_list_destroy(dirs);
}
e_widget_ilist_go(cfdata->tlist);
if (selnum >= 0)
e_widget_ilist_selected_set(cfdata->tlist, selnum);

View File

@ -803,16 +803,11 @@ E_Slipshelf *local_slipshelf = NULL;
Eina_List *gadits = NULL;
Ecore_Timer *_e_cfg_gadgets_change_timer = NULL;
static int _e_cfg_gadgets_change_timeout(void *data) {
Eina_List *l, *l2, *l3;
int update;
E_Gadcon *up_gc1;
update = 0;
for (l = gadits; l; l = l->next)
{
Eina_List *l2;
Gadit *gi;
int update = 0;
gi = l->data;
EINA_LIST_FREE(gadits, gi)
if (gi->enabled != gi->was_enabled)
{
if (gi->enabled)
@ -820,12 +815,11 @@ static int _e_cfg_gadgets_change_timeout(void *data) {
e_gadcon_client_config_new(gi->gc, gi->name);
}
else
{
for (l2 = gi->gc->cf->clients; l2; l2 = l2->next)
{
E_Config_Gadcon_Client *gccc;
gccc = l2->data;
EINA_LIST_FOREACH(gi->gc->cf->clients, l2, gccc)
{
if (strcmp(gi->name, gccc->name)) continue;
e_gadcon_client_config_del(gi->gc->cf, gccc);
}
@ -833,7 +827,6 @@ static int _e_cfg_gadgets_change_timeout(void *data) {
update = 1;
gi->was_enabled = gi->enabled;
}
}
if (update)
{
e_gadcon_unpopulate(local_slipshelf->gadcon);
@ -861,14 +854,12 @@ _e_cfg_gadgets_create(E_Config_Dialog *cfd)
static void
_e_cfg_gadgets_free(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
{ // free cfd->cfdata
while (gadits)
{
Gadit *gi;
gi = gadits->data;
EINA_LIST_FREE(gadits, gi)
{
evas_stringshare_del(gi->name);
free(gi);
gadits = eina_list_remove_list(gadits, gadits);
}
e_object_unref(E_OBJECT(local_slipshelf));
local_slipshelf = NULL;
@ -878,28 +869,25 @@ static Evas_Object *
_e_cfg_gadgets_ui(E_Config_Dialog *cfd, Evas *e, E_Config_Dialog_Data *cfdata)
{
Evas_Object *list, *o, *frame;
E_Radio_Group *rg;
Eina_List *l, *l2, *l3;
E_Gadcon_Client_Class *cc;
Eina_List *l, *l3;
list = e_widget_list_add(e, 0, 0);
frame = e_widget_framelist_add(e, "Visible Gadgets", 0);
for (l = e_gadcon_provider_list(); l; l = l->next)
EINA_LIST_FOREACH(e_gadcon_provider_list(), l, cc)
{
E_Gadcon_Client_Class *cc;
E_Config_Gadcon_Client *gccc;
const char *lbl = NULL;
int on;
Gadit *gi;
if (!(cc = l->data)) continue;
if (!cc) continue;
if (cc->func.label) lbl = cc->func.label(cc);
if (!lbl) lbl = cc->name;
on = 0;
for (l3 = local_slipshelf->gadcon->cf->clients; l3; l3 = l3->next)
EINA_LIST_FOREACH(local_slipshelf->gadcon->cf->clients, l3, gccc)
{
E_Config_Gadcon_Client *gccc;
gccc = l3->data;
if (!strcmp(cc->name, gccc->name))
{
on = 1;
@ -920,28 +908,23 @@ _e_cfg_gadgets_ui(E_Config_Dialog *cfd, Evas *e, E_Config_Dialog_Data *cfdata)
e_widget_list_object_append(list, frame, 1, 0, 0.0); // fill, expand, align
frame = e_widget_framelist_add(e, "Hidden Gadgets", 0);
for (l = e_gadcon_provider_list(); l; l = l->next)
EINA_LIST_FOREACH(e_gadcon_provider_list(), l, cc)
{
E_Gadcon_Client_Class *cc;
E_Config_Gadcon_Client *gccc;
const char *lbl = NULL;
int on;
Gadit *gi;
if (!(cc = l->data)) continue;
if (!cc) continue;
if (cc->func.label) lbl = cc->func.label(cc);
if (!lbl) lbl = cc->name;
on = 0;
for (l3 = local_slipshelf->gadcon_extra->cf->clients; l3; l3 = l3->next)
{
E_Config_Gadcon_Client *gccc;
gccc = l3->data;
EINA_LIST_FOREACH(local_slipshelf->gadcon_extra->cf->clients, l3, gccc)
if (!strcmp(cc->name, gccc->name))
{
on = 1;
break;
}
}
gi = E_NEW(Gadit, 1);
gi->gc = local_slipshelf->gadcon_extra;
@ -981,7 +964,11 @@ e_cfg_gadgets(E_Container *con, const char *params)
///////////////////////////////////////////////////////////////////////////////
int external_keyboard = 0;
Ecore_Timer *_e_cfg_keyboard_change_timer = NULL;
static int _e_cfg_keyboard_change_timeout(void *data) {
static int _e_cfg_keyboard_change_timeout(void *data)
{
Eina_List *l;
illume_cfg->kbd.use_internal = 0;
if (illume_cfg->kbd.run_keyboard)
{
@ -998,16 +985,15 @@ static int _e_cfg_keyboard_change_timeout(void *data) {
}
else
{
Ecore_List *kbds;
Eina_List *kbds;
Efreet_Desktop *desktop;
int nn;
kbds = efreet_util_desktop_category_list("Keyboard");
if (kbds)
{
ecore_list_first_goto(kbds);
nn = 2;
while ((desktop = ecore_list_next(kbds)))
EINA_LIST_FOREACH(kbds, l, desktop)
{
const char *dname;
@ -1050,7 +1036,7 @@ _e_cfg_keyboard_ui(E_Config_Dialog *cfd, Evas *e, E_Config_Dialog_Data *cfdata)
{
Evas_Object *list, *o, *frame;
E_Radio_Group *rg;
Eina_List *l, *l2, *l3;
Eina_List *l;
list = e_widget_list_add(e, 0, 0);
@ -1063,7 +1049,7 @@ _e_cfg_keyboard_ui(E_Config_Dialog *cfd, Evas *e, E_Config_Dialog_Data *cfdata)
}
else
{
Ecore_List *kbds;
Eina_List *kbds;
Efreet_Desktop *desktop;
int nn;
@ -1071,9 +1057,8 @@ _e_cfg_keyboard_ui(E_Config_Dialog *cfd, Evas *e, E_Config_Dialog_Data *cfdata)
kbds = efreet_util_desktop_category_list("Keyboard");
if (kbds)
{
ecore_list_first_goto(kbds);
nn = 2;
while ((desktop = ecore_list_next(kbds)))
EINA_LIST_FOREACH(kbds, l, desktop)
{
const char *dname;
@ -1100,16 +1085,12 @@ _e_cfg_keyboard_ui(E_Config_Dialog *cfd, Evas *e, E_Config_Dialog_Data *cfdata)
e_widget_framelist_object_append(frame, o);
evas_object_smart_callback_add(o, "changed", _e_cfg_keyboard_change, NULL);
{
Ecore_List *kbds;
Eina_List *kbds;
Efreet_Desktop *desktop;
int nn;
int nn = 2;
kbds = efreet_util_desktop_category_list("Keyboard");
if (kbds)
{
ecore_list_first_goto(kbds);
nn = 2;
while ((desktop = ecore_list_next(kbds)))
EINA_LIST_FOREACH(kbds, l, desktop)
{
const char *dname;
@ -1120,7 +1101,6 @@ _e_cfg_keyboard_ui(E_Config_Dialog *cfd, Evas *e, E_Config_Dialog_Data *cfdata)
nn++;
}
}
}
e_widget_list_object_append(list, frame, 1, 0, 0.0); // fill, expand, align
return list;
@ -1749,16 +1729,15 @@ _dbcb_gadget_list_get(E_DBus_Object *obj, DBusMessage *msg)
{
DBusMessage *reply;
DBusMessageIter iter, arr;
E_Gadcon_Client_Class *cc;
Eina_List *l;
reply = dbus_message_new_method_return(msg);
dbus_message_iter_init_append(reply, &iter);
dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY, "s", &arr);
for (l = e_gadcon_provider_list(); l; l = l->next)
EINA_LIST_FOREACH(e_gadcon_provider_list(), l, cc)
{
E_Gadcon_Client_Class *cc;
if (!(cc = l->data)) continue;
if (!cc) continue;
dbus_message_iter_append_basic(&arr, DBUS_TYPE_STRING, &(cc->name));
}
dbus_message_iter_close_container(&iter, &arr);
@ -1770,17 +1749,16 @@ static DBusMessage *
_dbcb_slipshelf_main_gadget_list_get(E_DBus_Object *obj, DBusMessage *msg)
{
DBusMessage *reply;
E_Config_Gadcon_Client *gccc;
DBusMessageIter iter, arr;
Eina_List *l;
reply = dbus_message_new_method_return(msg);
dbus_message_iter_init_append(reply, &iter);
dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY, "s", &arr);
for (l = slipshelf->gadcon->cf->clients; l; l = l->next)
EINA_LIST_FOREACH(slipshelf->gadcon->cf->clients, l, gccc)
{
E_Config_Gadcon_Client *gccc;
if (!(gccc = l->data)) continue;
if (!gccc) continue;
dbus_message_iter_append_basic(&arr, DBUS_TYPE_STRING, &(gccc->name));
}
dbus_message_iter_close_container(&iter, &arr);
@ -1825,13 +1803,12 @@ _dbcb_slipshelf_main_gadget_del(E_DBus_Object *obj, DBusMessage *msg)
dbus_message_iter_get_basic(&iter, &(s));
if (s)
{
E_Config_Gadcon_Client *cgc;
Eina_List *l;
for (l = slipshelf->gadcon->clients; l; l = l->next)
EINA_LIST_FOREACH(slipshelf->gadcon->clients, l, cgc)
{
E_Config_Gadcon_Client *cgc;
if (!(cgc = l->data)) continue;
if (!cgc) continue;
if (strcmp(s, cgc->name)) continue;
e_gadcon_client_config_del(slipshelf->gadcon->cf, cgc);
break;
@ -1853,16 +1830,15 @@ _dbcb_slipshelf_extra_gadget_list_get(E_DBus_Object *obj, DBusMessage *msg)
{
DBusMessage *reply;
DBusMessageIter iter, arr;
E_Config_Gadcon_Client *gccc;
Eina_List *l;
reply = dbus_message_new_method_return(msg);
dbus_message_iter_init_append(reply, &iter);
dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY, "s", &arr);
for (l = slipshelf->gadcon_extra->cf->clients; l; l = l->next)
EINA_LIST_FOREACH(slipshelf->gadcon_extra->cf->clients, l, gccc)
{
E_Config_Gadcon_Client *gccc;
if (!(gccc = l->data)) continue;
if (!gccc) continue;
dbus_message_iter_append_basic(&arr, DBUS_TYPE_STRING, &(gccc->name));
}
dbus_message_iter_close_container(&iter, &arr);
@ -1907,13 +1883,12 @@ _dbcb_slipshelf_extra_gadget_del(E_DBus_Object *obj, DBusMessage *msg)
dbus_message_iter_get_basic(&iter, &(s));
if (s)
{
E_Config_Gadcon_Client *cgc;
Eina_List *l;
for (l = slipshelf->gadcon_extra->clients; l; l = l->next)
EINA_LIST_FOREACH(slipshelf->gadcon_extra->clients, l, cgc)
{
E_Config_Gadcon_Client *cgc;
if (!(cgc = l->data)) continue;
if (!cgc) continue;
if (strcmp(s, cgc->name)) continue;
e_gadcon_client_config_del(slipshelf->gadcon_extra->cf, cgc);
break;

View File

@ -82,18 +82,18 @@ _e_flaunch_app_add(E_Flaunch *fl, const char *deskfile)
static void
_e_flaunch_apps_clear(E_Flaunch *fl)
{
while (fl->apps)
{
_e_flaunch_button_del(fl->apps->data);
fl->apps = eina_list_remove_list(fl->apps, fl->apps);
}
E_Flaunch_App *fla;
EINA_LIST_FREE(fl->apps, fla)
_e_flaunch_button_del(fla);
}
static void
_e_flaunch_apps_populate(E_Flaunch *fl)
{
E_Flaunch_App *fla;
Ecore_List *bar_desktops;
Eina_List *bar_desktops;
Eina_List *l;
int num = 0, max, count;
// FIXME: 3 should become config here
@ -105,7 +105,7 @@ _e_flaunch_apps_populate(E_Flaunch *fl)
{
Efreet_Desktop *desktop;
count = ecore_list_count(bar_desktops);
count = eina_list_count(bar_desktops);
if (count < max)
{
int i;
@ -116,8 +116,7 @@ _e_flaunch_apps_populate(E_Flaunch *fl)
num++;
}
}
ecore_list_first_goto(bar_desktops);
while ((desktop = ecore_list_next(bar_desktops)))
EINA_LIST_FOREACH(bar_desktops, l, desktop)
{
if (desktop->orig_path)
{
@ -149,17 +148,16 @@ _e_fluanch_cb_home_button(void *data)
static void
_e_flaunch_free(E_Flaunch *fl)
{
Ecore_Event *ev;
if (fl->repopulate_timer) ecore_timer_del(fl->repopulate_timer);
_e_flaunch_apps_clear(fl);
_e_flaunch_button_del(fl->start_button);
evas_stringshare_del(fl->themedir);
evas_object_del(fl->app_box_obj);
evas_object_del(fl->box_obj);
while (fl->handlers)
{
ecore_event_handler_del(fl->handlers->data);
fl->handlers = eina_list_remove_list(fl->handlers, fl->handlers);
}
EINA_LIST_FREE(fl->handlers, ev)
ecore_event_handler_del(ev);
free(fl);
}

View File

@ -106,19 +106,15 @@ _e_kbd_cb_animate(void *data)
static void
_e_kbd_free(E_Kbd *kbd)
{
E_Border *bd;
kbds = eina_list_remove(kbds, kbd);
if (kbd->animator) ecore_animator_del(kbd->animator);
if (kbd->delay_hide) ecore_timer_del(kbd->delay_hide);
// FIXME: thought right - on shutdoiwn, this might point to freed data
// if (kbd->border) kbd->border->stolen = 0;
while (kbd->waiting_borders)
{
E_Border *bd;
bd = kbd->waiting_borders->data;
EINA_LIST_FREE(kbd->waiting_borders, bd)
bd->stolen = 0;
kbd->waiting_borders = eina_list_remove_list(kbd->waiting_borders, kbd->waiting_borders);
}
free(kbd);
}
@ -189,18 +185,15 @@ static E_Kbd *
_e_kbd_by_border_get(E_Border *bd)
{
Eina_List *l, *l2;
if (!bd->stolen) return NULL;
for (l = kbds; l; l = l->next)
{
E_Border *over;
E_Kbd *kbd;
kbd = l->data;
if (kbd->border == bd) return kbd;
for (l2 = kbd->waiting_borders; l2; l2 = l2->next)
if (!bd->stolen) return NULL;
EINA_LIST_FOREACH(kbds, l, kbd)
{
if (l2->data == bd) return kbd;
}
if (kbd->border == bd) return kbd;
EINA_LIST_FOREACH(kbd->waiting_borders, l2, over)
if (over == bd) return kbd;
}
return NULL;
}
@ -220,86 +213,62 @@ static void
_e_kbd_all_enable(void)
{
Eina_List *l;
for (l = kbds; l; l = l->next)
{
E_Kbd *kbd;
kbd = l->data;
EINA_LIST_FOREACH(kbds, l, kbd)
e_kbd_enable(kbd);
}
}
static void
_e_kbd_all_disable(void)
{
Eina_List *l;
for (l = kbds; l; l = l->next)
{
E_Kbd *kbd;
kbd = l->data;
EINA_LIST_FOREACH(kbds, l, kbd)
e_kbd_disable(kbd);
}
}
static void
_e_kbd_all_show(void)
{
Eina_List *l;
for (l = kbds; l; l = l->next)
{
E_Kbd *kbd;
kbd = l->data;
EINA_LIST_FOREACH(kbds, l, kbd)
e_kbd_show(kbd);
}
}
static void
_e_kbd_all_layout_set(E_Kbd_Layout layout)
{
Eina_List *l;
for (l = kbds; l; l = l->next)
{
E_Kbd *kbd;
kbd = l->data;
EINA_LIST_FOREACH(kbds, l, kbd)
e_kbd_layout_set(kbd, layout);
}
}
static void
_e_kbd_all_hide(void)
{
Eina_List *l;
for (l = kbds; l; l = l->next)
{
E_Kbd *kbd;
kbd = l->data;
EINA_LIST_FOREACH(kbds, l, kbd)
e_kbd_hide(kbd);
}
}
static void
_e_kbd_all_toggle(void)
{
Eina_List *l;
for (l = kbds; l; l = l->next)
{
E_Kbd *kbd;
kbd = l->data;
EINA_LIST_FOREACH(kbds, l, kbd)
if (kbd->visible) e_kbd_hide(kbd);
else e_kbd_show(kbd);
}
}
static int
_e_kbd_cb_client_message(void *data, int type, void *event)
@ -332,7 +301,6 @@ static int
_e_kbd_cb_border_remove(void *data, int type, void *event)
{
E_Event_Border_Remove *ev;
Eina_List *l;
E_Kbd *kbd;
ev = event;
@ -485,12 +453,10 @@ _e_kbd_cb_border_hook_pre_post_fetch(void *data, E_Border *bd)
if (_e_kbd_border_is_keyboard(bd))
{
Eina_List *l;
for (l = kbds; l; l = l->next)
{
E_Kbd *kbd;
kbd = l->data;
EINA_LIST_FOREACH(kbds, l, kbd)
{
if (!kbd->border)
{
_e_kbd_border_adopt(kbd, bd);
@ -700,12 +666,12 @@ static Eina_List *_e_kbd_dbus_real_ignore = NULL;
static void
_e_kbd_dbus_keyboard_add(const char *udi)
{
const char *str;
Eina_List *l;
for (l = _e_kbd_dbus_keyboards; l; l = l->next)
{
if (!strcmp(l->data, udi)) return;
}
EINA_LIST_FOREACH(_e_kbd_dbus_keyboards, l, str)
if (!strcmp(str, udi)) return;
_e_kbd_dbus_keyboards = eina_list_append
(_e_kbd_dbus_keyboards, evas_stringshare_add(udi));
}
@ -714,36 +680,33 @@ static void
_e_kbd_dbus_keyboard_del(const char *udi)
{
Eina_List *l;
char *str;
for (l = _e_kbd_dbus_keyboards; l; l = l->next)
EINA_LIST_FOREACH(_e_kbd_dbus_keyboards, l, str)
if (!strcmp(str, udi))
{
if (!strcmp(l->data, udi))
{
evas_stringshare_del(l->data);
evas_stringshare_del(str);
_e_kbd_dbus_keyboards = eina_list_remove_list(_e_kbd_dbus_keyboards, l);
return;
}
}
}
static void
_e_kbd_dbus_keyboard_eval(void)
{
int have_real = 0;
Eina_List *l, *ll;
const char *g, *gg;
have_real = eina_list_count(_e_kbd_dbus_keyboards);
for (l = _e_kbd_dbus_keyboards; l; l = l->next)
{
for (ll = _e_kbd_dbus_real_ignore; ll; ll = ll->next)
{
if (e_util_glob_match(l->data, ll->data))
EINA_LIST_FOREACH(_e_kbd_dbus_keyboards, l, g)
EINA_LIST_FOREACH(_e_kbd_dbus_real_ignore, ll, gg)
if (e_util_glob_match(g, gg))
{
have_real--;
break;
}
}
}
if (have_real != _e_kbd_dbus_have_real_keyboard)
{
_e_kbd_dbus_have_real_keyboard = have_real;
@ -758,6 +721,7 @@ static void
_e_kbd_dbus_cb_dev_input_keyboard(void *user_data, void *reply_data, DBusError *error)
{
E_Hal_Manager_Find_Device_By_Capability_Return *ret = reply_data;
Eina_List *l;
char *device;
if (!ret || !ret->strings) return;
@ -768,8 +732,7 @@ _e_kbd_dbus_cb_dev_input_keyboard(void *user_data, void *reply_data, DBusError *
return;
}
ecore_list_first_goto(ret->strings);
while ((device = ecore_list_next(ret->strings)))
EINA_LIST_FOREACH(ret->strings, l, device)
{
_e_kbd_dbus_keyboard_add(device);
_e_kbd_dbus_keyboard_eval();
@ -917,22 +880,18 @@ _e_kbd_dbus_real_kbd_init(void)
static void
_e_kbd_dbus_real_kbd_shutdown(void)
{
char *str;
if (_e_kbd_dbus_conn)
{
e_dbus_signal_handler_del(_e_kbd_dbus_conn, _e_kbd_dbus_handler_dev_add);
e_dbus_signal_handler_del(_e_kbd_dbus_conn, _e_kbd_dbus_handler_dev_del);
e_dbus_signal_handler_del(_e_kbd_dbus_conn, _e_kbd_dbus_handler_dev_chg);
}
while (_e_kbd_dbus_real_ignore)
{
evas_stringshare_del(_e_kbd_dbus_real_ignore->data);
_e_kbd_dbus_real_ignore = eina_list_remove_list(_e_kbd_dbus_real_ignore, _e_kbd_dbus_real_ignore);
}
while (_e_kbd_dbus_keyboards)
{
evas_stringshare_del(_e_kbd_dbus_keyboards->data);
_e_kbd_dbus_keyboards = eina_list_remove_list(_e_kbd_dbus_keyboards, _e_kbd_dbus_keyboards);
}
EINA_LIST_FREE(_e_kbd_dbus_real_ignore, str)
evas_stringshare_del(str);
EINA_LIST_FREE(_e_kbd_dbus_keyboards, str)
evas_stringshare_del(str);
_e_kbd_dbus_have_real_keyboard = 0;
}
@ -995,18 +954,15 @@ e_kbd_init(E_Module *m)
EAPI int
e_kbd_shutdown(void)
{
E_Border_Hook *bh;
Ecore_Event *ev;
_e_kbd_apply_all_job_queue_end();
_e_kbd_dbus_real_kbd_shutdown();
while (border_hooks)
{
e_border_hook_del(border_hooks->data);
border_hooks = eina_list_remove_list(border_hooks, border_hooks);
}
while (handlers)
{
ecore_event_handler_del(handlers->data);
handlers = eina_list_remove_list(handlers, handlers);
}
EINA_LIST_FREE(border_hooks, bh)
e_border_hook_del(bh);
EINA_LIST_FREE(handlers, ev)
ecore_event_handler_del(ev);
focused_border = NULL;
focused_vkbd_state = 0;
mod = NULL;
@ -1129,12 +1085,9 @@ EAPI void
e_kbd_fullscreen_set(E_Zone *zone, int fullscreen)
{
Eina_List *l;
for (l = kbds; l; l = l->next)
{
E_Kbd *kbd;
kbd = l->data;
EINA_LIST_FOREACH(kbds, l, kbd)
if ((!!fullscreen) != kbd->fullscreen)
{
kbd->fullscreen = fullscreen;
@ -1144,4 +1097,3 @@ e_kbd_fullscreen_set(E_Zone *zone, int fullscreen)
e_border_layer_set(kbd->border, 100);
}
}
}

View File

@ -1,3 +1,5 @@
#include <Eina.h>
#include "e.h"
#include "e_kbd_buf.h"
#include "e_kbd_int.h"
@ -52,24 +54,18 @@ _e_kbd_int_at_coord_get(E_Kbd_Int *ki, Evas_Coord x, Evas_Coord y)
{
Eina_List *l;
Evas_Coord dist;
E_Kbd_Int_Key *ky;
E_Kbd_Int_Key *closest_ky = NULL;
for (l = ki->layout.keys; l; l = l->next)
{
E_Kbd_Int_Key *ky;
ky = l->data;
EINA_LIST_FOREACH(ki->layout.keys, l, ky)
if ((x >= ky->x) && (y >= ky->y) &&
(x < (ky->x + ky->w)) && (y < (ky->y + ky->h)))
return ky;
}
dist = 0x7fffffff;
for (l = ki->layout.keys; l; l = l->next)
EINA_LIST_FOREACH(ki->layout.keys, l, ky)
{
E_Kbd_Int_Key *ky;
Evas_Coord dx, dy;
ky = l->data;
dx = x - (ky->x + (ky->w / 2));
dy = y - (ky->y + (ky->h / 2));
dx = (dx * dx) + (dy * dy);
@ -85,46 +81,38 @@ _e_kbd_int_at_coord_get(E_Kbd_Int *ki, Evas_Coord x, Evas_Coord y)
static E_Kbd_Int_Key_State *
_e_kbd_int_key_state_get(E_Kbd_Int *ki, E_Kbd_Int_Key *ky)
{
E_Kbd_Int_Key_State *found = NULL;
E_Kbd_Int_Key_State *st;
Eina_List *l;
for (l = ky->states; l; l = l->next)
EINA_LIST_FOREACH(ky->states, l, st)
{
E_Kbd_Int_Key_State *st;
st = l->data;
if (st->state & ki->layout.state) return st;
if (!found && st->state == NORMAL) found = st;
}
for (l = ky->states; l; l = l->next)
{
E_Kbd_Int_Key_State *st;
st = l->data;
if (st->state == NORMAL) return st;
}
return NULL;
return found;
}
static void
_e_kbd_int_layout_buf_update(E_Kbd_Int *ki)
{
E_Kbd_Int_Key *ky;
Eina_List *l, *l2;
e_kbd_buf_layout_clear(ki->kbuf);
e_kbd_buf_layout_size_set(ki->kbuf, ki->layout.w, ki->layout.h);
e_kbd_buf_layout_fuzz_set(ki->kbuf, ki->layout.fuzz);
for (l = ki->layout.keys; l; l = l->next)
EINA_LIST_FOREACH(ki->layout.keys, l, ky)
{
E_Kbd_Int_Key *ky;
E_Kbd_Int_Key_State *st;
const char *out, *out_shift, *out_capslock;
ky = l->data;
out = NULL;
out_shift = NULL;
out_capslock = NULL;
for (l2 = ky->states; l2; l2 = l2->next)
EINA_LIST_FOREACH(ky->states, l2, st)
{
st = l2->data;
if (st->state == NORMAL)
out = st->out;
else if (st->state == SHIFT)
@ -154,15 +142,14 @@ _e_kbd_int_layout_buf_update(E_Kbd_Int *ki)
static void
_e_kbd_int_layout_state_update(E_Kbd_Int *ki)
{
E_Kbd_Int_Key *ky;
Eina_List *l;
for (l = ki->layout.keys; l; l = l->next)
EINA_LIST_FOREACH(ki->layout.keys, l, ky)
{
E_Kbd_Int_Key *ky;
E_Kbd_Int_Key_State *st;
int selected;
ky = l->data;
st = _e_kbd_int_key_state_get(ki, ky);
if (st)
{
@ -289,16 +276,14 @@ _e_kbd_int_matches_add(E_Kbd_Int *ki, const char *str, int num)
static void
_e_kbd_int_matches_free(E_Kbd_Int *ki)
{
while (ki->matches)
{
E_Kbd_Int_Match *km;
km = ki->matches->data;
EINA_LIST_FREE(ki->matches, km)
{
if (km->str) evas_stringshare_del(km->str);
evas_object_del(km->obj);
free(km);
ki->matches = eina_list_remove_list(ki->matches, ki->matches);
}
}
@ -336,10 +321,10 @@ _e_kbd_int_matches_update(E_Kbd_Int *ki)
actual = e_kbd_buf_actual_string_get(ki->kbuf);
if (actual)
{
for (l = matches; l; l = l->next)
{
if (!strcmp(l->data, actual)) break;
}
const char *str;
EINA_LIST_FOREACH(matches, l, str)
if (!strcmp(str, actual)) break;
if (!l) _e_kbd_int_matches_add(ki, actual, i);
}
}
@ -850,62 +835,50 @@ _e_kbd_int_cb_mouse_up(void *data, Evas *evas, Evas_Object *obj, void *event_inf
static E_Kbd_Int_Layout *
_e_kbd_int_layouts_list_default_get(E_Kbd_Int *ki)
{
E_Kbd_Int_Layout *kil;
Eina_List *l;
for (l = ki->layouts; l; l = l->next)
{
E_Kbd_Int_Layout *kil;
kil = l->data;
EINA_LIST_FOREACH(ki->layouts, l, kil)
if ((!strcmp(ecore_file_file_get(kil->path), "Default.kbd")))
return kil;
}
return NULL;
}
static E_Kbd_Int_Layout *
_e_kbd_int_layouts_type_get(E_Kbd_Int *ki, int type)
{
E_Kbd_Int_Layout *kil;
Eina_List *l;
for (l = ki->layouts; l; l = l->next)
{
E_Kbd_Int_Layout *kil;
kil = l->data;
EINA_LIST_FOREACH(ki->layouts, l, kil)
if (kil->type == type)
return kil;
}
return NULL;
}
static void
_e_kbd_int_layout_free(E_Kbd_Int *ki)
{
E_Kbd_Int_Key *ky;
if (ki->layout.directory) free(ki->layout.directory);
if (ki->layout.file) evas_stringshare_del(ki->layout.file);
ki->layout.directory = NULL;
ki->layout.file = NULL;
while (ki->layout.keys)
{
E_Kbd_Int_Key *ky;
ky = ki->layout.keys->data;
while (ky->states)
EINA_LIST_FREE(ki->layout.keys, ky)
{
E_Kbd_Int_Key_State *st;
st = ky->states->data;
EINA_LIST_FREE(ky->states, st)
{
if (st->label) evas_stringshare_del(st->label);
if (st->icon) evas_stringshare_del(st->icon);
if (st->out) evas_stringshare_del(st->out);
free(st);
ky->states = eina_list_remove_list(ky->states, ky->states);
}
if (ky->obj) evas_object_del(ky->obj);
if (ky->icon_obj) evas_object_del(ky->icon_obj);
free(ky);
ki->layout.keys = eina_list_remove_list(ki->layout.keys, ki->layout.keys);
}
if (ki->event_obj) evas_object_del(ki->event_obj);
ki->event_obj = NULL;
@ -1000,6 +973,7 @@ _e_kbd_int_layout_parse(E_Kbd_Int *ki, const char *layout)
static void
_e_kbd_int_layout_build(E_Kbd_Int *ki)
{
E_Kbd_Int_Key *ky;
Evas_Object *o, *o2;
Evas_Coord lw, lh;
Eina_List *l;
@ -1014,13 +988,11 @@ _e_kbd_int_layout_build(E_Kbd_Int *ki)
edje_extern_object_min_size_set(ki->layout_obj, lw, lh);
edje_object_part_swallow(ki->base_obj, "e.swallow.content", ki->layout_obj);
for (l = ki->layout.keys; l; l = l->next)
EINA_LIST_FOREACH(ki->layout.keys, l, ky)
{
E_Kbd_Int_Key *ky;
E_Kbd_Int_Key_State *st;
const char *label, *icon;
ky = l->data;
o = _theme_obj_new(ki->win->evas, ki->themedir,
"e/modules/kbd/key/default");
ky->obj = o;
@ -1076,37 +1048,34 @@ _e_kbd_int_layout_build(E_Kbd_Int *ki)
static void
_e_kbd_int_layouts_free(E_Kbd_Int *ki)
{
while (ki->layouts)
{
E_Kbd_Int_Layout *kil;
kil = ki->layouts->data;
EINA_LIST_FREE(ki->layouts, kil)
{
evas_stringshare_del(kil->path);
evas_stringshare_del(kil->dir);
evas_stringshare_del(kil->icon);
evas_stringshare_del(kil->name);
free(kil);
ki->layouts = eina_list_remove_list(ki->layouts, ki->layouts);
}
}
static void
_e_kbd_int_layouts_list_update(E_Kbd_Int *ki)
{
Ecore_List *files;
Eina_List *files;
Eina_List *l;
char buf[PATH_MAX], *p, *file;
const char *homedir, *fl;
Eina_List *kbs = NULL, *l, *layouts = NULL;
char *path;
Eina_List *kbs = NULL, *layouts = NULL;
int ok;
homedir = e_user_homedir_get();
snprintf(buf, sizeof(buf), "%s/.e/e/keyboards", homedir);
files = ecore_file_ls(buf);
if (files)
{
ecore_list_first_goto(files);
while ((file = ecore_list_current(files)))
EINA_LIST_FREE(files, file)
{
p = strrchr(file, '.');
if ((p) && (!strcmp(p, ".kbd")))
@ -1114,16 +1083,12 @@ _e_kbd_int_layouts_list_update(E_Kbd_Int *ki)
snprintf(buf, sizeof(buf), "%s/.e/e/keyboards/%s", homedir, file);
kbs = eina_list_append(kbs, evas_stringshare_add(buf));
}
ecore_list_next(files);
}
ecore_list_destroy(files);
free(file);
}
snprintf(buf, sizeof(buf), "%s/keyboards", ki->syskbds);
files = ecore_file_ls(buf);
if (files)
{
ecore_list_first_goto(files);
while ((file = ecore_list_current(files)))
EINA_LIST_FREE(files, file)
{
p = strrchr(file, '.');
if ((p) && (!strcmp(p, ".kbd")))
@ -1144,11 +1109,13 @@ _e_kbd_int_layouts_list_update(E_Kbd_Int *ki)
kbs = eina_list_append(kbs, evas_stringshare_add(buf));
}
}
ecore_list_next(files);
free(file);
}
ecore_list_destroy(files);
}
for (l = kbs; l; l = l->next)
/* Previous loop could break before destroying all items. */
EINA_LIST_FREE(files, file)
free(file);
EINA_LIST_FREE(kbs, path)
{
E_Kbd_Int_Layout *kil;
@ -1158,8 +1125,7 @@ _e_kbd_int_layouts_list_update(E_Kbd_Int *ki)
char *s, *p;
FILE *f;
kil->path = l->data;
l->data = NULL;
kil->path = path;
s = strdup(ecore_file_file_get(kil->path));
if (s)
{
@ -1228,7 +1194,6 @@ _e_kbd_int_layouts_list_update(E_Kbd_Int *ki)
layouts = eina_list_append(layouts, kil);
}
}
eina_list_free(kbs);
_e_kbd_int_layouts_free(ki);
ki->layouts = layouts;
}
@ -1268,15 +1233,12 @@ _e_kbd_int_layout_next(E_Kbd_Int *ki)
const char *nextlay = NULL;
E_Kbd_Int_Layout *kil;
for (l = ki->layouts; l; l = l->next)
{
kil = l->data;
EINA_LIST_FOREACH(ki->layouts, l, kil)
if (!strcmp(kil->path, ki->layout.file))
{
ln = l->next;
break;
}
}
if (!ln) ln = ki->layouts;
if (!ln) return;
kil = ln->data;
@ -1349,14 +1311,13 @@ _e_kbd_int_cb_client_message(void *data, int type, void *event)
static void
_e_kbd_int_dictlist_down(E_Kbd_Int *ki)
{
char *str;
if (!ki->dictlist.popup) return;
e_object_del(E_OBJECT(ki->dictlist.popup));
ki->dictlist.popup = NULL;
while (ki->dictlist.matches)
{
evas_stringshare_del(ki->dictlist.matches->data);
ki->dictlist.matches = eina_list_remove_list(ki->dictlist.matches, ki->dictlist.matches);
}
EINA_LIST_FREE(ki->dictlist.matches, str)
evas_stringshare_del(str);
}
static void
@ -1392,10 +1353,10 @@ _e_kbd_int_dictlist_up(E_Kbd_Int *ki)
Evas_Object *o;
Evas_Coord w, h, mw, mh, vw, vh;
int sx, sy, sw, sh;
Ecore_List *files;
Eina_List *files;
Eina_List *l;
char buf[PATH_MAX], *p, *file, *pp;
const char *homedir, *str;
Eina_List *l;
int used;
if (ki->dictlist.popup) return;
@ -1414,25 +1375,23 @@ _e_kbd_int_dictlist_up(E_Kbd_Int *ki)
homedir = e_user_homedir_get();
snprintf(buf, sizeof(buf), "%s/.e/e/dicts", homedir);
files = ecore_file_ls(buf);
if (files)
{
ecore_list_first_goto(files);
while ((file = ecore_list_current(files)))
EINA_LIST_FREE(files, file)
{
p = strrchr(file, '.');
if ((p) && (!strcmp(p, ".dic")))
{
const char *match;
used = 0;
for (l = ki->dictlist.matches; l; l = l->next)
{
if (!strcmp(l->data, file)) used = 1;
}
if (!used)
{
EINA_LIST_FOREACH(ki->dictlist.matches, l, match)
if (!strcmp(match, file)) used = 1;
if (used) goto next1;
p = strdup(file);
if (p)
{
if (!p) goto next1;
for (pp = p; *pp; pp++)
{
if (*pp == '_') *pp = ' ';
@ -1445,33 +1404,29 @@ _e_kbd_int_dictlist_up(E_Kbd_Int *ki)
ki, NULL);
free(p);
}
next1:
free(file);
}
}
ecore_list_next(files);
}
ecore_list_destroy(files);
}
snprintf(buf, sizeof(buf), "%s/dicts", ki->sysdicts);
files = ecore_file_ls(buf);
if (files)
{
ecore_list_first_goto(files);
while ((file = ecore_list_current(files)))
EINA_LIST_FREE(files, file)
{
p = strrchr(file, '.');
if ((p) && (!strcmp(p, ".dic")))
{
const char *match;
used = 0;
for (l = ki->dictlist.matches; l; l = l->next)
{
if (!strcmp(l->data, file)) used = 1;
}
if (!used)
{
EINA_LIST_FOREACH(ki->dictlist.matches, l, match)
if (!strcmp(match, file)) used = 1;
if (used) goto next2;
p = strdup(file);
if (p)
{
if (!p) goto next2;
for (pp = p; *pp; pp++)
{
if (*pp == '_') *pp = ' ';
@ -1484,11 +1439,8 @@ _e_kbd_int_dictlist_up(E_Kbd_Int *ki)
ki, NULL);
free(p);
}
}
}
ecore_list_next(files);
}
ecore_list_destroy(files);
next2:
free(file);
}
e_widget_ilist_thaw(o);
e_widget_ilist_go(o);
@ -1523,14 +1475,13 @@ _e_kbd_int_dictlist_up(E_Kbd_Int *ki)
static void
_e_kbd_int_matchlist_down(E_Kbd_Int *ki)
{
char *str;
if (!ki->matchlist.popup) return;
e_object_del(E_OBJECT(ki->matchlist.popup));
ki->matchlist.popup = NULL;
while (ki->matchlist.matches)
{
evas_stringshare_del(ki->matchlist.matches->data);
ki->matchlist.matches = eina_list_remove_list(ki->matchlist.matches, ki->matchlist.matches);
}
EINA_LIST_FREE(ki->matchlist.matches, str)
evas_stringshare_del(str);
}
static void

View File

@ -158,14 +158,11 @@ _gc_id_new(E_Gadcon_Client_Class *client_class)
static int
_find_interface_class(int iclass)
{
Ecore_List *devs;
devs = ecore_file_ls("/sys/bus/usb/devices");
if (devs)
{
Eina_List *devs;
char *name;
while ((name = ecore_list_next(devs)))
devs = ecore_file_ls("/sys/bus/usb/devices");
EINA_LIST_FREE(devs, name)
{
char buf[PATH_MAX];
FILE *f;
@ -182,15 +179,16 @@ _find_interface_class(int iclass)
sscanf(buf, "%x", &id);
if (iclass == id)
{
ecore_list_destroy(devs);
EINA_LIST_FREE(devs, name)
free(name);
fclose(f);
return 1;
}
}
fclose(f);
}
}
ecore_list_destroy(devs);
free(name);
}
return 0;
}

View File

@ -158,14 +158,11 @@ _gc_id_new(E_Gadcon_Client_Class *client_class)
static int
_find_interface_class(int iclass)
{
Ecore_List *devs;
devs = ecore_file_ls("/sys/bus/usb/devices");
if (devs)
{
Eina_List *devs;
char *name;
while ((name = ecore_list_next(devs)))
devs = ecore_file_ls("/sys/bus/usb/devices");
EINA_LIST_FREE(devs, name)
{
char buf[PATH_MAX];
FILE *f;
@ -182,15 +179,16 @@ _find_interface_class(int iclass)
sscanf(buf, "%x", &id);
if (iclass == id)
{
ecore_list_destroy(devs);
EINA_LIST_FREE(devs, name)
free(name);
fclose(f);
return 1;
}
}
fclose(f);
}
}
ecore_list_destroy(devs);
free(name);
}
return 0;
}

View File

@ -83,7 +83,7 @@ static Ecore_Timer *defer = NULL;
static E_Kbd *vkbd = NULL;
static E_Kbd_Int *vkbd_int = NULL;
static E_Busywin *busywin = NULL;
static E_Busywin *busycover = NULL;
static E_Busycover *busycover = NULL;
static E_Flaunch *flaunch = NULL;
static E_Appwin *appwin = NULL;
static E_Syswin *syswin = NULL;
@ -243,6 +243,8 @@ _e_mod_win_win_cfg_kbd_cb_exit(void *data, int type, void *event)
void
e_mod_win_cfg_kbd_start(void)
{
Eina_List *l;
if (illume_cfg->kbd.use_internal)
{
vkbd_int = e_kbd_int_new(e_module_dir_get(mod),
@ -257,13 +259,12 @@ e_mod_win_cfg_kbd_start(void)
desktop = efreet_util_desktop_file_id_find(illume_cfg->kbd.run_keyboard);
if (!desktop)
{
Ecore_List *kbds;
Eina_List *kbds;
kbds = efreet_util_desktop_category_list("Keyboard");
if (kbds)
{
ecore_list_first_goto(kbds);
while ((desktop = ecore_list_next(kbds)))
EINA_LIST_FOREACH(kbds, l, desktop)
{
const char *dname;
@ -408,12 +409,10 @@ static Eina_List *
__app_list(void)
{
Eina_List *tlist = NULL, *l;
for (l = applist; l; l = l->next)
{
E_Border *bd;
bd = l->data;
EINA_LIST_FOREACH(applist, l, bd)
{
if (e_object_is_del(E_OBJECT(bd))) continue;
if ((!bd->client.icccm.accepts_focus) &&
(!bd->client.icccm.take_focus)) continue;
@ -428,11 +427,11 @@ static Eina_List *
__app_find(Eina_List *list, E_Border *bd)
{
Eina_List *l;
E_Border *over;
EINA_LIST_FOREACH(list, l, over)
if (over == bd) return l;
for (l = list; l; l = l->next)
{
if (l->data == bd) return l;
}
return NULL;
}
@ -507,14 +506,13 @@ _app_next(void)
static void
_app_home(void)
{
Eina_List *l, *borders;
borders = e_border_client_list();
for (l = borders; l; l = l->next)
{
Eina_List *borders;
Eina_List *l;
E_Border *bd;
bd = l->data;
borders = e_border_client_list();
EINA_LIST_FOREACH(borders, l, bd)
{
if (e_object_is_del(E_OBJECT(bd))) continue;
if ((!bd->client.icccm.accepts_focus) &&
(!bd->client.icccm.take_focus)) continue;
@ -592,23 +590,21 @@ _cb_cfg_exec(const void *data, E_Container *con, const char *params, Efreet_Desk
static void
_desktop_run(Efreet_Desktop *desktop)
{
Eina_List *l, *borders;
E_Exec_Instance *eins;
Instance *ins;
E_Border *bd;
Eina_List *l;
char *exename, *p;
if (!desktop) return;
if (!desktop->exec) return;
for (l = instances; l; l = l->next)
{
ins = l->data;
EINA_LIST_FOREACH(instances, l, ins)
if (ins->desktop == desktop)
{
if (ins->border)
_e_mod_layout_border_show(ins->border);
return;
}
}
exename = NULL;
p = strchr(desktop->exec, ' ');
if (!p)
@ -626,12 +622,8 @@ _desktop_run(Efreet_Desktop *desktop)
p = strrchr(exename, '/');
if (p) strcpy(exename, p + 1);
}
borders = e_border_client_list();
for (l = borders; l; l = l->next)
EINA_LIST_FOREACH(e_border_client_list(), l, bd)
{
E_Border *bd;
bd = l->data;
if (e_exec_startup_id_pid_find(bd->client.netwm.pid,
bd->client.netwm.startup_id) == desktop)
{
@ -713,9 +705,7 @@ _cb_event_border_add(void *data, int type, void *event)
}
desktop = e_exec_startup_id_pid_find(ev->border->client.netwm.pid,
ev->border->client.netwm.startup_id);
for (l = instances; l; l = l->next)
{
ins = l->data;
EINA_LIST_FOREACH(instances, l, ins)
if (!ins->border)
{
if ((ins->startup_id == ev->border->client.netwm.startup_id) ||
@ -734,7 +724,6 @@ _cb_event_border_add(void *data, int type, void *event)
return 1;
}
}
}
return 1;
}
@ -753,9 +742,7 @@ _cb_event_border_remove(void *data, int type, void *event)
e_slipshelf_action_enabled_set(slipshelf, E_SLIPSHELF_ACTION_APP_NEXT, 0);
e_slipshelf_action_enabled_set(slipshelf, E_SLIPSHELF_ACTION_APP_PREV, 0);
}
for (l = instances; l; l = l->next)
{
ins = l->data;
EINA_LIST_FOREACH(instances, l, ins)
if (ins->border == ev->border)
{
if (ins->handle)
@ -767,7 +754,6 @@ _cb_event_border_remove(void *data, int type, void *event)
ins->border = NULL;
return 1;
}
}
return 1;
}
@ -807,9 +793,8 @@ _cb_event_exe_del(void *data, int type, void *event)
Eina_List *l;
ev = event;
for (l = instances; l; l = l->next)
EINA_LIST_FOREACH(instances, l, ins)
{
ins = l->data;
if (ins->pid == ev->pid)
{
if (ins->handle)
@ -852,15 +837,12 @@ _cb_run_timeout(void *data)
static int
_have_borders(void)
{
Eina_List *borders, *l;
Eina_List *l;
E_Border *bd;
int num = 0;
borders = e_border_client_list();
for (l = borders; l; l = l->next)
EINA_LIST_FOREACH(e_border_client_list(), l, bd)
{
E_Border *bd;
bd = l->data;
if (e_object_is_del(E_OBJECT(bd))) continue;
if ((!bd->client.icccm.accepts_focus) &&
(!bd->client.icccm.take_focus)) continue;
@ -934,16 +916,13 @@ _cb_slipshelf_select(const void *data, E_Slipshelf *ess, E_Border *bd)
}
static void
_cb_slipshelf_home2(const void *data, E_Slipshelf *ess, E_Border *bd)
{
Eina_List *l, *borders;
borders = e_border_client_list();
for (l = borders; l; l = l->next)
_cb_slipshelf_home2(const void *data, E_Slipshelf *ess, E_Border *pbd)
{
Eina_List *l;
E_Border *bd;
bd = l->data;
EINA_LIST_FOREACH(e_border_client_list(), l, bd)
{
if (e_object_is_del(E_OBJECT(bd))) continue;
if ((!bd->client.icccm.accepts_focus) &&
(!bd->client.icccm.take_focus)) continue;
@ -957,43 +936,34 @@ static void
_apps_unpopulate(void)
{
char buf[PATH_MAX], *homedir;
Ecore_List *files;
while (sels)
{
evas_object_del(sels->data);
sels = eina_list_remove_list(sels, sels);
}
while (desks)
{
Efreet_Desktop *desktop;
Evas_Object *obj;
Eina_List *files;
char *file;
desktop = desks->data;
EINA_LIST_FREE(sels, obj)
evas_object_del(obj);
EINA_LIST_FREE(desks, desktop)
efreet_desktop_free(desktop);
desks = eina_list_remove_list(desks, desks);
}
if (bx) evas_object_del(bx);
bx = NULL;
if (fm) evas_object_del(fm);
fm = NULL;
if (sf) evas_object_del(sf);
sf = NULL;
homedir = e_user_homedir_get();
snprintf(buf, sizeof(buf), "%s/.e/e/appshadow", homedir);
files = ecore_file_ls(buf);
if (files)
{
char *file;
ecore_list_first_goto(files);
while ((file = ecore_list_current(files)))
EINA_LIST_FREE(files, file)
{
snprintf(buf, sizeof(buf), "%s/.e/e/appshadow/%s", homedir, file);
ecore_file_unlink(buf);
ecore_list_next(files);
}
ecore_list_destroy(files);
free(file);
}
}
@ -1026,8 +996,9 @@ static void
_apps_populate(void)
{
Evas_Coord mw, mh, sfw, sfh;
Evas_Object *o;
char buf[PATH_MAX], *homedir;
Evas_Object *o = NULL;
char buf[PATH_MAX];
char *homedir = NULL;
int num = 0;
sf = e_scrollframe_add(evas);
@ -1066,7 +1037,8 @@ _apps_populate(void)
Efreet_Menu *menu, *entry, *subentry;
Efreet_Desktop *desktop;
char *label, *icon, *plabel;
Ecore_List *settings_desktops, *system_desktops, *keyboard_desktops;
Eina_List *settings_desktops, *system_desktops, *keyboard_desktops;
Eina_List *l, *ll;
settings_desktops = efreet_util_desktop_category_list("Settings");
system_desktops = efreet_util_desktop_category_list("System");
@ -1074,8 +1046,7 @@ _apps_populate(void)
menu = efreet_menu_get();
if (menu)
{
ecore_list_first_goto(menu->entries);
while ((entry = ecore_list_next(menu->entries)))
EINA_LIST_FOREACH(menu->entries, l, entry)
{
if (entry->type != EFREET_MENU_ENTRY_MENU) continue;
@ -1092,8 +1063,7 @@ _apps_populate(void)
e_slidesel_item_distance_set(o, 128);
}
ecore_list_first_goto(entry->entries);
while ((subentry = ecore_list_next(entry->entries)))
EINA_LIST_FOREACH(entry->entries, ll, subentry)
{
if (subentry->type != EFREET_MENU_ENTRY_DESKTOP) continue;
@ -1103,10 +1073,10 @@ _apps_populate(void)
if (!desktop) continue;
if ((settings_desktops) && (system_desktops) &&
(ecore_list_goto(settings_desktops, desktop)) &&
(ecore_list_goto(system_desktops, desktop))) continue;
(eina_list_data_find(settings_desktops, desktop)) &&
(eina_list_data_find(system_desktops, desktop))) continue;
if ((keyboard_desktops) &&
(ecore_list_goto(keyboard_desktops, desktop))) continue;
(eina_list_data_find(keyboard_desktops, desktop))) continue;
if ((desktop) && (desktop->x))
{
@ -1207,20 +1177,18 @@ _apps_populate(void)
static void
_cb_selected(void *data, Evas_Object *obj, void *event_info)
{
Eina_List *selected, *l;
Eina_List *selected;
E_Fm2_Icon_Info *ici;
selected = e_fm2_selected_list_get(obj);
if (!selected) return;
for (l = selected; l; l = l->next)
EINA_LIST_FREE(selected, ici)
{
E_Fm2_Icon_Info *ici;
Efreet_Desktop *desktop;
ici = l->data;
desktop = efreet_desktop_get(ici->real_link);
if (desktop) _desktop_run(desktop);
}
eina_list_free(selected);
}
static int

View File

@ -29,7 +29,7 @@ struct _E_Config_Dialog_Data
int high_temp;
int sensor;
Ecore_List *sensors;
Eina_List *sensors;
Config_Face *inst;
};
@ -71,7 +71,8 @@ _fill_data(E_Config_Dialog_Data *cfdata)
{
double p;
int pi;
Ecore_List *therms;
Eina_List *therms;
Eina_List *l;
char *name;
char path[PATH_MAX];
@ -130,7 +131,7 @@ _fill_data(E_Config_Dialog_Data *cfdata)
{
char *name;
while ((name = ecore_list_next(therms)))
EINA_LIST_FREE(therms, name)
{
if (ecore_file_exists(name))
{
@ -140,7 +141,7 @@ _fill_data(E_Config_Dialog_Data *cfdata)
len = strlen(path);
if (len > 6)
path[len - 6] = '\0';
ecore_list_append(cfdata->sensors, strdup(path));
cfdata->sensors = eina_list_append(cfdata->sensors, strdup(path));
/* TODO: Track down the user friendly names and display them instead.
* User friendly names are not available on the system, lm-sensors
* contains a database in /etc/sensors.conf, but the format may change,
@ -148,12 +149,11 @@ _fill_data(E_Config_Dialog_Data *cfdata)
* don't want to add any more library dependencies.
*/
}
free(name);
}
ecore_list_destroy(therms);
}
ecore_list_first_goto(cfdata->sensors);
while ((name = ecore_list_next(cfdata->sensors)))
EINA_LIST_FOREACH(cfdata->sensors, l, name)
{
if (!strcmp(cfdata->inst->sensor_name, name))
break;
@ -166,7 +166,7 @@ _fill_data(E_Config_Dialog_Data *cfdata)
{
char *name;
while ((name = ecore_list_next(therms)))
EINA_LIST_FREE(therms, name)
{
if (ecore_file_exists(name))
{
@ -176,7 +176,7 @@ _fill_data(E_Config_Dialog_Data *cfdata)
len = strlen(path);
if (len > 6)
path[len - 6] = '\0';
ecore_list_append(cfdata->sensors, strdup(path));
cfdata->sensors = eina_list_append(cfdata->sensors, strdup(path));
/* TODO: Track down the user friendly names and display them instead.
* User friendly names are not available on the system, lm-sensors
* contains a database in /etc/sensors.conf, but the format may change,
@ -184,12 +184,11 @@ _fill_data(E_Config_Dialog_Data *cfdata)
* don't want to add any more library dependencies.
*/
}
free(name);
}
ecore_list_destroy(therms);
}
ecore_list_first_goto(cfdata->sensors);
while ((name = ecore_list_next(cfdata->sensors)))
EINA_LIST_FOREACH(cfdata->sensors, l, name)
{
if (!strcmp(cfdata->inst->sensor_name, name))
break;
@ -202,16 +201,15 @@ _fill_data(E_Config_Dialog_Data *cfdata)
{
int n = 0;
while ((name = ecore_list_next(therms)))
EINA_LIST_FREE(therms, name)
{
ecore_list_append(cfdata->sensors, strdup(name));
cfdata->sensors = eina_list_append(cfdata->sensors, name);
if (!strcmp(cfdata->inst->sensor_name, name))
{
cfdata->sensor = n;
}
n++;
}
ecore_list_destroy(therms);
}
break;
}
@ -224,8 +222,7 @@ _create_data(E_Config_Dialog *cfd)
cfdata = E_NEW(E_Config_Dialog_Data, 1);
cfdata->inst = cfd->data;
cfdata->sensors = ecore_list_new();
ecore_list_free_cb_set(cfdata->sensors, free);
cfdata->sensors = NULL;
_fill_data(cfdata);
return cfdata;
}
@ -233,9 +230,11 @@ _create_data(E_Config_Dialog *cfd)
static void
_free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
{
char *sensor;
cfdata->inst->config_dialog = NULL;
if (cfdata->sensors) ecore_list_destroy(cfdata->sensors);
cfdata->sensors = NULL;
EINA_LIST_FREE(cfdata->sensors, sensor)
free(sensor);
free(cfdata);
}
@ -347,6 +346,7 @@ _advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data
{
Evas_Object *o, *of, *ob;
E_Radio_Group *rg;
Eina_List *l;
o = e_widget_list_add(evas, 0, 0);
of = e_widget_framelist_add(evas, _("Display Units"), 0);
@ -357,7 +357,7 @@ _advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data
e_widget_framelist_object_append(of, ob);
e_widget_list_object_append(o, of, 1, 1, 0.5);
if (!ecore_list_empty_is(cfdata->sensors))
if (cfdata->sensors)
{
/* TODO: Notify user which thermal system is in use */
/* TODO: Let the user choose the wanted thermal system */
@ -366,8 +366,7 @@ _advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data
of = e_widget_framelist_add(evas, _("Sensors"), 0);
rg = e_widget_radio_group_new(&(cfdata->sensor));
ecore_list_first_goto(cfdata->sensors);
while ((name = ecore_list_next(cfdata->sensors)))
EINA_LIST_FOREACH(cfdata->sensors, l, name)
{
ob = e_widget_radio_add(evas, _(name), n, rg);
e_widget_framelist_object_append(of, ob);
@ -446,7 +445,7 @@ _advanced_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
if (cfdata->inst->sensor_name)
eina_stringshare_del(cfdata->inst->sensor_name);
cfdata->inst->sensor_name =
eina_stringshare_add(ecore_list_index_goto(cfdata->sensors, cfdata->sensor));
eina_stringshare_add(eina_list_nth(cfdata->sensors, cfdata->sensor));
temperature_face_update_config(cfdata->inst);
e_config_save_queue();

View File

@ -69,7 +69,7 @@ _gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style)
temperature_config->faces = eina_hash_string_superfast_new(NULL);
eina_hash_direct_add(temperature_config->faces, inst->id, inst);
}
if (!inst->id) eina_stringshare_add(id);
if (!inst->id) inst->id = eina_stringshare_add(id);
E_CONFIG_LIMIT(inst->poll_interval, 1, 1024);
E_CONFIG_LIMIT(inst->low, 0, 100);
E_CONFIG_LIMIT(inst->high, 0, 220);
@ -375,17 +375,16 @@ temperature_face_update_config(Config_Face *inst)
inst);
}
Ecore_List *
Eina_List *
temperature_get_bus_files(const char* bus)
{
Ecore_List *result, *therms;
Eina_List *result, *therms;
char path[PATH_MAX];
char busdir[PATH_MAX];
result = ecore_list_new();
result = NULL;
if (result)
{
ecore_list_free_cb_set(result, free);
snprintf(busdir, sizeof(busdir), "/sys/bus/%s/devices", bus);
/* Look through all the devices for the given bus. */
therms = ecore_file_ls(busdir);
@ -393,19 +392,16 @@ temperature_get_bus_files(const char* bus)
{
char *name;
while ((name = ecore_list_next(therms)))
EINA_LIST_FREE(therms, name)
{
Ecore_List *files;
Eina_List *files;
char *file;
/* Search each device for temp*_input, these should be
* temperature devices. */
snprintf(path, sizeof(path), "%s/%s", busdir, name);
files = ecore_file_ls(path);
if (files)
{
char *file;
while ((file = ecore_list_next(files)))
EINA_LIST_FREE(files, file)
{
if ((!strncmp("temp", file, 4)) &&
(!strcmp("_input", &file[strlen(file) - 6])))
@ -415,15 +411,14 @@ temperature_get_bus_files(const char* bus)
snprintf(path, sizeof(path),
"%s/%s/%s", busdir, name, file);
f = strdup(path);
if (f) ecore_list_append(result, f);
if (f) result = eina_list_append(result, f);
}
free(file);
}
free(name);
}
}
ecore_list_destroy(files);
}
}
ecore_list_destroy(therms);
}
ecore_list_first_goto(result);
}
return result;
}

View File

@ -70,6 +70,6 @@ EAPI int e_modapi_save (E_Module *m);
void config_temperature_module(Config_Face *inst);
void temperature_face_update_config(Config_Face *inst);
Ecore_List *temperature_get_bus_files(const char* bus);
Eina_List *temperature_get_bus_files(const char* bus);
#endif

View File

@ -25,38 +25,31 @@ static void init(void);
static int check(void);
static int poll_cb(void *data);
Ecore_List *
Eina_List *
temperature_get_bus_files(const char* bus)
{
Ecore_List *result;
Ecore_List *therms;
Eina_List *result;
Eina_List *therms;
char path[PATH_MAX];
char busdir[PATH_MAX];
char *name;
result = NULL;
result = ecore_list_new();
if (result)
{
ecore_list_free_cb_set(result, free);
snprintf(busdir, sizeof(busdir), "/sys/bus/%s/devices", bus);
/* Look through all the devices for the given bus. */
therms = ecore_file_ls(busdir);
if (therms)
{
char *name;
while ((name = ecore_list_next(therms)))
EINA_LIST_FREE(therms, name)
{
Ecore_List *files;
Eina_List *files;
char *file;
/* Search each device for temp*_input, these should be
* temperature devices. */
snprintf(path, sizeof(path),"%s/%s", busdir, name);
files = ecore_file_ls(path);
if (files)
{
char *file;
while ((file = ecore_list_next(files)))
EINA_LIST_FREE(files, file)
{
if ((!strncmp("temp", file, 4)) &&
(!strcmp("_input", &file[strlen(file) - 6])))
@ -66,15 +59,11 @@ temperature_get_bus_files(const char* bus)
snprintf(path, sizeof(path),
"%s/%s/%s", busdir, name, file);
f = strdup(path);
if (f) ecore_list_append(result, f);
if (f) result = eina_list_append(result, f);
}
free(file);
}
ecore_list_destroy(files);
}
}
ecore_list_destroy(therms);
}
ecore_list_first_goto(result);
free(name);
}
return result;
}
@ -82,7 +71,7 @@ temperature_get_bus_files(const char* bus)
static void
init(void)
{
Ecore_List *therms;
Eina_List *therms;
char path[PATH_MAX];
#ifdef __FreeBSD__
int len;
@ -99,18 +88,19 @@ init(void)
sensor_name = strdup("tz0");
#else
therms = ecore_file_ls("/proc/acpi/thermal_zone");
if ((therms) && (!ecore_list_empty_is(therms)))
if (therms)
{
char *name;
name = ecore_list_next(therms);
name = eina_list_data_get(therms);
sensor_type = SENSOR_TYPE_LINUX_ACPI;
sensor_name = strdup(name);
ecore_list_destroy(therms);
therms = eina_list_free(therms);
}
else
{
if (therms) ecore_list_destroy(therms);
therms = eina_list_free(therms);
if (ecore_file_exists("/proc/omnibook/temperature"))
{
sensor_type = SENSOR_TYPE_OMNIBOOK;
@ -139,7 +129,7 @@ init(void)
{
char *name;
if ((name = ecore_list_next(therms)))
if ((name = eina_list_data_get(therms)))
{
if (ecore_file_exists(name))
{
@ -158,7 +148,7 @@ init(void)
sensor_path, sensor_name);
}
}
ecore_list_destroy(therms);
therms = eina_list_free(therms);
}
if (!sensor_path)
{
@ -168,7 +158,7 @@ init(void)
{
char *name;
if ((name = ecore_list_next(therms)))
if ((name = eina_list_data_get(therms)))
{
if (ecore_file_exists(name))
{
@ -187,7 +177,7 @@ init(void)
sensor_path, sensor_name);
}
}
ecore_list_destroy(therms);
therms = eina_list_free(therms);
}
}
}
@ -196,6 +186,8 @@ init(void)
}
if ((sensor_type) && (sensor_name) && (!sensor_path))
{
char *name;
switch (sensor_type)
{
case SENSOR_TYPE_NONE:
@ -223,11 +215,8 @@ init(void)
break;
case SENSOR_TYPE_LINUX_I2C:
therms = ecore_file_ls("/sys/bus/i2c/devices");
if (therms)
{
char *name;
while ((name = ecore_list_next(therms)))
EINA_LIST_FREE(therms, name)
{
snprintf(path, sizeof(path),
"/sys/bus/i2c/devices/%s/%s_input",
@ -239,17 +228,13 @@ init(void)
* one for the default. */
break;
}
}
ecore_list_destroy(therms);
free(name);
}
break;
case SENSOR_TYPE_LINUX_PCI:
therms = ecore_file_ls("/sys/bus/pci/devices");
if (therms)
{
char *name;
while ((name = ecore_list_next(therms)))
EINA_LIST_FREE(therms, name)
{
snprintf(path, sizeof(path),
"/sys/bus/pci/devices/%s/%s_input",
@ -261,8 +246,7 @@ init(void)
* one for the default. */
break;
}
}
ecore_list_destroy(therms);
free(name);
}
break;
case SENSOR_TYPE_LINUX_ACPI:

View File

@ -63,21 +63,17 @@ static int _cb_sort_files(char *f1, char *f2)
EAPI void *
e_modapi_init(E_Module *m)
{
Ecore_List *files;
Eina_List *files;
char buf[PATH_MAX];
char *file;
conf_module = m;
e_wizard_init();
snprintf(buf, sizeof(buf), "%s/%s", e_module_dir_get(m), MODULE_ARCH);
files = ecore_file_ls(buf);
if (files)
{
char *file;
ecore_list_first_goto(files);
ecore_list_sort(files, ECORE_COMPARE_CB(_cb_sort_files), ECORE_SORT_MIN);
while ((file = ecore_list_current(files)))
files = eina_list_sort(files, 0, (Eina_Compare_Cb)_cb_sort_files);
EINA_LIST_FREE(files, file)
{
if (!strncmp(file, "page_", 5))
{
@ -98,11 +94,8 @@ e_modapi_init(E_Module *m)
else
printf("%s\n", dlerror());
}
ecore_list_next(files);
free(file);
}
ecore_list_destroy(files);
}
e_wizard_go();
return m;

View File

@ -11,23 +11,18 @@ static void
check_menu_dir(const char *dir)
{
char buf[PATH_MAX], *file;
Ecore_List *files;
Eina_List *files;
snprintf(buf, sizeof(buf), "%s/menus", dir);
files = ecore_file_ls(buf);
if (files)
{
ecore_list_first_goto(files);
while ((file = ecore_list_current(files)))
EINA_LIST_FREE(files, file)
{
if (e_util_glob_match(file, "*.menu"))
{
snprintf(buf, sizeof(buf), "%s/menus/%s", dir, file);
menus = eina_list_append(menus, strdup(buf));
}
ecore_list_next(files);
}
ecore_list_destroy(files);
free(file);
}
}

View File

@ -122,18 +122,14 @@ _app_write(App *a)
EAPI int
wizard_page_init(E_Wizard_Page *pg)
{
Ecore_List *desks = NULL;
Eina_List *desks = NULL;
Efreet_Desktop *desk;
int i;
efreet_util_init();
desks = efreet_util_desktop_name_glob_list("*");
if (desks)
{
Efreet_Desktop *desk;
ecore_list_first_goto(desks);
while ((desk = ecore_list_next(desks)))
EINA_LIST_FREE(desks, desk)
{
char dbuf[4096];
@ -172,8 +168,7 @@ wizard_page_init(E_Wizard_Page *pg)
}
}
}
ecore_list_destroy(desks);
}
efreet_util_shutdown();
// FIXME: list all apps and of the apps either already installed, or to be
// created, offer them to be added to ibar by default. (actually should be

View File

@ -19,19 +19,15 @@ _cb_sort_desks(Efreet_Desktop *d1, Efreet_Desktop *d2)
EAPI int
wizard_page_init(E_Wizard_Page *pg)
{
Ecore_List *desks = NULL;
Eina_List *desks = NULL;
Efreet_Desktop *desk;
int i;
efreet_util_init();
desks = efreet_util_desktop_name_glob_list("*");
if (desks)
{
Efreet_Desktop *desk;
ecore_list_sort(desks, ECORE_COMPARE_CB(_cb_sort_desks), ECORE_SORT_MIN);
ecore_list_first_goto(desks);
while ((desk = ecore_list_next(desks)))
desks = eina_list_sort(desks, 0, (Eina_Compare_Cb)_cb_sort_desks);
EINA_LIST_FREE(desks, desk)
{
char dbuf[4096];
@ -39,8 +35,6 @@ wizard_page_init(E_Wizard_Page *pg)
efreet_desktop_ref(desk);
desktops = eina_list_append(desktops, desk);
}
ecore_list_destroy(desks);
}
efreet_util_shutdown();
if (desktops)
{
@ -113,6 +107,7 @@ wizard_page_hide(E_Wizard_Page *pg)
EAPI int
wizard_page_apply(E_Wizard_Page *pg)
{
Efreet_Desktop *desk;
Eina_List *l;
int i;
FILE *f;
@ -130,7 +125,6 @@ wizard_page_apply(E_Wizard_Page *pg)
{
if (desktops_add[i])
{
Efreet_Desktop *desk;
char *p;
desk = l->data;
@ -142,11 +136,9 @@ wizard_page_apply(E_Wizard_Page *pg)
}
fclose(f);
}
while (desktops)
{
efreet_desktop_free(desktops->data);
desktops = eina_list_remove_list(desktops, desktops);
}
EINA_LIST_FREE(desktops, desk)
efreet_desktop_free(desk);
if (desktops_add)
{
free(desktops_add);

View File

@ -194,10 +194,10 @@ ecore_file_can_exec(const char *file)
return (*func) (file);
}
Ecore_List *
Eina_List *
ecore_file_ls(const char *file)
{
static Ecore_List * (*func) (const char *file) = NULL;
static Eina_List * (*func) (const char *file) = NULL;
if (!func)
func = lib_func("libecore_file.so", "libecore_file.so.1",
"ecore_file_ls", "lib_ecore_file", &lib_ecore_file);