On Wed, Jun 29, 2011 at 7:31 PM, Vincent Torri <vto...@univ-evry.fr> wrote:
> On Wed, 29 Jun 2011, Enlightenment SVN wrote:
>
>> Log:
>> emotion: use stringshare for file.
>>
>>
>> Author:       cedric
>> Date:         2011-06-29 06:58:42 -0700 (Wed, 29 Jun 2011)
>> New Revision: 60818
>> Trac:         http://trac.enlightenment.org/e/changeset/60818
>>
>> Modified:
>>  trunk/emotion/src/lib/emotion_smart.c
>>
>> Modified: trunk/emotion/src/lib/emotion_smart.c
>> ===================================================================
>> --- trunk/emotion/src/lib/emotion_smart.c     2011-06-29 13:25:58 UTC (rev 
>> 60817)
>> +++ trunk/emotion/src/lib/emotion_smart.c     2011-06-29 13:58:42 UTC (rev 
>> 60818)
>> @@ -1,6 +1,14 @@
>> #include "emotion_private.h"
>> #include "Emotion.h"
>>
>> +#ifdef HAVE_EIO
>> +# include <Eio.h>
>> +#else
>> +# ifdef HAVE_XATTR
>
> is it checked in configure.ac ?

Yup.

>> +#  include <sys/xattr.h>
>> +# endif
>> +#endif
>> +
>> #define E_SMART_OBJ_GET(smart, o, type) \
>>      { \
>>       char *_e_smart_str; \
>> @@ -42,7 +50,7 @@
>>
>>    char                  *module_name;
>>
>> -   char          *file;
>> +   const char    *file;
>>    Evas_Object   *obj;
>>    double         ratio;
>>    double         pos;
>> @@ -69,6 +77,11 @@
>>       int button;
>>    } spu;
>>
>> +#ifdef HAVE_EIO
>> +   Eio_File *load_xattr;
>> +   Eio_File *save_xattr;
>> +#endif
>> +
>>    Emotion_Module_Options module_options;
>> };
>>
>> @@ -275,7 +288,7 @@
>> emotion_object_init(Evas_Object *obj, const char *module_filename)
>> {
>>    Smart_Data *sd;
>> -   char *file;
>> +   const char *file;
>>
>>    E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
>>
>> @@ -317,7 +330,7 @@
>>    if (file)
>>      {
>>       emotion_object_file_set(obj, file);
>> -     free(file);
>> +     eina_stringshare_del(file);
>>      }
>>
>>    return EINA_TRUE;
>> @@ -333,13 +346,12 @@
>>    DBG("file=%s", file);
>>    if (!sd->module) return EINA_FALSE;
>>
>> -   if ((file) && (sd->file) && (!strcmp(file, sd->file))) return EINA_FALSE;
>> +   if ((file) && (sd->file) && (file == sd->file || !strcmp(file, 
>> sd->file))) return EINA_FALSE;
>>    if ((file) && (file[0] != 0))
>>      {
>>         int w, h;
>>
>> -     free(sd->file);
>> -     sd->file = strdup(file);
>> +     eina_stringshare_replace(&sd->file, file);
>>       sd->module->file_close(sd->video);
>>         evas_object_image_data_set(sd->obj, NULL);
>>       evas_object_image_size_set(sd->obj, 1, 1);
>> @@ -361,8 +373,7 @@
>>            evas_object_image_size_set(sd->obj, 1, 1);
>>              _emotion_image_data_zero(sd->obj);
>>         }
>> -        free(sd->file);
>> -        sd->file = NULL;
>> +        eina_stringshare_replace(&sd->file, NULL);
>>      }
>>
>>    return EINA_TRUE;
>> @@ -1597,7 +1608,7 @@
>>    if (sd->video) sd->module->file_close(sd->video);
>>    _emotion_module_close(sd->module, sd->video);
>>    evas_object_del(sd->obj);
>> -   free(sd->file);
>> +   eina_stringshare_del(sd->file);
>>    free(sd->module_name);
>>    if (sd->job) ecore_job_del(sd->job);
>>    free(sd->progress.info);
>>
>>
>> ------------------------------------------------------------------------------
>> All of the data generated in your IT infrastructure is seriously valuable.
>> Why? It contains a definitive record of application performance, security
>> threats, fraudulent activity, and more. Splunk takes this data and makes
>> sense of it. IT sense. And common sense.
>> http://p.sf.net/sfu/splunk-d2d-c2
>> _______________________________________________
>> enlightenment-svn mailing list
>> enlightenment-...@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/enlightenment-svn
>>
>>
>
> ------------------------------------------------------------------------------
> All of the data generated in your IT infrastructure is seriously valuable.
> Why? It contains a definitive record of application performance, security
> threats, fraudulent activity, and more. Splunk takes this data and makes
> sense of it. IT sense. And common sense.
> http://p.sf.net/sfu/splunk-d2d-c2
> _______________________________________________
> enlightenment-devel mailing list
> enlightenment-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
>
>



-- 
Cedric BAIL

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to