strdup -> evas_stringshare

SVN revision: 24266
This commit is contained in:
sebastid 2006-07-28 11:27:59 +00:00 committed by sebastid
parent dbe9adc835
commit 02d2993d17
3 changed files with 14 additions and 15 deletions

View File

@ -279,7 +279,6 @@ _load_bgs(E_Config_Dialog *cfd, Evas_Object *il)
char *homedir;
const char *f;
char *c;
int selnum = -1;
int i = 0;
@ -299,7 +298,6 @@ _load_bgs(E_Config_Dialog *cfd, Evas_Object *il)
i++;
f = e_theme_edje_file_get("base/theme/backgrounds", "desktop/background");
c = strdup(f);
if (edje_object_file_set(o, f, "desktop/background"))
{
Evas_Object *ic = NULL;
@ -396,7 +394,6 @@ _load_bgs(E_Config_Dialog *cfd, Evas_Object *il)
}
evas_list_free(bg);
if (bg_dirs) e_path_dir_list_free(bg_dirs);
free(c);
cfd->data = im;
e_widget_ilist_go(il);
if (selnum >= 0)

View File

@ -9,15 +9,15 @@ struct _E_Thumb
{
int objid;
int w, h;
char *file;
char *key;
const char *file;
const char *key;
unsigned char queued : 1;
unsigned char busy : 1;
unsigned char done : 1;
};
/* local subsystem functions */
static void _e_thumb_gen_begin(int objid, char *file, char *key, int w, int h);
static void _e_thumb_gen_begin(int objid, const char *file, const char *key, int w, int h);
static void _e_thumb_gen_end(int objid);
static void _e_thumb_del_hook(void *data, Evas *e, Evas_Object *obj, void *event_info);
static void _e_thumb_hash_add(int objid, Evas_Object *obj);
@ -90,16 +90,18 @@ e_thumb_icon_add(Evas *evas)
}
EAPI void
e_thumb_icon_file_set(Evas_Object *obj, char *file, char *key)
e_thumb_icon_file_set(Evas_Object *obj, const char *file, const char *key)
{
E_Thumb *eth;
eth = evas_object_data_get(obj, "e_thumbdata");
if (!eth) return;
E_FREE(eth->file);
E_FREE(eth->key);
if (file) eth->file = strdup(file);
if (key) eth->key = strdup(key);
if (eth->file) evas_stringshare_del(eth->file);
eth->file = NULL;
if (eth->key) evas_stringshare_del(eth->key);
eth->key = NULL;
if (file) eth->file = evas_stringshare_add(file);
if (key) eth->key = evas_stringshare_add(key);
}
EAPI void
@ -235,7 +237,7 @@ e_thumb_client_del(Ecore_Ipc_Event_Client_Del *e)
/* local subsystem functions */
static void
_e_thumb_gen_begin(int objid, char *file, char *key, int w, int h)
_e_thumb_gen_begin(int objid, const char *file, const char *key, int w, int h)
{
char *buf;
int l1, l2;
@ -288,8 +290,8 @@ _e_thumb_del_hook(void *data, Evas *e, Evas_Object *obj, void *event_info)
}
if (eth->queued)
_thumb_queue = evas_list_remove(_thumb_queue, eth);
E_FREE(eth->file);
E_FREE(eth->key);
if (eth->file) evas_stringshare_del(eth->file);
if (eth->key) evas_stringshare_del(eth->key);
free(eth);
}

View File

@ -12,7 +12,7 @@ EAPI int e_thumb_init(void);
EAPI int e_thumb_shutdown(void);
EAPI Evas_Object *e_thumb_icon_add(Evas *evas);
EAPI void e_thumb_icon_file_set(Evas_Object *obj, char *file, char *key);
EAPI void e_thumb_icon_file_set(Evas_Object *obj, const char *file, const char *key);
EAPI void e_thumb_icon_size_set(Evas_Object *obj, int w, int h);
EAPI void e_thumb_icon_begin(Evas_Object *obj);
EAPI void e_thumb_icon_end(Evas_Object *obj);