Formatting, Whitespace Removal, Remove redundency in e_configure_del

because deleting of the object handles the same thing.


SVN revision: 40274
This commit is contained in:
Christopher Michael 2009-04-21 18:05:30 +00:00
parent 2206f3134c
commit 2045dc8dc7
1 changed files with 49 additions and 67 deletions

View File

@ -35,14 +35,12 @@ struct _E_Configure_Category
{ {
E_Configure *eco; E_Configure *eco;
const char *label; const char *label;
Eina_List *items; Eina_List *items;
}; };
struct _E_Configure_Item struct _E_Configure_Item
{ {
E_Configure_CB *cb; E_Configure_CB *cb;
const char *label; const char *label;
const char *icon; const char *icon;
}; };
@ -99,8 +97,7 @@ e_configure_show(E_Container *con)
man = e_manager_current_get(); man = e_manager_current_get();
if (!man) return; if (!man) return;
con = e_container_current_get(man); con = e_container_current_get(man);
if (!con) if (!con) con = e_container_number_get(man, 0);
con = e_container_number_get(man, 0);
if (!con) return; if (!con) return;
} }
@ -176,7 +173,6 @@ e_configure_show(E_Container *con)
e_widget_min_size_get(eco->close, &mw, &mh); e_widget_min_size_get(eco->close, &mw, &mh);
edje_extern_object_min_size_set(eco->close, mw, mh); edje_extern_object_min_size_set(eco->close, mw, mh);
edje_object_part_swallow(eco->edje, "e.swallow.button", eco->close); edje_object_part_swallow(eco->edje, "e.swallow.button", eco->close);
edje_object_size_min_calc(eco->edje, &ew, &eh); edje_object_size_min_calc(eco->edje, &ew, &eh);
e_win_size_min_set(eco->win, ew, eh); e_win_size_min_set(eco->win, ew, eh);
e_util_win_auto_resize_fill(eco->win); e_util_win_auto_resize_fill(eco->win);
@ -205,9 +201,6 @@ e_configure_del(void)
{ {
if (_e_configure) if (_e_configure)
{ {
if (_e_configure->mod_hdl)
ecore_event_handler_del(_e_configure->mod_hdl);
_e_configure->mod_hdl = NULL;
e_object_del(E_OBJECT(_e_configure)); e_object_del(E_OBJECT(_e_configure));
_e_configure = NULL; _e_configure = NULL;
} }
@ -224,25 +217,19 @@ _e_configure_free(E_Configure *eco)
{ {
E_Configure_Category *cat; E_Configure_Category *cat;
cat = eco->cats->data; if (!(cat = eco->cats->data)) return;
if (!cat) continue; if (cat->label) eina_stringshare_del(cat->label);
if (cat->label)
eina_stringshare_del(cat->label);
while (cat->items) while (cat->items)
{ {
E_Configure_Item *ci; E_Configure_Item *ci;
ci = cat->items->data; if (!(ci = cat->items->data)) continue;
if (!ci) continue; if (ci->label) eina_stringshare_del(ci->label);
if (ci->label) if (ci->icon) eina_stringshare_del(ci->icon);
eina_stringshare_del(ci->label);
if (ci->icon)
eina_stringshare_del(ci->icon);
if (ci->cb) if (ci->cb)
{ {
if (ci->cb->path) if (ci->cb->path) eina_stringshare_del(ci->cb->path);
eina_stringshare_del(ci->cb->path);
free(ci->cb); free(ci->cb);
} }
cat->items = eina_list_remove_list(cat->items, cat->items); cat->items = eina_list_remove_list(cat->items, cat->items);
@ -265,8 +252,7 @@ _e_configure_cb_del_req(E_Win *win)
{ {
E_Configure *eco; E_Configure *eco;
eco = win->data; if (!(eco = win->data)) return;
if (!eco) return;
e_object_del(E_OBJECT(eco)); e_object_del(E_OBJECT(eco));
} }
@ -276,8 +262,7 @@ _e_configure_cb_resize(E_Win *win)
E_Configure *eco; E_Configure *eco;
Evas_Coord w, h; Evas_Coord w, h;
eco = win->data; if (!(eco = win->data)) return;
if (!eco) return;
ecore_evas_geometry_get(win->ecore_evas, NULL, NULL, &w, &h); ecore_evas_geometry_get(win->ecore_evas, NULL, NULL, &w, &h);
evas_object_resize(eco->edje, w, h); evas_object_resize(eco->edje, w, h);
} }
@ -287,8 +272,7 @@ _e_configure_cb_close(void *data, void *data2)
{ {
E_Configure *eco; E_Configure *eco;
eco = data; if (!(eco = data)) return;
if (!eco) return;
e_util_defer_object_del(E_OBJECT(eco)); e_util_defer_object_del(E_OBJECT(eco));
} }
@ -315,7 +299,8 @@ _e_configure_category_add(E_Configure *eco, const char *label, const char *icon)
} }
eco->cats = eina_list_append(eco->cats, cat); eco->cats = eina_list_append(eco->cats, cat);
e_widget_toolbar_item_append(eco->cat_list, o, label, _e_configure_category_cb, cat, NULL); e_widget_toolbar_item_append(eco->cat_list, o, label,
_e_configure_category_cb, cat, NULL);
return cat; return cat;
} }
@ -327,8 +312,7 @@ _e_configure_category_cb(void *data, void *data2)
Eina_List *l; Eina_List *l;
Evas_Coord w, h; Evas_Coord w, h;
cat = data; if (!(cat = data)) return;
if (!cat) return;
eco = cat->eco; eco = cat->eco;
evas_event_freeze(evas_object_evas_get(eco->item_list)); evas_event_freeze(evas_object_evas_get(eco->item_list));
@ -341,8 +325,7 @@ _e_configure_category_cb(void *data, void *data2)
E_Configure_Item *ci; E_Configure_Item *ci;
Evas_Object *o = NULL; Evas_Object *o = NULL;
ci = l->data; if (!(ci = l->data)) continue;
if (!ci) continue;
if (ci->icon) if (ci->icon)
{ {
o = e_icon_add(eco->evas); o = e_icon_add(eco->evas);
@ -352,7 +335,8 @@ _e_configure_category_cb(void *data, void *data2)
o = e_util_icon_add(ci->icon, eco->evas); o = e_util_icon_add(ci->icon, eco->evas);
} }
} }
e_widget_ilist_append(eco->item_list, o, ci->label, _e_configure_item_cb, ci, NULL); e_widget_ilist_append(eco->item_list, o, ci->label,
_e_configure_item_cb, ci, NULL);
} }
e_widget_ilist_go(eco->item_list); e_widget_ilist_go(eco->item_list);
e_widget_min_size_get(eco->item_list, &w, &h); e_widget_min_size_get(eco->item_list, &w, &h);
@ -386,8 +370,7 @@ _e_configure_item_cb(void *data)
E_Configure_Item *ci; E_Configure_Item *ci;
E_Configure_CB *cb; E_Configure_CB *cb;
ci = data; if (!(ci = data)) return;
if (!ci) return;
cb = ci->cb; cb = ci->cb;
if (cb->path) e_configure_registry_call(cb->path, cb->eco->con, NULL); if (cb->path) e_configure_registry_call(cb->path, cb->eco->con, NULL);
} }
@ -399,8 +382,7 @@ _e_configure_focus_cb(void *data, Evas_Object *obj)
E_Configure *eco; E_Configure *eco;
win = data; win = data;
eco = win->data; if (!(eco = win->data)) return;
if (!eco) return;
if (obj == eco->close) if (obj == eco->close)
{ {
e_widget_focused_object_clear(eco->item_list); e_widget_focused_object_clear(eco->item_list);
@ -465,8 +447,7 @@ _e_configure_keydown_cb(void *data, Evas *e, Evas_Object *obj, void *event)
if (o) if (o)
{ {
o = e_widget_focused_object_get(o); if (!(o = e_widget_focused_object_get(o))) return;
if (!o) return;
e_widget_activate(o); e_widget_activate(o);
} }
} }
@ -480,8 +461,7 @@ _e_configure_fill_cat_list(void *data)
E_Configure_Category *cat; E_Configure_Category *cat;
Eina_List *l; Eina_List *l;
eco = data; if (!(eco = data)) return;
if (!eco) return;
evas_event_freeze(evas_object_evas_get(eco->cat_list)); evas_event_freeze(evas_object_evas_get(eco->cat_list));
edje_freeze(); edje_freeze();
@ -503,8 +483,10 @@ _e_configure_fill_cat_list(void *data)
eci = ll->data; eci = ll->data;
if (eci->pri >= 0) if (eci->pri >= 0)
{ {
snprintf(buf, sizeof(buf), "%s/%s", ecat->cat, eci->item); snprintf(buf, sizeof(buf), "%s/%s", ecat->cat,
_e_configure_item_add(cat, _(eci->label), eci->icon, buf); eci->item);
_e_configure_item_add(cat, _(eci->label),
eci->icon, buf);
} }
} }
} }