a lot more use of stringshare.

SVN revision: 18823
This commit is contained in:
Carsten Haitzler 2005-12-04 12:03:59 +00:00
parent 6f098b1984
commit a3d5f5c28d
28 changed files with 644 additions and 582 deletions

View File

@ -147,7 +147,7 @@ e_bg_add(int container, int zone, int desk_x, int desk_y, char *file)
cfbg->zone = zone; cfbg->zone = zone;
cfbg->desk_x = desk_x; cfbg->desk_x = desk_x;
cfbg->desk_y = desk_y; cfbg->desk_y = desk_y;
cfbg->file = strdup(file); cfbg->file = evas_stringshare_add(file);
e_config->desktop_backgrounds = evas_list_append(e_config->desktop_backgrounds, cfbg); e_config->desktop_backgrounds = evas_list_append(e_config->desktop_backgrounds, cfbg);
} }
@ -165,7 +165,7 @@ e_bg_del(int container, int zone, int desk_x, int desk_y)
(cfbg->desk_x == desk_x) && (cfbg->desk_y == desk_y)) (cfbg->desk_x == desk_x) && (cfbg->desk_y == desk_y))
{ {
e_config->desktop_backgrounds = evas_list_remove_list(e_config->desktop_backgrounds, l); e_config->desktop_backgrounds = evas_list_remove_list(e_config->desktop_backgrounds, l);
E_FREE(cfbg->file); if (cfbg->file) evas_stringshare_del(cfbg->file);
free(cfbg); free(cfbg);
break; break;
} }

View File

@ -2858,7 +2858,7 @@ _e_border_free(E_Border *bd)
free(bd->client.netwm.icons[i].data); free(bd->client.netwm.icons[i].data);
free(bd->client.netwm.icons); free(bd->client.netwm.icons);
} }
if (bd->client.border.name) free(bd->client.border.name); if (bd->client.border.name) evas_stringshare_del(bd->client.border.name);
if (bd->client.icccm.title) free(bd->client.icccm.title); if (bd->client.icccm.title) free(bd->client.icccm.title);
if (bd->client.icccm.name) free(bd->client.icccm.name); if (bd->client.icccm.name) free(bd->client.icccm.name);
if (bd->client.icccm.class) free(bd->client.icccm.class); if (bd->client.icccm.class) free(bd->client.icccm.class);
@ -4583,14 +4583,14 @@ _e_border_eval(E_Border *bd)
{ {
if (bd->client.netwm.type == ECORE_X_WINDOW_TYPE_DESKTOP) if (bd->client.netwm.type == ECORE_X_WINDOW_TYPE_DESKTOP)
{ {
if (bd->client.border.name) free(bd->client.border.name); if (bd->client.border.name) evas_stringshare_del(bd->client.border.name);
bd->client.border.name = strdup("borderless"); bd->client.border.name = evas_stringshare_add("borderless");
bd->client.border.changed = 1; bd->client.border.changed = 1;
} }
if (bd->client.netwm.type == ECORE_X_WINDOW_TYPE_DOCK) else if (bd->client.netwm.type == ECORE_X_WINDOW_TYPE_DOCK)
{ {
if (bd->client.border.name) free(bd->client.border.name); if (bd->client.border.name) evas_stringshare_del(bd->client.border.name);
bd->client.border.name = strdup("borderless"); bd->client.border.name = evas_stringshare_add("borderless");
bd->client.border.changed = 1; bd->client.border.changed = 1;
if (!bd->client.netwm.state.skip_pager) if (!bd->client.netwm.state.skip_pager)
@ -4742,11 +4742,11 @@ _e_border_eval(E_Border *bd)
if (((!bd->lock_border) || (!bd->client.border.name)) if (((!bd->lock_border) || (!bd->client.border.name))
&& (!bd->shaded)) && (!bd->shaded))
{ {
if (bd->client.border.name) free(bd->client.border.name); if (bd->client.border.name) evas_stringshare_del(bd->client.border.name);
if (bd->client.mwm.borderless) if (bd->client.mwm.borderless)
bd->client.border.name = strdup("borderless"); bd->client.border.name = evas_stringshare_add("borderless");
else else
bd->client.border.name = strdup("default"); bd->client.border.name = evas_stringshare_add("default");
// if (bd->client.mwm.borderless) // if (bd->client.mwm.borderless)
// printf("client %s borderless\n", bd->client.icccm.title); // printf("client %s borderless\n", bd->client.icccm.title);
bd->client.border.changed = 1; bd->client.border.changed = 1;
@ -4895,9 +4895,10 @@ _e_border_eval(E_Border *bd)
} }
if (rem->apply & E_REMEMBER_APPLY_BORDER) if (rem->apply & E_REMEMBER_APPLY_BORDER)
{ {
E_FREE(bd->client.border.name); if (bd->client.border.name) evas_stringshare_del(bd->client.border.name);
bd->client.border.name = NULL;
if (rem->prop.border) if (rem->prop.border)
bd->client.border.name = strdup(rem->prop.border); bd->client.border.name = evas_stringshare_add(rem->prop.border);
bd->client.border.changed = 1; bd->client.border.changed = 1;
} }
if (rem->apply & E_REMEMBER_APPLY_STICKY) if (rem->apply & E_REMEMBER_APPLY_STICKY)
@ -4953,9 +4954,7 @@ _e_border_eval(E_Border *bd)
int ok; int ok;
if (!bd->client.border.name) if (!bd->client.border.name)
{ bd->client.border.name = evas_stringshare_add("default");
bd->client.border.name = strdup("default");
}
if (bd->bg_object) if (bd->bg_object)
{ {
bd->w -= (bd->client_inset.l + bd->client_inset.r); bd->w -= (bd->client_inset.l + bd->client_inset.r);

File diff suppressed because it is too large Load Diff

View File

@ -4,14 +4,7 @@
#ifdef E_TYPEDEFS #ifdef E_TYPEDEFS
#define E_CONFIG_DD_NEW(str, typ) \ #define E_CONFIG_DD_NEW(str, typ) \
eet_data_descriptor_new(str, sizeof(typ), \ e_config_descriptor_new(str, sizeof(typ))
(void *(*) (void *))evas_list_next, \
(void *(*) (void *, void *))evas_list_append, \
(void *(*) (void *))evas_list_data, \
(void *(*) (void *))evas_list_free, \
(void (*) (void *, int (*) (void *, const char *, void *, void *), void *))evas_hash_foreach, \
(void *(*) (void *, const char *, void *))evas_hash_add, \
(void (*) (void *))evas_hash_free)
#define E_CONFIG_DD_FREE(eed) if (eed) { eet_data_descriptor_free((eed)); (eed) = NULL; } #define E_CONFIG_DD_FREE(eed) if (eed) { eet_data_descriptor_free((eed)); (eed) = NULL; }
#define E_CONFIG_VAL(edd, type, member, dtype) EET_DATA_DESCRIPTOR_ADD_BASIC(edd, type, #member, member, dtype) #define E_CONFIG_VAL(edd, type, member, dtype) EET_DATA_DESCRIPTOR_ADD_BASIC(edd, type, #member, member, dtype)
#define E_CONFIG_SUB(edd, type, member, eddtype) EET_DATA_DESCRIPTOR_ADD_SUB(edd, type, #member, member, eddtype) #define E_CONFIG_SUB(edd, type, member, eddtype) EET_DATA_DESCRIPTOR_ADD_SUB(edd, type, #member, member, eddtype)
@ -270,6 +263,8 @@ struct _E_Config_Desktop_Name
EAPI int e_config_init(void); EAPI int e_config_init(void);
EAPI int e_config_shutdown(void); EAPI int e_config_shutdown(void);
EAPI E_Config_DD *e_config_descriptor_new(const char *name, int size);
EAPI int e_config_save(void); EAPI int e_config_save(void);
EAPI void e_config_save_flush(void); EAPI void e_config_save_flush(void);
EAPI void e_config_save_queue(void); EAPI void e_config_save_queue(void);

View File

@ -43,8 +43,8 @@ e_config_dialog_new(E_Container *con, char *title, char *icon, int icon_size, E_
static void static void
_e_config_dialog_free(E_Config_Dialog *cfd) _e_config_dialog_free(E_Config_Dialog *cfd)
{ {
evas_stringshare_del(cfd->title); if (cfd->title) evas_stringshare_del(cfd->title);
evas_stringshare_del(cfd->icon); if (cfd->icon) evas_stringshare_del(cfd->icon);
if (cfd->cfdata) if (cfd->cfdata)
{ {
cfd->view.free_cfdata(cfd, cfd->cfdata); cfd->view.free_cfdata(cfd, cfd->cfdata);

View File

@ -116,7 +116,7 @@ e_container_new(E_Manager *man)
con->num = container_num; con->num = container_num;
container_num++; container_num++;
snprintf(name, sizeof(name), _("Container %d"), con->num); snprintf(name, sizeof(name), _("Container %d"), con->num);
con->name = strdup(name); con->name = evas_stringshare_add(name);
/* init layers */ /* init layers */
for (i = 0; i < 7; i++) for (i = 0; i < 7; i++)
@ -969,7 +969,7 @@ _e_container_free(E_Container *con)
{ {
ecore_x_window_del(con->win); ecore_x_window_del(con->win);
} }
if (con->name) free(con->name); if (con->name) evas_stringshare_del(con->name);
free(con); free(con);
} }

View File

@ -101,7 +101,7 @@ e_desk_name_add(int container, int zone, int desk_x, int desk_y, char *name)
cfname->zone = zone; cfname->zone = zone;
cfname->desk_x = desk_x; cfname->desk_x = desk_x;
cfname->desk_y = desk_y; cfname->desk_y = desk_y;
cfname->name = strdup(name); cfname->name = evas_stringshare_add(name);
e_config->desktop_names = evas_list_append(e_config->desktop_names, cfname); e_config->desktop_names = evas_list_append(e_config->desktop_names, cfname);
} }
@ -119,7 +119,7 @@ e_desk_name_del(int container, int zone, int desk_x, int desk_y)
(cfname->desk_x == desk_x) && (cfname->desk_y == desk_y)) (cfname->desk_x == desk_x) && (cfname->desk_y == desk_y))
{ {
e_config->desktop_names = evas_list_remove_list(e_config->desktop_names, l); e_config->desktop_names = evas_list_remove_list(e_config->desktop_names, l);
E_FREE(cfname->name); if (cfname->name) evas_stringshare_del(cfname->name);
free(cfname); free(cfname);
break; break;
} }

View File

@ -45,7 +45,12 @@ static Evas_Object *_e_eap_edit_basic_create_widgets(E_Config_Dialog *cfd, Eva
static Evas_Object *_e_eap_edit_advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, void *data); static Evas_Object *_e_eap_edit_advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, void *data);
static void _e_eap_edit_select_cb(Evas_Object *obj, char *file, void *data); static void _e_eap_edit_select_cb(Evas_Object *obj, char *file, void *data);
#define IFDUP(src, dst) if(src) dst = strdup(src); else dst = NULL #define IFDUP(src, dst) if (src) dst = strdup(src); else dst = NULL
/* FIXME: this eap editor is half-done. first advanced mode needs to ALSO
* cover basic config - image saving is broken, makign new icons is broken
* along with e_apps.c etc. all in all - this is not usable.
*/
/* externally accessible functions */ /* externally accessible functions */
@ -109,7 +114,20 @@ _e_eap_edit_create_data(E_Config_Dialog *cfd)
static void static void
_e_eap_edit_free_data(E_Config_Dialog *cfd, void *data) _e_eap_edit_free_data(E_Config_Dialog *cfd, void *data)
{ {
E_App_Edit_CFData *cfdata;
cfdata = data;
E_FREE(cfdata->name);
E_FREE(cfdata->exe);
E_FREE(cfdata->generic);
E_FREE(cfdata->comment);
E_FREE(cfdata->wname);
E_FREE(cfdata->wclass);
E_FREE(cfdata->wtitle);
E_FREE(cfdata->wrole);
E_FREE(cfdata->path);
E_FREE(cfdata->image);
free(data); free(data);
} }
@ -124,23 +142,23 @@ _e_eap_edit_basic_apply_data(E_Config_Dialog *cfd, void *data)
editor = cfdata->editor; editor = cfdata->editor;
eap = editor->eap; eap = editor->eap;
if(!(cfdata->path)) if (!(cfdata->path))
return -1; return -1;
E_FREE(eap->name); if (eap->name) evas_stringshare_del(eap->name);
E_FREE(eap->exe); if (eap->exe) evas_stringshare_del(eap->exe);
E_FREE(eap->image); if (eap->image) evas_stringshare_del(eap->image);
IFDUP(cfdata->name, eap->name); if (cfdata->name) eap->name = evas_stringshare_add(cfdata->name);
IFDUP(cfdata->exe, eap->exe); if (cfdata->exe) eap->exe = evas_stringshare_add(cfdata->exe);
IFDUP(cfdata->image, eap->image); if (cfdata->image) eap->image = evas_stringshare_add(cfdata->image);
eap->startup_notify = cfdata->startup_notify; eap->startup_notify = cfdata->startup_notify;
eap->wait_exit = cfdata->wait_exit; eap->wait_exit = cfdata->wait_exit;
e_app_fields_save(eap); e_app_fields_save(eap);
return 1; return 1;
} }
static int static int
@ -154,39 +172,44 @@ _e_eap_edit_advanced_apply_data(E_Config_Dialog *cfd, void *data)
editor = cfdata->editor; editor = cfdata->editor;
eap = editor->eap; eap = editor->eap;
if(!(cfdata->path)) if (!(cfdata->path))
return -1; return -1;
E_FREE(eap->generic);
E_FREE(eap->comment);
E_FREE(eap->win_name);
E_FREE(eap->win_class);
E_FREE(eap->win_title);
E_FREE(eap->win_role);
E_FREE(eap->icon_class);
E_FREE(eap->path);
if(cfdata->startup_notify) if (eap->name) evas_stringshare_del(eap->name);
if (eap->exe) evas_stringshare_del(eap->exe);
if (eap->image) evas_stringshare_del(eap->image);
if (eap->generic) evas_stringshare_del(eap->generic);
if (eap->comment) evas_stringshare_del(eap->comment);
if (eap->win_name) evas_stringshare_del(eap->win_name);
if (eap->win_class) evas_stringshare_del(eap->win_class);
if (eap->win_title) evas_stringshare_del(eap->win_title);
if (eap->win_role) evas_stringshare_del(eap->win_role);
if (eap->icon_class) evas_stringshare_del(eap->icon_class);
if (eap->path) evas_stringshare_del(eap->path);
if (cfdata->startup_notify)
eap->startup_notify = 1; eap->startup_notify = 1;
else eap->startup_notify = 0; else eap->startup_notify = 0;
if(cfdata->wait_exit) if (cfdata->wait_exit)
eap->wait_exit = 1; eap->wait_exit = 1;
else eap->wait_exit = 0; else eap->wait_exit = 0;
IFDUP(cfdata->generic, eap->generic); if (cfdata->name) eap->name = evas_stringshare_add(cfdata->name);
IFDUP(cfdata->comment, eap->comment); if (cfdata->exe) eap->exe = evas_stringshare_add(cfdata->exe);
IFDUP(cfdata->wname, eap->win_name); if (cfdata->image) eap->image = evas_stringshare_add(cfdata->image);
IFDUP(cfdata->wclass, eap->win_class);
IFDUP(cfdata->wtitle, eap->win_title); if (cfdata->generic) eap->generic = evas_stringshare_add(cfdata->generic);
IFDUP(cfdata->wrole, eap->win_role); if (cfdata->comment) eap->comment = evas_stringshare_add(cfdata->comment);
IFDUP(cfdata->iclass, eap->icon_class); if (cfdata->wname) eap->win_name = evas_stringshare_add(cfdata->wname);
IFDUP(cfdata->path, eap->path); if (cfdata->wclass) eap->win_class = evas_stringshare_add(cfdata->wclass);
if (cfdata->wtitle) eap->win_title = evas_stringshare_add(cfdata->wtitle);
if (cfdata->wrole) eap->win_role = evas_stringshare_add(cfdata->wrole);
if (cfdata->iclass) eap->icon_class = evas_stringshare_add(cfdata->iclass);
if (cfdata->path) eap->path = evas_stringshare_add(cfdata->path);
e_app_fields_save(eap); e_app_fields_save(eap);
return 1; return 1;
} }

