forked from enlightenment/efl
Use eina_stringshare_replace to avoid crashes.
By: Rafael Fonseca <rfonseca@profusion.mobi> SVN revision: 47187
This commit is contained in:
parent
95db33e2c9
commit
e01d72fe26
|
@ -239,9 +239,7 @@ elm_anchorblock_hover_style_set(Evas_Object *obj, const char *style)
|
|||
ELM_CHECK_WIDTYPE(obj, widtype);
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
if (!wd) return;
|
||||
if (wd->hover_style) eina_stringshare_del(wd->hover_style);
|
||||
wd->hover_style = NULL;
|
||||
if (style) wd->hover_style = eina_stringshare_add(style);
|
||||
eina_stringshare_replace(&wd->hover_style, style);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -233,9 +233,7 @@ elm_anchorview_hover_style_set(Evas_Object *obj, const char *style)
|
|||
ELM_CHECK_WIDTYPE(obj, widtype);
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
if (!wd) return;
|
||||
if (wd->hover_style) eina_stringshare_del(wd->hover_style);
|
||||
wd->hover_style = NULL;
|
||||
if (style) wd->hover_style = eina_stringshare_add(style);
|
||||
eina_stringshare_replace(&wd->hover_style, style);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -266,8 +266,7 @@ _populate(Evas_Object *obj, const char *path, Elm_Genlist_Item *parent)
|
|||
if (!parent)
|
||||
{
|
||||
elm_genlist_clear(wd->list);
|
||||
if (wd->path) eina_stringshare_del(wd->path);
|
||||
wd->path = eina_stringshare_add(path);
|
||||
eina_stringshare_replace(&wd->path, path);
|
||||
_do_anchors(obj, path);
|
||||
}
|
||||
|
||||
|
@ -568,8 +567,7 @@ elm_fileselector_selected_get(Evas_Object *obj)
|
|||
name = elm_entry_entry_get(wd->entry2);
|
||||
//TODO remove <br>
|
||||
snprintf(buf, sizeof(buf), "%s/%s", wd->path, name);
|
||||
if (wd->selection) eina_stringshare_del(wd->selection);
|
||||
wd->selection = eina_stringshare_add(buf);
|
||||
eina_stringshare_replace(&wd->selection, buf);
|
||||
return wd->selection;
|
||||
}
|
||||
|
||||
|
|
|
@ -583,10 +583,8 @@ EAPI void
|
|||
elm_hoversel_item_icon_set(Elm_Hoversel_Item *it, const char *icon_file, const char *icon_group, Elm_Icon_Type icon_type)
|
||||
{
|
||||
if (!it) return;
|
||||
if (it->icon_file) eina_stringshare_del(it->icon_file);
|
||||
it->icon_file = eina_stringshare_add(icon_file);
|
||||
if (it->icon_group) eina_stringshare_del(it->icon_group);
|
||||
it->icon_group = eina_stringshare_add(icon_group);
|
||||
eina_stringshare_replace(&it->icon_file, icon_file);
|
||||
eina_stringshare_replace(&it->icon_group, icon_group);
|
||||
it->icon_type = icon_type;
|
||||
}
|
||||
|
||||
|
|
|
@ -328,9 +328,7 @@ elm_notepad_file_set(Evas_Object *obj, const char *file, Elm_Text_Format format)
|
|||
wd->delay_write = NULL;
|
||||
}
|
||||
_save(obj);
|
||||
if (wd->file) eina_stringshare_del(wd->file);
|
||||
wd->file = NULL;
|
||||
if (file) wd->file = eina_stringshare_add(file);
|
||||
eina_stringshare_replace(&wd->file, file);
|
||||
wd->format = format;
|
||||
_load(obj);
|
||||
}
|
||||
|
|
|
@ -117,12 +117,8 @@ elm_bg_file_set(Evas_Object *obj, const char *file, const char *group)
|
|||
wd->custom_img = NULL;
|
||||
}
|
||||
if (!file) return;
|
||||
if (wd->file) eina_stringshare_del(wd->file);
|
||||
if (file) wd->file = eina_stringshare_add(file);
|
||||
else wd->file = NULL;
|
||||
if (wd->group) eina_stringshare_del(wd->group);
|
||||
if (group) wd->group = eina_stringshare_add(group);
|
||||
else wd->group = NULL;
|
||||
eina_stringshare_replace(&wd->file, file);
|
||||
eina_stringshare_replace(&wd->group, group);
|
||||
if (((p = strrchr(file, '.'))) && (!strcasecmp(p, ".edj")))
|
||||
{
|
||||
wd->custom_img = edje_object_add(evas_object_evas_get(wd->img));
|
||||
|
|
|
@ -132,9 +132,7 @@ elm_bubble_label_set(Evas_Object *obj, const char *label)
|
|||
ELM_CHECK_WIDTYPE(obj, widtype);
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
if (!wd) return;
|
||||
if (wd->label) eina_stringshare_del(wd->label);
|
||||
if (label) wd->label = eina_stringshare_add(label);
|
||||
else wd->label = NULL;
|
||||
eina_stringshare_replace(&wd->label, label);
|
||||
edje_object_part_text_set(wd->bbl, "elm.text", label);
|
||||
_sizing_eval(obj);
|
||||
}
|
||||
|
@ -167,9 +165,7 @@ elm_bubble_info_set(Evas_Object *obj, const char *info)
|
|||
ELM_CHECK_WIDTYPE(obj, widtype);
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
if (!wd) return;
|
||||
if (wd->info) eina_stringshare_del(wd->info);
|
||||
if (info) wd->info = eina_stringshare_add(info);
|
||||
else wd->info = NULL;
|
||||
eina_stringshare_replace(&wd->info, info);
|
||||
edje_object_part_text_set(wd->bbl, "elm.info", info);
|
||||
_sizing_eval(obj);
|
||||
}
|
||||
|
|
|
@ -251,17 +251,11 @@ elm_button_label_set(Evas_Object *obj, const char *label)
|
|||
ELM_CHECK_WIDTYPE(obj, widtype);
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
if (!wd) return;
|
||||
if (wd->label) eina_stringshare_del(wd->label);
|
||||
eina_stringshare_replace(&wd->label, label);
|
||||
if (label)
|
||||
{
|
||||
wd->label = eina_stringshare_add(label);
|
||||
edje_object_signal_emit(wd->btn, "elm,state,text,visible", "elm");
|
||||
}
|
||||
edje_object_signal_emit(wd->btn, "elm,state,text,visible", "elm");
|
||||
else
|
||||
{
|
||||
wd->label = NULL;
|
||||
edje_object_signal_emit(wd->btn, "elm,state,text,hidden", "elm");
|
||||
}
|
||||
edje_object_signal_emit(wd->btn, "elm,state,text,hidden", "elm");
|
||||
edje_object_message_signal_process(wd->btn);
|
||||
edje_object_part_text_set(wd->btn, "elm.text", label);
|
||||
_sizing_eval(obj);
|
||||
|
|
|
@ -216,17 +216,11 @@ elm_check_label_set(Evas_Object *obj, const char *label)
|
|||
ELM_CHECK_WIDTYPE(obj, widtype);
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
if (!wd) return;
|
||||
if (wd->label) eina_stringshare_del(wd->label);
|
||||
eina_stringshare_replace(&wd->label, label);
|
||||
if (label)
|
||||
{
|
||||
wd->label = eina_stringshare_add(label);
|
||||
edje_object_signal_emit(wd->chk, "elm,state,text,visible", "elm");
|
||||
}
|
||||
edje_object_signal_emit(wd->chk, "elm,state,text,visible", "elm");
|
||||
else
|
||||
{
|
||||
wd->label = NULL;
|
||||
edje_object_signal_emit(wd->chk, "elm,state,text,hidden", "elm");
|
||||
}
|
||||
edje_object_signal_emit(wd->chk, "elm,state,text,hidden", "elm");
|
||||
edje_object_message_signal_process(wd->chk);
|
||||
edje_object_part_text_set(wd->chk, "elm.text", label);
|
||||
_sizing_eval(obj);
|
||||
|
|
|
@ -318,8 +318,7 @@ _store_selection(Evas_Object *obj)
|
|||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
const char *sel = edje_object_part_text_selection_get(wd->ent, "elm.text");
|
||||
if (!wd) return;
|
||||
if (wd->cut_sel) eina_stringshare_del(wd->cut_sel);
|
||||
wd->cut_sel = eina_stringshare_add(sel);
|
||||
eina_stringshare_replace(&wd->cut_sel, sel);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -891,14 +890,9 @@ _signal_entry_cut_notify(void *data, Evas_Object *obj __UNUSED__, const char *em
|
|||
char *txt;
|
||||
if (!wd) return;
|
||||
evas_object_smart_callback_call(data, "selection,cut", NULL);
|
||||
if (wd->cut_sel) eina_stringshare_del(wd->cut_sel);
|
||||
wd->cut_sel = NULL;
|
||||
txt = _mkup_to_text(elm_entry_selection_get(data));
|
||||
if (txt)
|
||||
{
|
||||
wd->cut_sel = eina_stringshare_add(txt);
|
||||
free(txt);
|
||||
}
|
||||
eina_stringshare_replace(&wd->cut_sel, txt);
|
||||
if (txt) free(txt);
|
||||
edje_object_part_text_insert(wd->ent, "elm.text", "");
|
||||
wd->changed = EINA_TRUE;
|
||||
_sizing_eval(data);
|
||||
|
@ -1251,9 +1245,7 @@ elm_entry_entry_get(const Evas_Object *obj)
|
|||
ERR("text=NULL for edje %p, part 'elm.text'", wd->ent);
|
||||
return NULL;
|
||||
}
|
||||
if (wd->text) eina_stringshare_del(wd->text);
|
||||
wd->text = NULL;
|
||||
if (text) wd->text = eina_stringshare_add(text);
|
||||
eina_stringshare_replace(&wd->text, text);
|
||||
return wd->text;
|
||||
}
|
||||
|
||||
|
|
|
@ -184,8 +184,7 @@ elm_icon_standard_set(Evas_Object *obj, const char *name)
|
|||
Eina_Bool ret;
|
||||
|
||||
if ((!wd) || (!name)) return EINA_FALSE;
|
||||
if (wd->stdicon) eina_stringshare_del(wd->stdicon);
|
||||
wd->stdicon = eina_stringshare_add(name);
|
||||
eina_stringshare_replace(&wd->stdicon, name);
|
||||
ret = _elm_theme_icon_set(wd->img, name, "default");
|
||||
_sizing_eval(obj);
|
||||
return ret;
|
||||
|
|
|
@ -171,8 +171,7 @@ elm_label_label_set(Evas_Object *obj, const char *label)
|
|||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
if (!wd) return;
|
||||
if (!label) label = "";
|
||||
if (wd->label) eina_stringshare_del(wd->label);
|
||||
wd->label = eina_stringshare_add(label);
|
||||
eina_stringshare_replace(&wd->label, label);
|
||||
edje_object_part_text_set(wd->lbl, "elm.text", label);
|
||||
wd->changed = 1;
|
||||
_sizing_eval(obj);
|
||||
|
|
|
@ -333,18 +333,13 @@ _elm_window_property_change(void *data __UNUSED__, int ev_type __UNUSED__, void
|
|||
|
||||
val = ecore_x_window_prop_string_get(event->win,
|
||||
event->atom);
|
||||
if (_elm_config->theme)
|
||||
{
|
||||
eina_stringshare_del(_elm_config->theme);
|
||||
_elm_config->theme = NULL;
|
||||
}
|
||||
if (val)
|
||||
{
|
||||
_elm_config->theme = eina_stringshare_add(val);
|
||||
_elm_theme_parse(val);
|
||||
free(val);
|
||||
_elm_rescale();
|
||||
}
|
||||
eina_stringshare_replace(&_elm_config->theme, val);
|
||||
if (val)
|
||||
{
|
||||
_elm_theme_parse(val);
|
||||
free(val);
|
||||
_elm_rescale();
|
||||
}
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
|
@ -777,14 +772,7 @@ elm_quicklaunch_init(int argc, char **argv)
|
|||
|
||||
s = getenv("ELM_THEME");
|
||||
if (s)
|
||||
{
|
||||
if (_elm_config->theme)
|
||||
{
|
||||
eina_stringshare_del(_elm_config->theme);
|
||||
_elm_config->theme = NULL;
|
||||
}
|
||||
_elm_config->theme = eina_stringshare_add(s);
|
||||
}
|
||||
eina_stringshare_replace(&_elm_config->theme, s);
|
||||
|
||||
_elm_theme_parse(_elm_config->theme);
|
||||
|
||||
|
@ -859,14 +847,7 @@ elm_quicklaunch_init(int argc, char **argv)
|
|||
|
||||
s = getenv("ELM_MODULES");
|
||||
if (s)
|
||||
{
|
||||
if (_elm_config->modules)
|
||||
{
|
||||
eina_stringshare_del(_elm_config->modules);
|
||||
_elm_config->modules = NULL;
|
||||
}
|
||||
_elm_config->modules = eina_stringshare_add(s);
|
||||
}
|
||||
eina_stringshare_replace(&_elm_config->modules, s);
|
||||
if (_elm_config->modules) _elm_module_parse(_elm_config->modules);
|
||||
}
|
||||
|
||||
|
@ -934,12 +915,7 @@ elm_quicklaunch_sub_init(int argc, char **argv)
|
|||
_elm_atom_enlightenment_theme);
|
||||
if (s)
|
||||
{
|
||||
if (_elm_config->theme)
|
||||
{
|
||||
eina_stringshare_del(_elm_config->theme);
|
||||
_elm_config->theme = NULL;
|
||||
}
|
||||
_elm_config->theme = eina_stringshare_add(s);
|
||||
eina_stringshare_replace(&_elm_config->theme, s);
|
||||
_elm_theme_parse(s);
|
||||
free(s);
|
||||
}
|
||||
|
|
|
@ -795,9 +795,7 @@ grid_load(Evas_Object *obj, Grid *g)
|
|||
|
||||
source = map_sources_tab[wd->source].url_cb(x, y, g->zoom);
|
||||
|
||||
if (gi->file)
|
||||
eina_stringshare_del(gi->file);
|
||||
gi->file = eina_stringshare_add(buf2);
|
||||
eina_stringshare_replace(&gi->file, buf2);
|
||||
|
||||
if (ecore_file_exists(buf2) || g == eina_list_data_get(wd->grids))
|
||||
{
|
||||
|
@ -2646,9 +2644,7 @@ EAPI void
|
|||
elm_map_group_class_style_set(Elm_Map_Group_Class *clas, const char *style)
|
||||
{
|
||||
if (!clas) return;
|
||||
if (clas->style) eina_stringshare_del(clas->style);
|
||||
clas->style = NULL;
|
||||
if (style) clas->style = eina_stringshare_add(style);
|
||||
eina_stringshare_replace(&clas->style, style);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -2767,9 +2763,7 @@ EAPI void
|
|||
elm_map_marker_class_style_set(Elm_Map_Marker_Class *clas, const char *style)
|
||||
{
|
||||
if (!clas) return;
|
||||
if (clas->style) eina_stringshare_del(clas->style);
|
||||
clas->style = NULL;
|
||||
if (style) clas->style = eina_stringshare_add(style);
|
||||
eina_stringshare_replace(&clas->style, style);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -558,17 +558,13 @@ elm_menu_item_add(Evas_Object *obj, Elm_Menu_Item *parent, Evas_Object *icon, co
|
|||
EAPI void
|
||||
elm_menu_item_label_set(Elm_Menu_Item *item, const char *label)
|
||||
{
|
||||
if (item->label) eina_stringshare_del(item->label);
|
||||
eina_stringshare_replace(&item->label, label);
|
||||
|
||||
if (label)
|
||||
{
|
||||
item->label = eina_stringshare_add(label);
|
||||
edje_object_signal_emit(item->o, "elm,state,text,visible", "elm");
|
||||
}
|
||||
edje_object_signal_emit(item->o, "elm,state,text,visible", "elm");
|
||||
else
|
||||
{
|
||||
item->label = NULL;
|
||||
edje_object_signal_emit(item->o, "elm,state,text,hidden", "elm");
|
||||
}
|
||||
edje_object_signal_emit(item->o, "elm,state,text,hidden", "elm");
|
||||
|
||||
edje_object_message_signal_process(item->o);
|
||||
edje_object_part_text_set(item->o, "elm.text", label);
|
||||
_sizing_eval(item->menu);
|
||||
|
|
|
@ -1063,8 +1063,7 @@ elm_photocam_file_set(Evas_Object *obj, const char *file)
|
|||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
int w, h;
|
||||
if (!wd) return EVAS_LOAD_ERROR_GENERIC;
|
||||
if (wd->file) eina_stringshare_del(wd->file);
|
||||
wd->file = eina_stringshare_add(file);
|
||||
if (!eina_stringshare_replace(&wd->file, file)) return EVAS_LOAD_ERROR_NONE;
|
||||
evas_object_hide(wd->img);
|
||||
evas_object_image_smooth_scale_set(wd->img, (wd->nosmooth == 0));
|
||||
evas_object_image_file_set(wd->img, NULL, NULL);
|
||||
|
|
|
@ -319,16 +319,14 @@ elm_progressbar_label_set(Evas_Object *obj, const char *label)
|
|||
ELM_CHECK_WIDTYPE(obj, widtype);
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
if (!wd) return;
|
||||
if (wd->label) eina_stringshare_del(wd->label);
|
||||
eina_stringshare_replace(&wd->label, label);
|
||||
if (label)
|
||||
{
|
||||
wd->label = eina_stringshare_add(label);
|
||||
edje_object_signal_emit(wd->progressbar, "elm,state,text,visible", "elm");
|
||||
edje_object_message_signal_process(wd->progressbar);
|
||||
}
|
||||
else
|
||||
{
|
||||
wd->label = NULL;
|
||||
edje_object_signal_emit(wd->progressbar, "elm,state,text,hidden", "elm");
|
||||
edje_object_message_signal_process(wd->progressbar);
|
||||
}
|
||||
|
@ -417,16 +415,14 @@ elm_progressbar_unit_format_set(Evas_Object *obj, const char *units)
|
|||
ELM_CHECK_WIDTYPE(obj, widtype);
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
if (!wd) return;
|
||||
if (wd->units) eina_stringshare_del(wd->units);
|
||||
eina_stringshare_replace(&wd->units, units);
|
||||
if (units)
|
||||
{
|
||||
wd->units = eina_stringshare_add(units);
|
||||
edje_object_signal_emit(wd->progressbar, "elm,state,units,visible", "elm");
|
||||
edje_object_message_signal_process(wd->progressbar);
|
||||
}
|
||||
else
|
||||
{
|
||||
wd->units = NULL;
|
||||
edje_object_signal_emit(wd->progressbar, "elm,state,units,hidden", "elm");
|
||||
edje_object_message_signal_process(wd->progressbar);
|
||||
}
|
||||
|
|
|
@ -251,16 +251,14 @@ elm_radio_label_set(Evas_Object *obj, const char *label)
|
|||
ELM_CHECK_WIDTYPE(obj, widtype);
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
if (!wd) return;
|
||||
if (wd->label) eina_stringshare_del(wd->label);
|
||||
eina_stringshare_replace(&wd->label, label);
|
||||
if (label)
|
||||
{
|
||||
wd->label = eina_stringshare_add(label);
|
||||
edje_object_signal_emit(wd->chk, "elm,state,text,visible", "elm");
|
||||
edje_object_message_signal_process(wd->chk);
|
||||
}
|
||||
else
|
||||
{
|
||||
wd->label = NULL;
|
||||
edje_object_signal_emit(wd->chk, "elm,state,text,hidden", "elm");
|
||||
edje_object_message_signal_process(wd->chk);
|
||||
}
|
||||
|
|
|
@ -329,16 +329,14 @@ elm_slider_label_set(Evas_Object *obj, const char *label)
|
|||
ELM_CHECK_WIDTYPE(obj, widtype);
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
if (!wd) return;
|
||||
if (wd->label) eina_stringshare_del(wd->label);
|
||||
eina_stringshare_replace(&wd->label, label);
|
||||
if (label)
|
||||
{
|
||||
wd->label = eina_stringshare_add(label);
|
||||
edje_object_signal_emit(wd->slider, "elm,state,text,visible", "elm");
|
||||
edje_object_message_signal_process(wd->slider);
|
||||
}
|
||||
else
|
||||
{
|
||||
wd->label = NULL;
|
||||
edje_object_signal_emit(wd->slider, "elm,state,text,hidden", "elm");
|
||||
edje_object_message_signal_process(wd->slider);
|
||||
}
|
||||
|
@ -461,16 +459,14 @@ elm_slider_unit_format_set(Evas_Object *obj, const char *units)
|
|||
ELM_CHECK_WIDTYPE(obj, widtype);
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
if (!wd) return;
|
||||
if (wd->units) eina_stringshare_del(wd->units);
|
||||
eina_stringshare_replace(&wd->units, units);
|
||||
if (units)
|
||||
{
|
||||
wd->units = eina_stringshare_add(units);
|
||||
edje_object_signal_emit(wd->slider, "elm,state,units,visible", "elm");
|
||||
edje_object_message_signal_process(wd->slider);
|
||||
}
|
||||
else
|
||||
{
|
||||
wd->units = NULL;
|
||||
edje_object_signal_emit(wd->slider, "elm,state,units,hidden", "elm");
|
||||
edje_object_message_signal_process(wd->slider);
|
||||
}
|
||||
|
@ -497,9 +493,7 @@ elm_slider_indicator_format_set(Evas_Object *obj, const char *indicator)
|
|||
ELM_CHECK_WIDTYPE(obj, widtype);
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
if (!wd) return;
|
||||
if (wd->indicator) eina_stringshare_del(wd->indicator);
|
||||
if (indicator) wd->indicator = eina_stringshare_add(indicator);
|
||||
else wd->indicator = NULL;
|
||||
eina_stringshare_replace(&wd->indicator, indicator);
|
||||
_indicator_set(obj);
|
||||
}
|
||||
|
||||
|
|
|
@ -409,8 +409,7 @@ elm_slideshow_transition_set(Evas_Object *obj, const char *transition)
|
|||
ELM_CHECK_WIDTYPE(obj, widtype);
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
if (!wd) return;
|
||||
eina_stringshare_del(wd->transition);
|
||||
wd->transition = eina_stringshare_add(transition);
|
||||
eina_stringshare_replace(&wd->transition, transition);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -533,8 +533,7 @@ elm_spinner_label_format_set(Evas_Object *obj, const char *fmt)
|
|||
ELM_CHECK_WIDTYPE(obj, widtype);
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
if (!wd) return;
|
||||
if (wd->label) eina_stringshare_del(wd->label);
|
||||
wd->label = eina_stringshare_add(fmt);
|
||||
eina_stringshare_replace(&wd->label, fmt);
|
||||
_write_label(obj);
|
||||
_sizing_eval(obj);
|
||||
}
|
||||
|
|
|
@ -172,17 +172,11 @@ elm_toggle_label_set(Evas_Object *obj, const char *label)
|
|||
ELM_CHECK_WIDTYPE(obj, widtype);
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
if (!wd) return;
|
||||
if (wd->label) eina_stringshare_del(wd->label);
|
||||
eina_stringshare_replace(&wd->label, label);
|
||||
if (label)
|
||||
{
|
||||
wd->label = eina_stringshare_add(label);
|
||||
edje_object_signal_emit(wd->tgl, "elm,state,text,visible", "elm");
|
||||
}
|
||||
edje_object_signal_emit(wd->tgl, "elm,state,text,visible", "elm");
|
||||
else
|
||||
{
|
||||
wd->label = NULL;
|
||||
edje_object_signal_emit(wd->tgl, "elm,state,text,hidden", "elm");
|
||||
}
|
||||
edje_object_signal_emit(wd->tgl, "elm,state,text,hidden", "elm");
|
||||
edje_object_message_signal_process(wd->tgl);
|
||||
edje_object_part_text_set(wd->tgl, "elm.text", label);
|
||||
_sizing_eval(obj);
|
||||
|
@ -230,12 +224,8 @@ elm_toggle_states_labels_set(Evas_Object *obj, const char *onlabel, const char *
|
|||
ELM_CHECK_WIDTYPE(obj, widtype);
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
if (!wd) return;
|
||||
if (wd->ontext) eina_stringshare_del(wd->ontext);
|
||||
if (wd->offtext) eina_stringshare_del(wd->offtext);
|
||||
if (onlabel) wd->ontext = eina_stringshare_add(onlabel);
|
||||
else wd->ontext = NULL;
|
||||
if (offlabel) wd->offtext = eina_stringshare_add(offlabel);
|
||||
else wd->offtext = NULL;
|
||||
eina_stringshare_replace(&wd->ontext, onlabel);
|
||||
eina_stringshare_replace(&wd->offtext, offlabel);
|
||||
edje_object_part_text_set(wd->tgl, "elm.ontext", onlabel);
|
||||
edje_object_part_text_set(wd->tgl, "elm.offtext", offlabel);
|
||||
_sizing_eval(obj);
|
||||
|
|
|
@ -418,8 +418,7 @@ elm_toolbar_item_label_set(Elm_Toolbar_Item *item, const char *label)
|
|||
Evas_Coord mw = -1, mh = -1;
|
||||
|
||||
if (!item) return;
|
||||
eina_stringshare_del(item->label);
|
||||
item->label = eina_stringshare_add(label);
|
||||
eina_stringshare_replace(&item->label, label);
|
||||
edje_object_part_text_set(item->base, "elm.text", item->label);
|
||||
|
||||
elm_coords_finger_size_adjust(1, &mw, 1, &mh);
|
||||
|
|
|
@ -814,13 +814,10 @@ elm_widget_scale_get(const Evas_Object *obj)
|
|||
EAPI void
|
||||
elm_widget_style_set(Evas_Object *obj, const char *style)
|
||||
{
|
||||
const char *old;
|
||||
API_ENTRY return;
|
||||
|
||||
old = sd->style;
|
||||
sd->style = eina_stringshare_add(style);
|
||||
if (old) eina_stringshare_del(old);
|
||||
if (old != sd->style) elm_widget_theme(obj);
|
||||
if (eina_stringshare_replace(&sd->style, style))
|
||||
elm_widget_theme(obj);
|
||||
}
|
||||
|
||||
EAPI const char *
|
||||
|
@ -834,11 +831,8 @@ elm_widget_style_get(const Evas_Object *obj)
|
|||
EAPI void
|
||||
elm_widget_type_set(Evas_Object *obj, const char *type)
|
||||
{
|
||||
const char *old;
|
||||
API_ENTRY return;
|
||||
old = sd->type;
|
||||
sd->type = eina_stringshare_add(type);
|
||||
if (old) eina_stringshare_del(old);
|
||||
eina_stringshare_replace(&sd->type, type);
|
||||
}
|
||||
|
||||
EAPI const char *
|
||||
|
|
Loading…
Reference in New Issue