View File

@ -96,7 +96,7 @@ e_error_message_manager_show(E_Manager *man, char *title, char *txt)
o = evas_object_image_add(e); o = evas_object_image_add(e);
s = e_path_find(path_images, "e.png"); s = e_path_find(path_images, "e.png");
evas_object_image_file_set(o, s, NULL); evas_object_image_file_set(o, s, NULL);
E_FREE(s); if (s) evas_stringshare_del(s);
evas_object_move(o, 16, 16); evas_object_move(o, 16, 16);
evas_object_resize(o, 64, 64); evas_object_resize(o, 64, 64);
evas_object_image_fill_set(o, 0, 0, 64, 64); evas_object_image_fill_set(o, 0, 0, 64, 64);
@ -181,7 +181,7 @@ e_error_message_manager_show(E_Manager *man, char *title, char *txt)
o = evas_object_image_add(e); o = evas_object_image_add(e);
s = e_path_find(path_images, "button_out.png"); s = e_path_find(path_images, "button_out.png");
evas_object_image_file_set(o, s, NULL); evas_object_image_file_set(o, s, NULL);
E_FREE(s); if (s) evas_stringshare_del(s);
evas_object_move(o, (error_w - 64) / 2, error_h - 16 - 32); evas_object_move(o, (error_w - 64) / 2, error_h - 16 - 32);
evas_object_resize(o, 64, 32); evas_object_resize(o, 64, 32);
evas_object_image_fill_set(o, 0, 0, 64, 32); evas_object_image_fill_set(o, 0, 0, 64, 32);
@ -211,7 +211,7 @@ e_error_message_manager_show(E_Manager *man, char *title, char *txt)
o = evas_object_image_add(e); o = evas_object_image_add(e);
s = e_path_find(path_images, "error_bg.png"); s = e_path_find(path_images, "error_bg.png");
evas_object_image_file_set(o, s, NULL); evas_object_image_file_set(o, s, NULL);
E_FREE(s); if (s) evas_stringshare_del(s);
evas_object_move(o, 0, 0); evas_object_move(o, 0, 0);
evas_object_image_fill_set(o, 0, 0, error_w, error_h); evas_object_image_fill_set(o, 0, 0, error_w, error_h);
evas_object_resize(o, error_w, error_h); evas_object_resize(o, error_w, error_h);
@ -364,7 +364,7 @@ _e_error_cb_ok_down(void *data, Evas *e, Evas_Object *obj, void *event_info)
ee = data; ee = data;
s = e_path_find(path_images, "button_in.png"); s = e_path_find(path_images, "button_in.png");
evas_object_image_file_set(obj, s, NULL); evas_object_image_file_set(obj, s, NULL);
E_FREE(s); if (s) evas_stringshare_del(s);
} }
static void static void
@ -380,7 +380,7 @@ _e_error_cb_ok_up(void *data, Evas *e, Evas_Object *obj, void *event_info)
ee = data; ee = data;
s = e_path_find(path_images, "button_out.png"); s = e_path_find(path_images, "button_out.png");
evas_object_image_file_set(obj, s, NULL); evas_object_image_file_set(obj, s, NULL);
E_FREE(s); if (s) evas_stringshare_del(s);
o = evas_object_name_find(ecore_evas_get(ee), "allocated"); o = evas_object_name_find(ecore_evas_get(ee), "allocated");
if (o) if (o)
{ {

View File

@ -48,9 +48,9 @@ e_file_dialog_new(E_Container *con)
list = e_widget_framelist_add(evas, _("Places"), 0); list = e_widget_framelist_add(evas, _("Places"), 0);
e_widget_framelist_content_align_set(list, 0.5, 0.0); e_widget_framelist_content_align_set(list, 0.5, 0.0);
e_widget_framelist_object_append(list, e_widget_button_add(evas, strdup(_("Home")), "fileman/home", NULL, NULL, NULL)); e_widget_framelist_object_append(list, e_widget_button_add(evas, _("Home"), "fileman/home", NULL, NULL, NULL));
e_widget_framelist_object_append(list, e_widget_button_add(evas, strdup(_("Desktop")), "fileman/desktop", NULL, NULL, NULL)); e_widget_framelist_object_append(list, e_widget_button_add(evas, _("Desktop"), "fileman/desktop", NULL, NULL, NULL));
e_widget_framelist_object_append(list, e_widget_button_add(evas, strdup(_("Icons")), "fileman/folder", NULL, NULL, NULL)); e_widget_framelist_object_append(list, e_widget_button_add(evas, _("Icons"), "fileman/folder", NULL, NULL, NULL));
e_widget_list_object_append(ol, list, 1, 0, 0.0); e_widget_list_object_append(ol, list, 1, 0, 0.0);
fm = e_widget_fileman_add(evas, &(dia->file)); fm = e_widget_fileman_add(evas, &(dia->file));

View File

@ -157,7 +157,7 @@ e_font_fallback_prepend(const char *font)
e_font_fallback_remove (font); e_font_fallback_remove (font);
eff = E_NEW(E_Font_Fallback, 1); eff = E_NEW(E_Font_Fallback, 1);
eff->name = strdup(font); eff->name = evas_stringshare_add(font);
e_config->font_fallbacks = evas_list_prepend(e_config->font_fallbacks, eff); e_config->font_fallbacks = evas_list_prepend(e_config->font_fallbacks, eff);
} }

View File

@ -628,7 +628,7 @@ e_gadman_client_menu_new(E_Gadman_Client *gmc)
e_menu_item_toggle_set(mi, gmc->use_autow); e_menu_item_toggle_set(mi, gmc->use_autow);
s = e_path_find(path_icons, "default.edj"); s = e_path_find(path_icons, "default.edj");
e_menu_item_icon_edje_set(mi, s, "auto_width"); e_menu_item_icon_edje_set(mi, s, "auto_width");
E_FREE(s); if (s) evas_stringshare_del(s);
e_menu_item_callback_set(mi, _e_gadman_cb_auto_width, gmc); e_menu_item_callback_set(mi, _e_gadman_cb_auto_width, gmc);
mi = e_menu_item_new(m); mi = e_menu_item_new(m);
e_menu_item_separator_set(mi, 1); e_menu_item_separator_set(mi, 1);
@ -637,13 +637,13 @@ e_gadman_client_menu_new(E_Gadman_Client *gmc)
e_menu_item_label_set(mi, _("Half Screen Width")); e_menu_item_label_set(mi, _("Half Screen Width"));
s = e_path_find(path_icons, "default.edj"); s = e_path_find(path_icons, "default.edj");
e_menu_item_icon_edje_set(mi, s, "half_width"); e_menu_item_icon_edje_set(mi, s, "half_width");
E_FREE(s); if (s) evas_stringshare_del(s);
e_menu_item_callback_set(mi, _e_gadman_cb_half_width, gmc); e_menu_item_callback_set(mi, _e_gadman_cb_half_width, gmc);
mi = e_menu_item_new(m); mi = e_menu_item_new(m);
e_menu_item_label_set(mi, _("Full Screen Width")); e_menu_item_label_set(mi, _("Full Screen Width"));
s = e_path_find(path_icons, "default.edj"); s = e_path_find(path_icons, "default.edj");
e_menu_item_icon_edje_set(mi, s, "full_width"); e_menu_item_icon_edje_set(mi, s, "full_width");
E_FREE(s); if (s) evas_stringshare_del(s);
e_menu_item_callback_set(mi, _e_gadman_cb_full_width, gmc); e_menu_item_callback_set(mi, _e_gadman_cb_full_width, gmc);
} }
disallow = (gmc->policy & E_GADMAN_POLICY_EDGES) disallow = (gmc->policy & E_GADMAN_POLICY_EDGES)
@ -655,7 +655,7 @@ e_gadman_client_menu_new(E_Gadman_Client *gmc)
e_menu_item_label_set(mi, _("Center Horizontally")); e_menu_item_label_set(mi, _("Center Horizontally"));
s = e_path_find(path_icons, "default.edj"); s = e_path_find(path_icons, "default.edj");
e_menu_item_icon_edje_set(mi, s, "center_horiz"); e_menu_item_icon_edje_set(mi, s, "center_horiz");
E_FREE(s); if (s) evas_stringshare_del(s);
e_menu_item_callback_set(mi, _e_gadman_cb_center_horiz, gmc); e_menu_item_callback_set(mi, _e_gadman_cb_center_horiz, gmc);
} }
if (seperator) if (seperator)
@ -675,7 +675,7 @@ e_gadman_client_menu_new(E_Gadman_Client *gmc)
e_menu_item_toggle_set(mi, gmc->use_autoh); e_menu_item_toggle_set(mi, gmc->use_autoh);
s = e_path_find(path_icons, "default.edj"), s = e_path_find(path_icons, "default.edj"),
e_menu_item_icon_edje_set(mi, s, "auto_height"); e_menu_item_icon_edje_set(mi, s, "auto_height");
E_FREE(s); if (s) evas_stringshare_del(s);
e_menu_item_callback_set(mi, _e_gadman_cb_auto_height, gmc); e_menu_item_callback_set(mi, _e_gadman_cb_auto_height, gmc);
mi = e_menu_item_new(m); mi = e_menu_item_new(m);
e_menu_item_separator_set(mi, 1); e_menu_item_separator_set(mi, 1);
@ -684,12 +684,13 @@ e_gadman_client_menu_new(E_Gadman_Client *gmc)
e_menu_item_label_set(mi, _("Half Screen Height")); e_menu_item_label_set(mi, _("Half Screen Height"));
s = e_path_find(path_icons, "default.edj"); s = e_path_find(path_icons, "default.edj");
e_menu_item_icon_edje_set(mi, s, "half_height"); e_menu_item_icon_edje_set(mi, s, "half_height");
E_FREE(s); if (s) evas_stringshare_del(s);
e_menu_item_callback_set(mi, _e_gadman_cb_half_height, gmc); e_menu_item_callback_set(mi, _e_gadman_cb_half_height, gmc);
mi = e_menu_item_new(m); mi = e_menu_item_new(m);
e_menu_item_label_set(mi, _("Full Screen Height")); e_menu_item_label_set(mi, _("Full Screen Height"));
s = e_path_find(path_icons, "default.edj"); s = e_path_find(path_icons, "default.edj");
e_menu_item_icon_edje_set(mi, s, "full_height"); e_menu_item_icon_edje_set(mi, s, "full_height");
if (s) evas_stringshare_del(s);
e_menu_item_callback_set(mi, _e_gadman_cb_full_height, gmc); e_menu_item_callback_set(mi, _e_gadman_cb_full_height, gmc);
} }
disallow = (gmc->policy & E_GADMAN_POLICY_EDGES) disallow = (gmc->policy & E_GADMAN_POLICY_EDGES)
@ -701,7 +702,7 @@ e_gadman_client_menu_new(E_Gadman_Client *gmc)
e_menu_item_label_set(mi, _("Center Vertically")); e_menu_item_label_set(mi, _("Center Vertically"));
s = e_path_find(path_icons, "default.edj"); s = e_path_find(path_icons, "default.edj");
e_menu_item_icon_edje_set(mi, s, "center_vert"); e_menu_item_icon_edje_set(mi, s, "center_vert");
E_FREE(s); if (s) evas_stringshare_del(s);
e_menu_item_callback_set(mi, _e_gadman_cb_center_vert, gmc); e_menu_item_callback_set(mi, _e_gadman_cb_center_vert, gmc);
} }
if (seperator) if (seperator)

View File

@ -70,7 +70,7 @@ e_init_init(void)
/* FIXME: "init.edj" needs to come from config */ /* FIXME: "init.edj" needs to come from config */
s = e_path_find(path_init, "init.edj"), s = e_path_find(path_init, "init.edj"),
edje_object_file_set(o, s, "init/splash"); edje_object_file_set(o, s, "init/splash");
E_FREE(s); if (s) evas_stringshare_del(s);
_e_init_object = o; _e_init_object = o;
} }
/* other screens */ /* other screens */
@ -79,7 +79,7 @@ e_init_init(void)
/* FIXME: "init.edj" needs to come from config */ /* FIXME: "init.edj" needs to come from config */
s = e_path_find(path_init, "init.edj"), s = e_path_find(path_init, "init.edj"),
edje_object_file_set(o, s, "init/extra_screen"); edje_object_file_set(o, s, "init/extra_screen");
E_FREE(s); if (s) evas_stringshare_del(s);
} }
evas_object_move(o, scr->x, scr->y); evas_object_move(o, scr->x, scr->y);
evas_object_resize(o, scr->w, scr->h); evas_object_resize(o, scr->w, scr->h);
@ -92,7 +92,7 @@ e_init_init(void)
/* FIXME: "init.edj" needs to come from config */ /* FIXME: "init.edj" needs to come from config */
s = e_path_find(path_init, "init.edj"), s = e_path_find(path_init, "init.edj"),
edje_object_file_set(o, s, "init/splash"); edje_object_file_set(o, s, "init/splash");
E_FREE(s); if (s) evas_stringshare_del(s);
_e_init_object = o; _e_init_object = o;
evas_object_move(o, 0, 0); evas_object_move(o, 0, 0);
evas_object_resize(o, w, h); evas_object_resize(o, w, h);

View File

@ -125,8 +125,8 @@ _basic_apply_data(E_Config_Dialog *cfd, CFData *cfdata)
} }
if ((!cfdata->border->lock_border) && (!cfdata->border->shaded)) if ((!cfdata->border->lock_border) && (!cfdata->border->shaded))
{ {
if (cfdata->border->client.border.name) free(cfdata->border->client.border.name); if (cfdata->border->client.border.name) evas_stringshare_del(cfdata->border->client.border.name);
cfdata->border->client.border.name = strdup(cfdata->bordername); cfdata->border->client.border.name = evas_stringshare_add(cfdata->bordername);
cfdata->border->client.border.changed = 1; cfdata->border->client.border.changed = 1;
cfdata->border->changed = 1; cfdata->border->changed = 1;
} }

View File

@ -512,13 +512,14 @@ _e_border_menu_cb_icon_edit(void *data, E_Menu *m, E_Menu_Item *mi)
bd = data; bd = data;
a = bd->app; a = bd->app;
if (!a) if ((!a) && (bd->client.icccm.class))
{ {
static char buf[PATH_MAX]; static char buf[PATH_MAX];
char *name, *homedir, *p; char *name, *homedir, *p;
int instance; int instance;
name = strdup(bd->client.icccm.class); name = alloca(strlen(bd->client.icccm.class) + 1);
strcpy(name, bd->client.icccm.class);
p = name; p = name;
while (*p) while (*p)
{ {
@ -536,17 +537,16 @@ _e_border_menu_cb_icon_edit(void *data, E_Menu *m, E_Menu_Item *mi)
instance++; instance++;
} }
free(homedir); free(homedir);
free(name);
a = e_app_empty_new(buf); a = e_app_empty_new(buf);
if (a) if (a)
{ {
a->win_name = strdup(bd->client.icccm.name); if (bd->client.icccm.name) a->win_name = evas_stringshare_add(bd->client.icccm.name);
a->win_class = strdup(bd->client.icccm.class); if (bd->client.icccm.class) a->win_class = evas_stringshare_add(bd->client.icccm.class);
if (bd->client.icccm.window_role) if (bd->client.icccm.window_role)
a->win_role = strdup(bd->client.icccm.window_role); a->win_role = evas_stringshare_add(bd->client.icccm.window_role);
a->icon_class = strdup(bd->client.icccm.class); if (bd->client.icccm.class) a->icon_class = evas_stringshare_add(bd->client.icccm.class);
a->name = strdup(bd->client.icccm.class); if (bd->client.icccm.class) a->name = evas_stringshare_add(bd->client.icccm.class);
a->exe = strdup(bd->client.icccm.name); if (bd->client.icccm.name) a->exe = evas_stringshare_add(bd->client.icccm.name);
if (bd->client.netwm.startup_id > 0) if (bd->client.netwm.startup_id > 0)
a->startup_notify = 1; a->startup_notify = 1;
} }
@ -618,12 +618,12 @@ _e_border_menu_cb_borderless(void *data, E_Menu *m, E_Menu_Item *mi)
if ((!bd->lock_border) && (!bd->shaded)) if ((!bd->lock_border) && (!bd->shaded))
{ {
if (bd->client.border.name) free(bd->client.border.name); if (bd->client.border.name) evas_stringshare_del(bd->client.border.name);
toggle = e_menu_item_toggle_get(mi); toggle = e_menu_item_toggle_get(mi);
if (toggle) if (toggle)
bd->client.border.name = strdup("borderless"); bd->client.border.name = evas_stringshare_add("borderless");
else else
bd->client.border.name = strdup("default"); bd->client.border.name = evas_stringshare_add("default");
bd->client.border.changed = 1; bd->client.border.changed = 1;
bd->changed = 1; bd->changed = 1;
} }

View File

@ -90,8 +90,8 @@ _basic_apply_data(E_Config_Dialog *cfd, CFData *cfdata)
/* Actually take our cfdata settings and apply them in real life */ /* Actually take our cfdata settings and apply them in real life */
printf("file: %s\n", cfdata->file); printf("file: %s\n", cfdata->file);
//e_bg_add(cfd->con, z, 0, 0, cfdata->file); //e_bg_add(cfd->con, z, 0, 0, cfdata->file);
E_FREE(e_config->desktop_default_background); if (e_config->desktop_default_background) evas_stringshare_del(e_config->desktop_default_background);
e_config->desktop_default_background = strdup(cfdata->file); e_config->desktop_default_background = evas_stringshare_add(cfdata->file);
e_bg_update(); e_bg_update();
return 1; /* Apply was OK */ return 1; /* Apply was OK */
} }
@ -167,7 +167,7 @@ _basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, CFData *cfdata)
continue; continue;
/* minimum theme requirements */ /* minimum theme requirements */
if(edje_object_file_set(o, fullbg, "desktop/background")) if (edje_object_file_set(o, fullbg, "desktop/background"))
{ {
Evas_Object *o = NULL; Evas_Object *o = NULL;
char *noext, *ext; char *noext, *ext;
@ -194,14 +194,16 @@ _basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, CFData *cfdata)
cb_data->cfd = cfd; cb_data->cfd = cfd;
cb_data->file = strdup(fullbg); cb_data->file = strdup(fullbg);
e_widget_ilist_append(il, o, noext, _e_config_bg_cb_standard, cb_data, fullbg); e_widget_ilist_append(il, o, noext, _e_config_bg_cb_standard, cb_data, fullbg);
if(!strcmp(e_config->desktop_default_background, fullbg))
if (!strcmp(e_config->desktop_default_background, fullbg))
{ {
e_widget_ilist_select_set(il, i); e_widget_ilist_select_set(il, i);
bg = edje_object_add(evas); bg = edje_object_add(evas);
edje_object_file_set(bg, e_config->desktop_default_background, "desktop/background"); edje_object_file_set(bg, e_config->desktop_default_background, "desktop/background");
im = e_widget_image_add_from_object(evas, bg, 160, 120); im = e_widget_image_add_from_object(evas, bg, 160, 120);
} }
free(noext);
i++; i++;
} }
} }
@ -216,7 +218,7 @@ _basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, CFData *cfdata)
e_widget_min_size_set(il, 240, 320); e_widget_min_size_set(il, 240, 320);
e_widget_table_object_append(o, il, 0, 0, 1, 2, 1, 1, 1, 1); e_widget_table_object_append(o, il, 0, 0, 1, 2, 1, 1, 1, 1);
fr = e_widget_framelist_add(evas, "Preview", 0); fr = e_widget_framelist_add(evas, "Preview", 0);
if(im == NULL) if (im == NULL)
{ {
bg = edje_object_add(evas); bg = edje_object_add(evas);
e_theme_edje_object_set(bg, "base/theme/background", "desktop/background"); e_theme_edje_object_set(bg, "base/theme/background", "desktop/background");

View File

@ -724,7 +724,7 @@ _e_int_menus_clients_pre_cb(void *data, E_Menu *m)
e_menu_item_label_set(mi, _("Cleanup Windows")); e_menu_item_label_set(mi, _("Cleanup Windows"));
s = e_path_find(path_icons, "default.edj"); s = e_path_find(path_icons, "default.edj");
e_menu_item_icon_edje_set(mi, s, "windows"); e_menu_item_icon_edje_set(mi, s, "windows");
E_FREE(s); if (s) evas_stringshare_del(s);
e_menu_item_callback_set(mi, _e_int_menus_clients_cleanup_cb, zone); e_menu_item_callback_set(mi, _e_int_menus_clients_cleanup_cb, zone);
e_object_free_attach_func_set(E_OBJECT(m), _e_int_menus_clients_free_hook); e_object_free_attach_func_set(E_OBJECT(m), _e_int_menus_clients_free_hook);
@ -940,17 +940,16 @@ _e_int_menus_themes_edit_mode_cb(void *data, E_Menu *m, E_Menu_Item *mi)
if (!strcmp(et->category, "theme")) if (!strcmp(et->category, "theme"))
{ {
e_config->themes = evas_list_remove_list(e_config->themes, l); e_config->themes = evas_list_remove_list(e_config->themes, l);
E_FREE(et->category); evas_stringshare_del(et->category);
E_FREE(et->file); evas_stringshare_del(et->file);
E_FREE(et); E_FREE(et);
break; break;
} }
} }
et = E_NEW(E_Config_Theme, 1); et = E_NEW(E_Config_Theme, 1);
et->category = strdup("theme"); et->category = evas_stringshare_add("theme");
et->file = E_NEW(char, strlen(mi->label) + 1); et->file = evas_stringshare_add(mi->label);
strcpy(et->file, mi->label);
e_config->themes = evas_list_append(e_config->themes, et); e_config->themes = evas_list_append(e_config->themes, et);
e_config_save_queue(); e_config_save_queue();

View File

@ -25,49 +25,59 @@ static Eet_Data_Descriptor *_e_ipc_3int_4str_list_edd = NULL;
static Eet_Data_Descriptor *_e_ipc_3int_3str_edd = NULL; static Eet_Data_Descriptor *_e_ipc_3int_3str_edd = NULL;
static Eet_Data_Descriptor *_e_ipc_3int_3str_list_edd = NULL; static Eet_Data_Descriptor *_e_ipc_3int_3str_list_edd = NULL;
#define E_IPC_DD_NEW(str, typ) \
eet_data_descriptor_new(str, sizeof(typ), \
(void *(*) (void *))evas_list_next, \
(void *(*) (void *, void *))evas_list_append, \
(void *(*) (void *))evas_list_data, \
(void *(*) (void *))evas_list_free, \
(void (*) (void *, int (*) (void *, const char *, void *, void *), void *))evas_hash_foreach, \
(void *(*) (void *, const char *, void *))evas_hash_add, \
(void (*) (void *))evas_hash_free)
/* externally accessible functions */ /* externally accessible functions */
int int
e_ipc_codec_init(void) e_ipc_codec_init(void)
{ {
_e_ipc_int_edd = E_CONFIG_DD_NEW("int", E_Ipc_Int); _e_ipc_int_edd = E_IPC_DD_NEW("int", E_Ipc_Int);
E_CONFIG_VAL(_e_ipc_int_edd, E_Ipc_Int, val, INT); E_CONFIG_VAL(_e_ipc_int_edd, E_Ipc_Int, val, INT);
_e_ipc_double_edd = E_CONFIG_DD_NEW("double", E_Ipc_Double); _e_ipc_double_edd = E_IPC_DD_NEW("double", E_Ipc_Double);
E_CONFIG_VAL(_e_ipc_double_edd, E_Ipc_Double, val, DOUBLE); E_CONFIG_VAL(_e_ipc_double_edd, E_Ipc_Double, val, DOUBLE);
_e_ipc_2int_edd = E_CONFIG_DD_NEW("2int", E_Ipc_2Int); _e_ipc_2int_edd = E_IPC_DD_NEW("2int", E_Ipc_2Int);
E_CONFIG_VAL(_e_ipc_2int_edd, E_Ipc_2Int, val1, INT); E_CONFIG_VAL(_e_ipc_2int_edd, E_Ipc_2Int, val1, INT);
E_CONFIG_VAL(_e_ipc_2int_edd, E_Ipc_2Int, val2, INT); E_CONFIG_VAL(_e_ipc_2int_edd, E_Ipc_2Int, val2, INT);
_e_ipc_str_edd = E_CONFIG_DD_NEW("str", E_Ipc_Str); _e_ipc_str_edd = E_IPC_DD_NEW("str", E_Ipc_Str);
E_CONFIG_VAL(_e_ipc_str_edd, E_Ipc_Str, str, STR); E_CONFIG_VAL(_e_ipc_str_edd, E_Ipc_Str, str, STR);
_e_ipc_str_list_edd = E_CONFIG_DD_NEW("str_list", E_Ipc_List); _e_ipc_str_list_edd = E_IPC_DD_NEW("str_list", E_Ipc_List);
E_CONFIG_LIST(_e_ipc_str_list_edd, E_Ipc_List, list, _e_ipc_str_edd); E_CONFIG_LIST(_e_ipc_str_list_edd, E_Ipc_List, list, _e_ipc_str_edd);
_e_ipc_2str_edd = E_CONFIG_DD_NEW("2str", E_Ipc_2Str); _e_ipc_2str_edd = E_IPC_DD_NEW("2str", E_Ipc_2Str);
E_CONFIG_VAL(_e_ipc_2str_edd, E_Ipc_2Str, str1, STR); E_CONFIG_VAL(_e_ipc_2str_edd, E_Ipc_2Str, str1, STR);
E_CONFIG_VAL(_e_ipc_2str_edd, E_Ipc_2Str, str2, STR); E_CONFIG_VAL(_e_ipc_2str_edd, E_Ipc_2Str, str2, STR);
_e_ipc_2str_list_edd = E_CONFIG_DD_NEW("2str_list", E_Ipc_List); _e_ipc_2str_list_edd = E_IPC_DD_NEW("2str_list", E_Ipc_List);
E_CONFIG_LIST(_e_ipc_2str_list_edd, E_Ipc_List, list, _e_ipc_2str_edd); E_CONFIG_LIST(_e_ipc_2str_list_edd, E_Ipc_List, list, _e_ipc_2str_edd);
_e_ipc_str_int_edd = E_CONFIG_DD_NEW("str_int", E_Ipc_Str_Int); _e_ipc_str_int_edd = E_IPC_DD_NEW("str_int", E_Ipc_Str_Int);
E_CONFIG_VAL(_e_ipc_str_int_edd, E_Ipc_Str_Int, str, STR); E_CONFIG_VAL(_e_ipc_str_int_edd, E_Ipc_Str_Int, str, STR);
E_CONFIG_VAL(_e_ipc_str_int_edd, E_Ipc_Str_Int, val, INT); E_CONFIG_VAL(_e_ipc_str_int_edd, E_Ipc_Str_Int, val, INT);
_e_ipc_str_int_list_edd = E_CONFIG_DD_NEW("str_int_list", E_Ipc_List); _e_ipc_str_int_list_edd = E_IPC_DD_NEW("str_int_list", E_Ipc_List);
E_CONFIG_LIST(_e_ipc_str_int_list_edd, E_Ipc_List, list, _e_ipc_str_int_edd); E_CONFIG_LIST(_e_ipc_str_int_list_edd, E_Ipc_List, list, _e_ipc_str_int_edd);
_e_ipc_2str_int_edd = E_CONFIG_DD_NEW("2str_int", E_Ipc_2Str_Int); _e_ipc_2str_int_edd = E_IPC_DD_NEW("2str_int", E_Ipc_2Str_Int);
E_CONFIG_VAL(_e_ipc_2str_int_edd, E_Ipc_2Str_Int, str1, STR); E_CONFIG_VAL(_e_ipc_2str_int_edd, E_Ipc_2Str_Int, str1, STR);
E_CONFIG_VAL(_e_ipc_2str_int_edd, E_Ipc_2Str_Int, str2, STR); E_CONFIG_VAL(_e_ipc_2str_int_edd, E_Ipc_2Str_Int, str2, STR);
E_CONFIG_VAL(_e_ipc_2str_int_edd, E_Ipc_2Str_Int, val, INT); E_CONFIG_VAL(_e_ipc_2str_int_edd, E_Ipc_2Str_Int, val, INT);
_e_ipc_2str_int_list_edd = E_CONFIG_DD_NEW("2str_int_list", E_Ipc_List); _e_ipc_2str_int_list_edd = E_IPC_DD_NEW("2str_int_list", E_Ipc_List);
E_CONFIG_LIST(_e_ipc_2str_int_list_edd, E_Ipc_List, list, _e_ipc_2str_int_edd); E_CONFIG_LIST(_e_ipc_2str_int_list_edd, E_Ipc_List, list, _e_ipc_2str_int_edd);
_e_ipc_4int_2str_edd = E_CONFIG_DD_NEW("4int_2str", E_Ipc_4Int_2Str); _e_ipc_4int_2str_edd = E_IPC_DD_NEW("4int_2str", E_Ipc_4Int_2Str);
E_CONFIG_VAL(_e_ipc_4int_2str_edd, E_Ipc_4Int_2Str, val1, INT); E_CONFIG_VAL(_e_ipc_4int_2str_edd, E_Ipc_4Int_2Str, val1, INT);
E_CONFIG_VAL(_e_ipc_4int_2str_edd, E_Ipc_4Int_2Str, val2, INT); E_CONFIG_VAL(_e_ipc_4int_2str_edd, E_Ipc_4Int_2Str, val2, INT);
E_CONFIG_VAL(_e_ipc_4int_2str_edd, E_Ipc_4Int_2Str, val3, INT); E_CONFIG_VAL(_e_ipc_4int_2str_edd, E_Ipc_4Int_2Str, val3, INT);
@ -75,10 +85,10 @@ e_ipc_codec_init(void)
E_CONFIG_VAL(_e_ipc_4int_2str_edd, E_Ipc_4Int_2Str, str1, STR); E_CONFIG_VAL(_e_ipc_4int_2str_edd, E_Ipc_4Int_2Str, str1, STR);
E_CONFIG_VAL(_e_ipc_4int_2str_edd, E_Ipc_4Int_2Str, str2, STR); E_CONFIG_VAL(_e_ipc_4int_2str_edd, E_Ipc_4Int_2Str, str2, STR);
_e_ipc_4int_2str_list_edd = E_CONFIG_DD_NEW("4int_2str_list", E_Ipc_List); _e_ipc_4int_2str_list_edd = E_IPC_DD_NEW("4int_2str_list", E_Ipc_List);
E_CONFIG_LIST(_e_ipc_4int_2str_list_edd, E_Ipc_List, list, _e_ipc_4int_2str_edd); E_CONFIG_LIST(_e_ipc_4int_2str_list_edd, E_Ipc_List, list, _e_ipc_4int_2str_edd);
_e_ipc_5int_2str_edd = E_CONFIG_DD_NEW("5int_2str", E_Ipc_5Int_2Str); _e_ipc_5int_2str_edd = E_IPC_DD_NEW("5int_2str", E_Ipc_5Int_2Str);
E_CONFIG_VAL(_e_ipc_5int_2str_edd, E_Ipc_5Int_2Str, val1, INT); E_CONFIG_VAL(_e_ipc_5int_2str_edd, E_Ipc_5Int_2Str, val1, INT);
E_CONFIG_VAL(_e_ipc_5int_2str_edd, E_Ipc_5Int_2Str, val2, INT); E_CONFIG_VAL(_e_ipc_5int_2str_edd, E_Ipc_5Int_2Str, val2, INT);
E_CONFIG_VAL(_e_ipc_5int_2str_edd, E_Ipc_5Int_2Str, val3, INT); E_CONFIG_VAL(_e_ipc_5int_2str_edd, E_Ipc_5Int_2Str, val3, INT);
@ -87,10 +97,10 @@ e_ipc_codec_init(void)
E_CONFIG_VAL(_e_ipc_5int_2str_edd, E_Ipc_5Int_2Str, str1, STR); E_CONFIG_VAL(_e_ipc_5int_2str_edd, E_Ipc_5Int_2Str, str1, STR);
E_CONFIG_VAL(_e_ipc_5int_2str_edd, E_Ipc_5Int_2Str, str2, STR); E_CONFIG_VAL(_e_ipc_5int_2str_edd, E_Ipc_5Int_2Str, str2, STR);
_e_ipc_5int_2str_list_edd = E_CONFIG_DD_NEW("5int_2str_list", E_Ipc_List); _e_ipc_5int_2str_list_edd = E_IPC_DD_NEW("5int_2str_list", E_Ipc_List);
E_CONFIG_LIST(_e_ipc_5int_2str_list_edd, E_Ipc_List, list, _e_ipc_5int_2str_edd); E_CONFIG_LIST(_e_ipc_5int_2str_list_edd, E_Ipc_List, list, _e_ipc_5int_2str_edd);
_e_ipc_3int_4str_edd = E_CONFIG_DD_NEW("3int_4str", E_Ipc_3Int_4Str); _e_ipc_3int_4str_edd = E_IPC_DD_NEW("3int_4str", E_Ipc_3Int_4Str);
E_CONFIG_VAL(_e_ipc_3int_4str_edd, E_Ipc_3Int_4Str, val1, INT); E_CONFIG_VAL(_e_ipc_3int_4str_edd, E_Ipc_3Int_4Str, val1, INT);
E_CONFIG_VAL(_e_ipc_3int_4str_edd, E_Ipc_3Int_4Str, val2, INT); E_CONFIG_VAL(_e_ipc_3int_4str_edd, E_Ipc_3Int_4Str, val2, INT);
E_CONFIG_VAL(_e_ipc_3int_4str_edd, E_Ipc_3Int_4Str, val3, INT); E_CONFIG_VAL(_e_ipc_3int_4str_edd, E_Ipc_3Int_4Str, val3, INT);
@ -99,10 +109,10 @@ e_ipc_codec_init(void)
E_CONFIG_VAL(_e_ipc_3int_4str_edd, E_Ipc_3Int_4Str, str3, STR); E_CONFIG_VAL(_e_ipc_3int_4str_edd, E_Ipc_3Int_4Str, str3, STR);
E_CONFIG_VAL(_e_ipc_3int_4str_edd, E_Ipc_3Int_4Str, str4, STR); E_CONFIG_VAL(_e_ipc_3int_4str_edd, E_Ipc_3Int_4Str, str4, STR);
_e_ipc_3int_4str_list_edd = E_CONFIG_DD_NEW("3int_4str_list", E_Ipc_List); _e_ipc_3int_4str_list_edd = E_IPC_DD_NEW("3int_4str_list", E_Ipc_List);
E_CONFIG_LIST(_e_ipc_3int_4str_list_edd, E_Ipc_List, list, _e_ipc_3int_4str_edd); E_CONFIG_LIST(_e_ipc_3int_4str_list_edd, E_Ipc_List, list, _e_ipc_3int_4str_edd);
_e_ipc_3int_3str_edd = E_CONFIG_DD_NEW("3int_3str", E_Ipc_3Int_3Str); _e_ipc_3int_3str_edd = E_IPC_DD_NEW("3int_3str", E_Ipc_3Int_3Str);
E_CONFIG_VAL(_e_ipc_3int_3str_edd, E_Ipc_3Int_3Str, val1, INT); E_CONFIG_VAL(_e_ipc_3int_3str_edd, E_Ipc_3Int_3Str, val1, INT);
E_CONFIG_VAL(_e_ipc_3int_3str_edd, E_Ipc_3Int_3Str, val2, INT); E_CONFIG_VAL(_e_ipc_3int_3str_edd, E_Ipc_3Int_3Str, val2, INT);
E_CONFIG_VAL(_e_ipc_3int_3str_edd, E_Ipc_3Int_3Str, val3, INT); E_CONFIG_VAL(_e_ipc_3int_3str_edd, E_Ipc_3Int_3Str, val3, INT);
@ -110,7 +120,7 @@ e_ipc_codec_init(void)
E_CONFIG_VAL(_e_ipc_3int_3str_edd, E_Ipc_3Int_3Str, str2, STR); E_CONFIG_VAL(_e_ipc_3int_3str_edd, E_Ipc_3Int_3Str, str2, STR);
E_CONFIG_VAL(_e_ipc_3int_3str_edd, E_Ipc_3Int_3Str, str3, STR); E_CONFIG_VAL(_e_ipc_3int_3str_edd, E_Ipc_3Int_3Str, str3, STR);
_e_ipc_3int_3str_list_edd = E_CONFIG_DD_NEW("3int_3str_list", E_Ipc_List); _e_ipc_3int_3str_list_edd = E_IPC_DD_NEW("3int_3str_list", E_Ipc_List);
E_CONFIG_LIST(_e_ipc_3int_3str_list_edd, E_Ipc_List, list, _e_ipc_3int_3str_edd); E_CONFIG_LIST(_e_ipc_3int_3str_list_edd, E_Ipc_List, list, _e_ipc_3int_3str_edd);
return 1; return 1;
} }

View File

@ -994,8 +994,9 @@ break;
#elif (TYPE == E_WM_IN) #elif (TYPE == E_WM_IN)
STRING(s, HDL); STRING(s, HDL);
/* TODO: Check if file exists */ /* TODO: Check if file exists */
E_FREE(e_config->desktop_default_background); if (e_config->desktop_default_background) evas_stringshare_del(e_config->desktop_default_background);
if (s) e_config->desktop_default_background = strdup(s); e_config->desktop_default_background = NULL;
if (s) e_config->desktop_default_background = evas_stringshare_add(s);
e_bg_update(); e_bg_update();
SAVE; SAVE;
END_STRING(s); END_STRING(s);
@ -1379,8 +1380,9 @@ break;
#elif (TYPE == E_WM_IN) #elif (TYPE == E_WM_IN)
STRING(s, HDL); STRING(s, HDL);
/* TODO: Check if language exists */ /* TODO: Check if language exists */
E_FREE(e_config->language); if (e_config->language) evas_stringshare_del(e_config->language);
if (s) e_config->language = strdup(s); e_config->language = NULL;
if (s) e_config->language = evas_stringshare_add(s);
if ((e_config->language) && (e_config->language[0] != 0)) if ((e_config->language) && (e_config->language[0] != 0))
e_intl_language_set(e_config->language); e_intl_language_set(e_config->language);
else else
@ -2431,8 +2433,8 @@ break;
d->button = v->val3; d->button = v->val3;
d->mod = v->val2; d->mod = v->val2;
d->any_mod = v->val4; d->any_mod = v->val4;
d->action = ((v->str1) ? strdup(v->str1) : NULL); d->action = ((v->str1) ? evas_stringshare_add(v->str1) : NULL);
d->params = ((v->str2) ? strdup(v->str2) : NULL); d->params = ((v->str2) ? evas_stringshare_add(v->str2) : NULL);
r->bindings[count] = d; r->bindings[count] = d;
count++; count++;
@ -2538,8 +2540,8 @@ break;
eb->button = bind.button; eb->button = bind.button;
eb->modifiers = bind.modifiers; eb->modifiers = bind.modifiers;
eb->any_mod = bind.any_mod; eb->any_mod = bind.any_mod;
if (bind.action) eb->action = strdup(bind.action); if (bind.action) eb->action = evas_stringshare_add(bind.action);
if (bind.params) eb->params = strdup(bind.params); if (bind.params) eb->params = evas_stringshare_add(bind.params);
e_border_button_bindings_ungrab_all(); e_border_button_bindings_ungrab_all();
e_bindings_mouse_add(bind.context, bind.button, bind.modifiers, e_bindings_mouse_add(bind.context, bind.button, bind.modifiers,
bind.any_mod, bind.action, bind.params); bind.any_mod, bind.action, bind.params);
@ -2640,8 +2642,8 @@ break;
if (eb) if (eb)
{ {
e_config->mouse_bindings = evas_list_remove(e_config->mouse_bindings, eb); e_config->mouse_bindings = evas_list_remove(e_config->mouse_bindings, eb);
E_FREE(eb->action); if (eb->action) evas_stringshare_del(eb->action);
E_FREE(eb->params); if (eb->params) evas_stringshare_del(eb->params);
E_FREE(eb); E_FREE(eb);
e_border_button_bindings_ungrab_all(); e_border_button_bindings_ungrab_all();
e_bindings_mouse_del(bind.context, bind.button, bind.modifiers, e_bindings_mouse_del(bind.context, bind.button, bind.modifiers,
@ -2759,11 +2761,11 @@ break;
d = malloc(sizeof(E_Response_Binding_Key_Data)); d = malloc(sizeof(E_Response_Binding_Key_Data));
d->ctx = v->val1; d->ctx = v->val1;
d->key = ((v->str1) ? strdup(v->str1) : NULL); d->key = ((v->str1) ? evas_stringshare_add(v->str1) : NULL);
d->mod = v->val2; d->mod = v->val2;
d->any_mod = v->val3; d->any_mod = v->val3;
d->action = ((v->str2) ? strdup(v->str2) : NULL); d->action = ((v->str2) ? evas_stringshare_add(v->str2) : NULL);
d->params = ((v->str3) ? strdup(v->str3) : NULL); d->params = ((v->str3) ? evas_stringshare_add(v->str3) : NULL);
r->bindings[count] = d; r->bindings[count] = d;
count++; count++;
@ -2867,9 +2869,9 @@ break;
eb->context = bind.context; eb->context = bind.context;
eb->modifiers = bind.modifiers; eb->modifiers = bind.modifiers;
eb->any_mod = bind.any_mod; eb->any_mod = bind.any_mod;
if (bind.key) eb->key = strdup(bind.key); if (bind.key) eb->key = evas_stringshare_add(bind.key);
if (bind.action) eb->action = strdup(bind.action); if (bind.action) eb->action = evas_stringshare_add(bind.action);
if (bind.params) eb->params = strdup(bind.params); if (bind.params) eb->params = evas_stringshare_add(bind.params);
e_managers_keys_ungrab(); e_managers_keys_ungrab();
e_bindings_key_add(bind.context, bind.key, bind.modifiers, e_bindings_key_add(bind.context, bind.key, bind.modifiers,
bind.any_mod, bind.action, bind.params); bind.any_mod, bind.action, bind.params);
@ -2968,9 +2970,9 @@ break;
if (eb) if (eb)
{ {
e_config->key_bindings = evas_list_remove(e_config->key_bindings, eb); e_config->key_bindings = evas_list_remove(e_config->key_bindings, eb);
E_FREE(eb->key); if (eb->key) evas_stringshare_del(eb->key);
E_FREE(eb->action); if (eb->action) evas_stringshare_del(eb->action);
E_FREE(eb->params); if (eb->params) evas_stringshare_del(eb->params);
E_FREE(eb); E_FREE(eb);
e_managers_keys_ungrab(); e_managers_keys_ungrab();
e_bindings_key_del(bind.context, bind.key, bind.modifiers, e_bindings_key_del(bind.context, bind.key, bind.modifiers,
@ -4401,8 +4403,9 @@ break;
STRING(s, HDL); STRING(s, HDL);
if (e_theme_transition_find(s)) if (e_theme_transition_find(s))
{ {
E_FREE(e_config->transition_start); if (e_config->transition_start) evas_stringshare_del(e_config->transition_start);
if (s) e_config->transition_start = strdup(s); e_config->transition_start = NULL;
if (s) e_config->transition_start = evas_stringshare_add(s);
SAVE; SAVE;
} }
END_STRING(s); END_STRING(s);
@ -4445,8 +4448,9 @@ break;
STRING(s, HDL); STRING(s, HDL);
if (e_theme_transition_find(s)) if (e_theme_transition_find(s))
{ {
E_FREE(e_config->transition_desk); if (e_config->transition_desk) evas_stringshare_del(e_config->transition_desk);
if (s) e_config->transition_desk = strdup(s); e_config->transition_desk = NULL;
if (s) e_config->transition_desk = evas_stringshare_add(s);
SAVE; SAVE;
} }
END_STRING(s); END_STRING(s);
@ -4489,8 +4493,9 @@ break;
STRING(s, HDL); STRING(s, HDL);
if (e_theme_transition_find(s)) if (e_theme_transition_find(s))
{ {
E_FREE(e_config->transition_change); if (e_config->transition_change) evas_stringshare_del(e_config->transition_change);
if (s) e_config->transition_change = strdup(s); e_config->transition_change = NULL;
if (s) e_config->transition_change = evas_stringshare_add(s);
SAVE; SAVE;
} }
END_STRING(s); END_STRING(s);
@ -5644,8 +5649,9 @@ break;
REQ_STRING(params[0], HDL); REQ_STRING(params[0], HDL);
#elif (TYPE == E_WM_IN) #elif (TYPE == E_WM_IN)
STRING(s, HDL); STRING(s, HDL);
E_FREE(e_config->input_method); if (e_config->input_method) evas_stringshare_del(e_config->input_method);
if (s) e_config->input_method = strdup(s); e_config->input_method = NULL;
if (s) e_config->input_method = evas_stringshare_add(s);
if ((e_config->input_method) && (e_config->input_method[0] != 0)) if ((e_config->input_method) && (e_config->input_method[0] != 0))
e_intl_input_method_set(e_config->input_method); e_intl_input_method_set(e_config->input_method);
else else
@ -5861,8 +5867,8 @@ break;
d->source = v->str2; d->source = v->str2;
d->mod = v->val2; d->mod = v->val2;
d->any_mod = v->val3; d->any_mod = v->val3;
d->action = ((v->str3) ? strdup(v->str3) : NULL); d->action = ((v->str3) ? evas_stringshare_add(v->str3) : NULL);
d->params = ((v->str4) ? strdup(v->str4) : NULL); d->params = ((v->str4) ? evas_stringshare_add(v->str4) : NULL);
r->bindings[count] = d; r->bindings[count] = d;
count++; count++;
@ -5967,12 +5973,12 @@ break;
eb = E_NEW(E_Config_Binding_Signal, 1); eb = E_NEW(E_Config_Binding_Signal, 1);
e_config->signal_bindings = evas_list_append(e_config->signal_bindings, eb); e_config->signal_bindings = evas_list_append(e_config->signal_bindings, eb);
eb->context = bind.context; eb->context = bind.context;
if (bind.signal) eb->signal = strdup(bind.signal); if (bind.signal) eb->signal = evas_stringshare_add(bind.signal);
if (bind.source) eb->source = strdup(bind.source); if (bind.source) eb->source = evas_stringshare_add(bind.source);
eb->modifiers = bind.modifiers; eb->modifiers = bind.modifiers;
eb->any_mod = bind.any_mod; eb->any_mod = bind.any_mod;
if (bind.action) eb->action = strdup(bind.action); if (bind.action) eb->action = evas_stringshare_add(bind.action);
if (bind.params) eb->params = strdup(bind.params); if (bind.params) eb->params = evas_stringshare_add(bind.params);
e_bindings_signal_add(bind.context, bind.signal, bind.source, bind.modifiers, e_bindings_signal_add(bind.context, bind.signal, bind.source, bind.modifiers,
bind.any_mod, bind.action, bind.params); bind.any_mod, bind.action, bind.params);
e_config_save_queue(); e_config_save_queue();
@ -6073,10 +6079,10 @@ break;
if (eb) if (eb)
{ {
e_config->signal_bindings = evas_list_remove(e_config->signal_bindings, eb); e_config->signal_bindings = evas_list_remove(e_config->signal_bindings, eb);
E_FREE(eb->signal); if (eb->signal) evas_stringshare_del(eb->signal);
E_FREE(eb->source); if (eb->source) evas_stringshare_del(eb->source);
E_FREE(eb->action); if (eb->action) evas_stringshare_del(eb->action);
E_FREE(eb->params); if (eb->params) evas_stringshare_del(eb->params);
E_FREE(eb); E_FREE(eb);
e_bindings_signal_del(bind.context, bind.signal, bind.source, bind.modifiers, e_bindings_signal_del(bind.context, bind.signal, bind.source, bind.modifiers,
bind.any_mod, bind.action, bind.params); bind.any_mod, bind.action, bind.params);
@ -6195,8 +6201,8 @@ break;
d->z = v->val3; d->z = v->val3;
d->mod = v->val4; d->mod = v->val4;
d->any_mod = v->val5; d->any_mod = v->val5;
d->action = ((v->str1) ? strdup(v->str1) : NULL); d->action = ((v->str1) ? evas_stringshare_add(v->str1) : NULL);
d->params = ((v->str2) ? strdup(v->str2) : NULL); d->params = ((v->str2) ? evas_stringshare_add(v->str2) : NULL);
r->bindings[count] = d; r->bindings[count] = d;
count++; count++;
@ -6305,8 +6311,8 @@ break;
eb->z = bind.z; eb->z = bind.z;
eb->modifiers = bind.modifiers; eb->modifiers = bind.modifiers;
eb->any_mod = bind.any_mod; eb->any_mod = bind.any_mod;
if (bind.action) eb->action = strdup(bind.action); if (bind.action) eb->action = evas_stringshare_add(bind.action);
if (bind.params) eb->params = strdup(bind.params); if (bind.params) eb->params = evas_stringshare_add(bind.params);
e_bindings_wheel_add(bind.context, bind.direction, bind.z, bind.modifiers, e_bindings_wheel_add(bind.context, bind.direction, bind.z, bind.modifiers,
bind.any_mod, bind.action, bind.params); bind.any_mod, bind.action, bind.params);
e_config_save_queue(); e_config_save_queue();
@ -6407,8 +6413,8 @@ break;
if (eb) if (eb)
{ {
e_config->wheel_bindings = evas_list_remove(e_config->wheel_bindings, eb); e_config->wheel_bindings = evas_list_remove(e_config->wheel_bindings, eb);
E_FREE(eb->action); if (eb->action) evas_stringshare_del(eb->action);
E_FREE(eb->params); if (eb->params) evas_stringshare_del(eb->params);
E_FREE(eb); E_FREE(eb);
e_bindings_wheel_del(bind.context, bind.direction, bind.z, bind.modifiers, e_bindings_wheel_del(bind.context, bind.direction, bind.z, bind.modifiers,
bind.any_mod, bind.action, bind.params); bind.any_mod, bind.action, bind.params);

View File

@ -56,7 +56,7 @@ e_module_init(void)
} }
else else
{ {
E_FREE(em->name); if (em->name) evas_stringshare_del(em->name);
E_FREE(em); E_FREE(em);
e_config->modules = evas_list_remove_list(e_config->modules, pl); e_config->modules = evas_list_remove_list(e_config->modules, pl);
e_config_save_queue(); e_config_save_queue();
@ -105,7 +105,7 @@ e_module_new(char *name)
modpath = e_path_find(path_modules, buf); modpath = e_path_find(path_modules, buf);
} }
else else
modpath = strdup(name); modpath = evas_stringshare_add(name);
if (!modpath) if (!modpath)
{ {
snprintf(body, sizeof(body), _("There was an error loading module named: %s<br>" snprintf(body, sizeof(body), _("There was an error loading module named: %s<br>"
@ -187,11 +187,21 @@ init_done:
_e_modules = evas_list_append(_e_modules, m); _e_modules = evas_list_append(_e_modules, m);
m->name = evas_stringshare_add(name); m->name = evas_stringshare_add(name);
s = modpath ? ecore_file_get_dir(modpath) : NULL; if (modpath)
if (s)
{ {
m->dir = ecore_file_get_dir(s); s = ecore_file_get_dir(modpath);
free(s); if (s)
{
char *s2;
s2 = ecore_file_get_dir(s);
free(s);
if (s2)
{
m->dir = evas_stringshare_add(s2);
free(s2);
}
}
} }
if (m->func.info) if (m->func.info)
m->func.info(m); m->func.info(m);
@ -211,12 +221,12 @@ init_done:
E_Config_Module *em; E_Config_Module *em;
em = E_NEW(E_Config_Module, 1); em = E_NEW(E_Config_Module, 1);
em->name = strdup(m->name); em->name = evas_stringshare_add(m->name);
em->enabled = 0; em->enabled = 0;
e_config->modules = evas_list_append(e_config->modules, em); e_config->modules = evas_list_append(e_config->modules, em);
e_config_save_queue(); e_config_save_queue();
} }
free(modpath); if (modpath) evas_stringshare_del(modpath);
return m; return m;
} }
@ -422,7 +432,7 @@ _e_module_free(E_Module *m)
if (!strcmp(em->name, m->name)) if (!strcmp(em->name, m->name))
{ {
e_config->modules = evas_list_remove(e_config->modules, em); e_config->modules = evas_list_remove(e_config->modules, em);
E_FREE(em->name); if (em->name) evas_stringshare_del(em->name);
E_FREE(em); E_FREE(em);
/* FIXME /* FIXME
* This is crap, a job is added, but doesn't run because * This is crap, a job is added, but doesn't run because
@ -439,7 +449,7 @@ _e_module_free(E_Module *m)
m->func.shutdown(m); m->func.shutdown(m);
} }
if (m->name) evas_stringshare_del(m->name); if (m->name) evas_stringshare_del(m->name);
if (m->dir) free(m->dir); if (m->dir) evas_stringshare_del(m->dir);
if (m->handle) dlclose(m->handle); if (m->handle) dlclose(m->handle);
_e_modules = evas_list_remove(_e_modules, m); _e_modules = evas_list_remove(_e_modules, m);
if (m->icon_file) free(m->icon_file); if (m->icon_file) free(m->icon_file);

View File

@ -261,7 +261,7 @@ e_path_find(E_Path *ep, const char *file)
if (!file) return NULL; if (!file) return NULL;
str = evas_hash_find(ep->hash, file); str = evas_hash_find(ep->hash, file);
if (str) return strdup(str); if (str) return evas_stringshare_add(str);
/* Look in the default dir list */ /* Look in the default dir list */
for (l = ep->default_dir_list; l; l = l->next) for (l = ep->default_dir_list; l; l = l->next)
{ {
@ -282,7 +282,7 @@ e_path_find(E_Path *ep, const char *file)
_e_path_cache_free(ep); _e_path_cache_free(ep);
ep->hash = evas_hash_add(ep->hash, file, ep->hash = evas_hash_add(ep->hash, file,
evas_stringshare_add(buf)); evas_stringshare_add(buf));
return strdup(buf); return evas_stringshare_add(buf);
} }
if (rp) free(rp); if (rp) free(rp);
} }
@ -307,7 +307,7 @@ e_path_find(E_Path *ep, const char *file)
_e_path_cache_free(ep); _e_path_cache_free(ep);
ep->hash = evas_hash_add(ep->hash, file, ep->hash = evas_hash_add(ep->hash, file,
evas_stringshare_add(buf)); evas_stringshare_add(buf));
return strdup(buf); return evas_stringshare_add(buf);
} }
if (rp) free(rp); if (rp) free(rp);
} }

View File

@ -193,15 +193,15 @@ e_pointer_type_push(E_Pointer *p, void *obj, const char *type)
} }
} }
if (p->type) free(p->type); if (p->type) evas_stringshare_del(p->type);
p->type = strdup(type); p->type = evas_stringshare_add(type);
p->obj = obj; p->obj = obj;
stack = E_NEW(E_Pointer_Stack, 1); stack = E_NEW(E_Pointer_Stack, 1);
if (stack) if (stack)
{ {
stack->obj = p->obj; stack->obj = p->obj;
stack->type = strdup(p->type); stack->type = evas_stringshare_add(p->type);
stack->e_cursor = p->e_cursor; stack->e_cursor = p->e_cursor;
p->stack = evas_list_prepend(p->stack, stack); p->stack = evas_list_prepend(p->stack, stack);
} }
@ -257,8 +257,8 @@ e_pointer_type_pop(E_Pointer *p, void *obj, const char *type)
} }
} }
if (p->type) free(p->type); if (p->type) evas_stringshare_del(p->type);
p->type = strdup(stack->type); p->type = evas_stringshare_add(stack->type);
p->obj = stack->obj; p->obj = stack->obj;
/* try the default cursor next time */ /* try the default cursor next time */
@ -326,13 +326,13 @@ _e_pointer_free(E_Pointer *p)
E_Pointer_Stack *stack; E_Pointer_Stack *stack;
stack = p->stack->data; stack = p->stack->data;
free(stack->type); if (stack->type) evas_stringshare_del(stack->type);
free(stack); free(stack);
p->stack = evas_list_remove_list(p->stack, p->stack); p->stack = evas_list_remove_list(p->stack, p->stack);
} }
if (p->type) free(p->type); if (p->type) evas_stringshare_del(p->type);
free(p); free(p);
} }

View File

@ -151,23 +151,23 @@ e_remember_find(E_Border *bd)
void void
e_remember_update(E_Remember *rem, E_Border *bd) e_remember_update(E_Remember *rem, E_Border *bd)
{ {
E_FREE(rem->name); if (rem->name) evas_stringshare_del(rem->name);
E_FREE(rem->class); if (rem->class) evas_stringshare_del(rem->class);
E_FREE(rem->title); if (rem->title) evas_stringshare_del(rem->title);
E_FREE(rem->role); if (rem->role) evas_stringshare_del(rem->role);
E_FREE(rem->prop.border); if (rem->prop.border) evas_stringshare_del(rem->prop.border);
E_FREE(rem->prop.command); if (rem->prop.command) evas_stringshare_del(rem->prop.command);
if (bd->client.icccm.name) if (bd->client.icccm.name)
rem->name = strdup(bd->client.icccm.name); rem->name = evas_stringshare_add(bd->client.icccm.name);
if (bd->client.icccm.class) if (bd->client.icccm.class)
rem->class = strdup(bd->client.icccm.class); rem->class = evas_stringshare_add(bd->client.icccm.class);
if (bd->client.netwm.name) if (bd->client.netwm.name)
rem->title = strdup(bd->client.netwm.name); rem->title = evas_stringshare_add(bd->client.netwm.name);
else if (bd->client.icccm.title) else if (bd->client.icccm.title)
rem->title = strdup(bd->client.icccm.title); rem->title = evas_stringshare_add(bd->client.icccm.title);
if (bd->client.icccm.window_role) if (bd->client.icccm.window_role)
rem->role = strdup(bd->client.icccm.window_role); rem->role = evas_stringshare_add(bd->client.icccm.window_role);
rem->type = bd->client.netwm.type; rem->type = bd->client.netwm.type;
@ -212,9 +212,9 @@ e_remember_update(E_Remember *rem, E_Border *bd)
rem->prop.lock_focus_out = bd->lock_focus_out; rem->prop.lock_focus_out = bd->lock_focus_out;
rem->prop.lock_life = bd->lock_life; rem->prop.lock_life = bd->lock_life;
E_FREE(rem->prop.border); if (rem->prop.border) evas_stringshare_del(rem->prop.border);
if (bd->client.border.name) if (bd->client.border.name)
rem->prop.border = strdup(bd->client.border.name); rem->prop.border = evas_stringshare_add(bd->client.border.name);
rem->prop.sticky = bd->sticky; rem->prop.sticky = bd->sticky;
@ -231,7 +231,7 @@ e_remember_update(E_Remember *rem, E_Border *bd)
rem->prop.head = bd->zone->container->manager->num; rem->prop.head = bd->zone->container->manager->num;
/* FIXME: e17 doesn't fetch WM_COMMAND property yet /* FIXME: e17 doesn't fetch WM_COMMAND property yet
E_FREE(rem->prop.command); if (rem->prop.command) evas_stringshare_del(rem->prop.command);
*/ */
e_config_save_queue(); e_config_save_queue();
@ -242,11 +242,11 @@ static void
_e_remember_free(E_Remember *rem) _e_remember_free(E_Remember *rem)
{ {
e_config->remembers = evas_list_remove(e_config->remembers, rem); e_config->remembers = evas_list_remove(e_config->remembers, rem);
E_FREE(rem->name); if (rem->name) evas_stringshare_del(rem->name);
E_FREE(rem->class); if (rem->class) evas_stringshare_del(rem->class);
E_FREE(rem->title); if (rem->title) evas_stringshare_del(rem->title);
E_FREE(rem->role); if (rem->role) evas_stringshare_del(rem->role);
E_FREE(rem->prop.border); if (rem->prop.border) evas_stringshare_del(rem->prop.border);
E_FREE(rem->prop.command); if (rem->prop.command) evas_stringshare_del(rem->prop.command);
free(rem); free(rem);
} }

View File

@ -158,9 +158,9 @@ e_slider_value_format_display_set(Evas_Object *obj, const char *format)
API_ENTRY return; API_ENTRY return;
if (((sd->format) && (!format)) || ((!sd->format) && (format))) changed = 1; if (((sd->format) && (!format)) || ((!sd->format) && (format))) changed = 1;
E_FREE(sd->format); if (sd->format) evas_stringshare_del(sd->format);
sd->format = NULL; sd->format = NULL;
if (format) sd->format = strdup(format); if (format) sd->format = evas_stringshare_add(format);
if (changed) if (changed)
{ {
if (sd->format) if (sd->format)
@ -454,7 +454,7 @@ _e_smart_del(Evas_Object *obj)
{ {
INTERNAL_ENTRY; INTERNAL_ENTRY;
evas_object_del(sd->edje_obj); evas_object_del(sd->edje_obj);
E_FREE(sd->format); if (sd->format) evas_stringshare_del(sd->format);
if (sd->set_timer) ecore_timer_del(sd->set_timer); if (sd->set_timer) ecore_timer_del(sd->set_timer);
free(sd); free(sd);
} }

View File

@ -107,17 +107,17 @@ e_theme_shutdown(void)
} }
while (categories) while (categories)
{ {
free(categories->data); evas_stringshare_del(categories->data);
categories = evas_list_remove_list(categories, categories); categories = evas_list_remove_list(categories, categories);
} }
while (transitions) while (transitions)
{ {
free(transitions->data); evas_stringshare_del(transitions->data);
transitions = evas_list_remove_list(transitions, transitions); transitions = evas_list_remove_list(transitions, transitions);
} }
while (borders) while (borders)
{ {
free(borders->data); evas_stringshare_del(borders->data);
borders = evas_list_remove_list(borders, borders); borders = evas_list_remove_list(borders, borders);
} }
return 1; return 1;
@ -277,12 +277,12 @@ e_theme_file_set(char *category, char *file)
if (res) if (res)
{ {
mappings = evas_hash_del(mappings, category, res); mappings = evas_hash_del(mappings, category, res);
E_FREE(res->file); if (res->file) evas_stringshare_del(res->file);
E_FREE(res->cache); if (res->cache) evas_stringshare_del(res->cache);
free(res); free(res);
} }
res = calloc(1, sizeof(E_Theme_Result)); res = calloc(1, sizeof(E_Theme_Result));
res->file = strdup(file); res->file = evas_stringshare_add(file);
mappings = evas_hash_add(mappings, category, res); mappings = evas_hash_add(mappings, category, res);
} }
@ -303,16 +303,16 @@ e_theme_config_set(const char *category, const char *file)
ect = evas_list_data(next); ect = evas_list_data(next);
if (!strcmp(ect->category, category)) if (!strcmp(ect->category, category))
{ {
E_FREE(ect->file); if (ect->file) evas_stringshare_del(ect->file);
ect->file = strdup(file); ect->file = evas_stringshare_add(file);
return 1; return 1;
} }
} }
/* the text class doesnt exist */ /* the text class doesnt exist */
ect = E_NEW(E_Config_Theme, 1); ect = E_NEW(E_Config_Theme, 1);
ect->category = strdup(category); ect->category = evas_stringshare_add(category);
ect->file = strdup(file); ect->file = evas_stringshare_add(file);
e_config->themes = evas_list_append(e_config->themes, ect); e_config->themes = evas_list_append(e_config->themes, ect);
return 1; return 1;
@ -353,9 +353,9 @@ e_theme_config_remove(const char *category)
{ {
e_config->themes = evas_list_remove_list( e_config->themes = evas_list_remove_list(
e_config->themes, next); e_config->themes, next);
E_FREE(ect->category); if (ect->category) evas_stringshare_del(ect->category);
E_FREE(ect->file); if (ect->file) evas_stringshare_del(ect->file);
E_FREE(ect); free(ect);
return 1; return 1;
} }
} }
@ -433,8 +433,8 @@ _e_theme_mappings_free_cb(Evas_Hash *hash, const char *key, void *data, void *fd
E_Theme_Result *res; E_Theme_Result *res;
res = data; res = data;
E_FREE(res->file); if (res->file) evas_stringshare_del(res->file);
E_FREE(res->cache); if (res->cache) evas_stringshare_del(res->cache);
free(res); free(res);
return 1; return 1;
} }
@ -450,7 +450,7 @@ _e_theme_category_register(const char *category)
return; return;
} }
categories = evas_list_append(categories, strdup(category)); categories = evas_list_append(categories, evas_stringshare_add(category));
} }
static Evas_List * static Evas_List *
@ -462,7 +462,7 @@ _e_theme_collection_item_register(Evas_List *list, const char *name)
{ {
if (!strcmp(name, l->data)) return list; if (!strcmp(name, l->data)) return list;
} }
list = evas_list_append(list, strdup(name)); list = evas_list_append(list, evas_stringshare_add(name));
return list; return list;
} }
@ -475,60 +475,57 @@ _e_theme_collection_items_find(const char *base, const char *collname)
int collname_len; int collname_len;
collname_len = strlen(collname); collname_len = strlen(collname);
category = strdup(base); category = alloca(strlen(base) + 1);
if (category) strcpy(category, base);
do
{ {
do res = evas_hash_find(mappings, category);
if (res)
{ {
res = evas_hash_find(mappings, category); char *str;
if (res)
/* if found check cached path */
str = res->cache;
if (!str)
{ {
char *str; /* no cached path */
str = res->file;
/* if found check cached path */ /* if its not an absolute path find it */
str = res->cache; if (str[0] != '/') str = e_path_find(path_themes, str);
if (!str) /* save cached value */
if (str) res->cache = str;
}
if (str)
{
Evas_List *coll, *l;
coll = edje_file_collection_list(str);
if (coll)
{ {
/* no cached path */ for (l = coll; l; l = l->next)
str = res->file;
/* if its not an absolute path find it */
if (str[0] != '/') str = e_path_find(path_themes, str);
/* save cached value */
if (str) res->cache = str;
}
if (str)
{
Evas_List *coll, *l;
coll = edje_file_collection_list(str);
if (coll)
{ {
for (l = coll; l; l = l->next) if (!strncmp(l->data, collname, collname_len))
{ {
if (!strncmp(l->data, collname, collname_len)) char *trans;
trans = strdup(l->data);
p = trans + collname_len + 1;
if (*p)
{ {
char *trans; p2 = strchr(p, '/');
if (p2) *p2 = 0;
trans = strdup(l->data); list = _e_theme_collection_item_register(list, p);
p = trans + collname_len + 1;
if (*p)
{
p2 = strchr(p, '/');
if (p2) *p2 = 0;
list = _e_theme_collection_item_register(list, p);
}
free(trans);
} }
free(trans);
} }
edje_file_collection_list_free(coll);
} }
edje_file_collection_list_free(coll);
} }
} }
p = strrchr(category, '/');
if (p) *p = 0;
} }
while (p); p = strrchr(category, '/');
free(category); if (p) *p = 0;
} }
while (p);
return list; return list;
} }

View File

@ -82,7 +82,7 @@ e_zone_new(E_Container *con, int num, int x, int y, int w, int h)
snprintf(name, sizeof(name), "Zone %d", zone->num); snprintf(name, sizeof(name), "Zone %d", zone->num);
zone->name = strdup(name); zone->name = evas_stringshare_add(name);
con->zones = evas_list_append(con->zones, zone); con->zones = evas_list_append(con->zones, zone);
@ -141,9 +141,8 @@ e_zone_name_set(E_Zone *zone, const char *name)
{ {
E_OBJECT_CHECK(zone); E_OBJECT_CHECK(zone);
E_OBJECT_TYPE_CHECK(zone, E_ZONE_TYPE); E_OBJECT_TYPE_CHECK(zone, E_ZONE_TYPE);
if (zone->name) if (zone->name) evas_stringshare_del(zone->name);
free(zone->name); zone->name = evas_stringshare_add(name);
zone->name = strdup(name);
} }
void void
@ -678,7 +677,7 @@ _e_zone_free(E_Zone *zone)
zone->handlers = NULL; zone->handlers = NULL;
con = zone->container; con = zone->container;
if (zone->name) free(zone->name); if (zone->name) evas_stringshare_del(zone->name);
con->zones = evas_list_remove(con->zones, zone); con->zones = evas_list_remove(con->zones, zone);
evas_object_del(zone->bg_event_object); evas_object_del(zone->bg_event_object);
evas_object_del(zone->bg_clip_object); evas_object_del(zone->bg_clip_object);

View File

@ -276,8 +276,9 @@ _cpufreq_free(Cpufreq *e)
_cpufreq_status_free(e->status); _cpufreq_status_free(e->status);
free(e->set_exe_path);
evas_list_free(e->conf->faces); evas_list_free(e->conf->faces);
free(e->set_exe_path);
if (e->conf->governor) evas_stringshare_del(e->conf->governor);
free(e->conf); free(e->conf);
free(e); free(e);
} }
@ -405,9 +406,8 @@ _cpufreq_menu_restore_governor(void *data, E_Menu *m, E_Menu_Item *mi)
e->conf->restore_governor = e_menu_item_toggle_get(mi); e->conf->restore_governor = e_menu_item_toggle_get(mi);
if ((!e->conf->governor) || strcmp(e->status->cur_governor, e->conf->governor)) if ((!e->conf->governor) || strcmp(e->status->cur_governor, e->conf->governor))
{ {
if (e->conf->governor) if (e->conf->governor) evas_stringshare_del(e->conf->governor);
free(e->conf->governor); e->conf->governor = evas_stringshare_add(e->status->cur_governor);
e->conf->governor = strdup(e->status->cur_governor);
} }
e_config_save_queue(); e_config_save_queue();
} }
@ -423,9 +423,8 @@ _cpufreq_menu_governor(void *data, E_Menu *m, E_Menu_Item *mi)
if (governor) if (governor)
{ {
_cpufreq_set_governor(e, governor); _cpufreq_set_governor(e, governor);
if (e->conf->governor) if (e->conf->governor) evas_stringshare_del(e->conf->governor);
free(e->conf->governor); e->conf->governor = evas_stringshare_add(governor);
e->conf->governor = strdup(governor);
} }
e_config_save_queue(); e_config_save_queue();
} }

View File

@ -206,7 +206,7 @@ _ibar_new()
if (!ib->conf) if (!ib->conf)
{ {
ib->conf = E_NEW(Config, 1); ib->conf = E_NEW(Config, 1);
ib->conf->appdir = strdup("bar"); ib->conf->appdir = evas_stringshare_add("bar");
ib->conf->follower = 1; ib->conf->follower = 1;
ib->conf->follow_speed = 0.9; ib->conf->follow_speed = 0.9;
ib->conf->autoscroll_speed = 0.95; ib->conf->autoscroll_speed = 0.95;
@ -304,7 +304,7 @@ _ibar_free(IBar *ib)
if (ib->apps) if (ib->apps)
e_object_unref(E_OBJECT(ib->apps)); e_object_unref(E_OBJECT(ib->apps));
E_FREE(ib->conf->appdir); if (ib->conf->appdir) evas_stringshare_del(ib->conf->appdir);
e_app_change_callback_del(_ibar_app_change, ib); e_app_change_callback_del(_ibar_app_change, ib);
e_object_del(E_OBJECT(ib->config_menu_options)); e_object_del(E_OBJECT(ib->config_menu_options));
e_object_del(E_OBJECT(ib->config_menu_size)); e_object_del(E_OBJECT(ib->config_menu_size));