Dave Andreoli wrote:
> ----- "Christopher Michael" <[EMAIL PROTECTED]> ha scritto:
> 
>> It is the proper fix. If we don't want to delete the config then there
>>
>> is no need to use _gc_id_del.
>>
>> dh
> 
> Yes, I know...I mean, we really want to keep all the configs for all
> module ever loaded? It seems to me more a workaround to the fact
> that id_del doesn't work as expected. If we really don't want to
> delete the confs then we can also remove the id_del function from
> the module API... it can cause big-headhance if someone try to use
> it and it doesn't work!!...I am one of those!
> 
Well, I personally don't see a point in keeping configs around for a 
million years :)

> Another id-stuff not so clear to me...or maybe a bug ;)
> In the skel module the new-generated ids seems to restart every time
> from 0. It didn't take into account other existant instances.
> Example: the first skel you place get the id 'classname.0' then the second
> you place get 'classname.1'
> But if you restart E and place the third instance it get another 'classname.0'
> that is used yet.
> Am I wrong?
> 
Hmm, I'll have to look into that one.

> 
> I have used another method to generate a unique id, something like:
>   snprintf(buf, sizeof(buf), "%s.%f", client_class->name, ecore_time_get());
> 
> So I get ids like 'modulename.1226243030,874566' and I never get two equal id.
> What do you think?
> 
Seems more than adequate for randomness.....

dh

> Thanks
> Dave
> 
> 
> 
>> Dave Andreoli wrote:
>>> I reply to myself... changed idea :)
>>>
>>> I'm not so sure that this is the proper fix, I think we need the
>> id_del() 
>>> function, it's not so good to keep the config of every module
>> forever.
>>> Maybe the real problem is that E should not call id_del() when just
>> a gc_shutdown()
>>> is needed.... is there a reason to call id_del on every shoutdown?
>>>
>>> Dave
>>>
>>>
>>>
>>> ----- "Dave Andreoli" <[EMAIL PROTECTED]> ha scritto:
>>>
>>>> yes, better now :)
>>>> Dave
>>>>
>>>> ----- "Enlightenment SVN" <[EMAIL PROTECTED]> ha scritto:
>>>>
>>>>> Log:
>>>>>   Proper fix for not using _gc_id_del.
>>>>>   
>>>>>   
>>>>> Author:       devilhorns
>>>>> Date:         2008-11-08 22:50:49 -0800 (Sat, 08 Nov 2008)
>>>>> New Revision: 37558
>>>>>
>>>>> Modified:
>>>>>   trunk/E-MODULES-EXTRA/skel/src/e_mod_main.c 
>>>>>
>>>>> Modified: trunk/E-MODULES-EXTRA/skel/src/e_mod_main.c
>>>>>
>> ===================================================================
>>>>> --- trunk/E-MODULES-EXTRA/skel/src/e_mod_main.c   2008-11-09
>> 06:09:53
>>>>> UTC (rev 37557)
>>>>> +++ trunk/E-MODULES-EXTRA/skel/src/e_mod_main.c   2008-11-09
>> 06:50:49
>>>>> UTC (rev 37558)
>>>>> @@ -7,7 +7,6 @@
>>>>>  static void _gc_orient(E_Gadcon_Client *gcc, E_Gadcon_Orient
>>>>> orient);
>>>>>  static char *_gc_label(E_Gadcon_Client_Class *client_class);
>>>>>  static const char *_gc_id_new(E_Gadcon_Client_Class
>>>> *client_class);
>>>>> -static void _gc_id_del(E_Gadcon_Client_Class *client_class,
>> const
>>>>> char *id);
>>>>>  static Evas_Object *_gc_icon(E_Gadcon_Client_Class
>> *client_class,
>>>>> Evas *evas);
>>>>>  
>>>>>  static void _skel_conf_new(void);
>>>>> @@ -46,7 +45,7 @@
>>>>>  {
>>>>>     GADCON_CLIENT_CLASS_VERSION, "skel", 
>>>>>       {_gc_init, _gc_shutdown, _gc_orient, _gc_label, _gc_icon, 
>>>>> -          _gc_id_new, _gc_id_del},
>>>>> +          _gc_id_new, NULL},
>>>>>     E_GADCON_CLIENT_STYLE_PLAIN
>>>>>  };
>>>>>  
>>>>> @@ -54,7 +53,7 @@
>>>>>  
>>>>>  /*
>>>>>   * Module Functions
>>>>> -*/
>>>>> + */
>>>>>  EAPI void *
>>>>>  e_modapi_init(E_Module *m) 
>>>>>  {
>>>>> @@ -73,7 +72,6 @@
>>>>>                                   NULL, buf,
>>>>> e_int_config_skel_module);
>>>>>  
>>>>>     /* Define EET Data Storage */
>>>>> -
>>>>>     conf_item_edd = E_CONFIG_DD_NEW("Config_Item", Config_Item);
>>>>>     #undef T
>>>>>     #undef D
>>>>> @@ -178,12 +176,15 @@
>>>>>  
>>>>>          /* Grab an item from the list */
>>>>>          ci = skel_conf->conf_items->data;
>>>>> +
>>>>>          /* remove it */
>>>>>          skel_conf->conf_items = 
>>>>>            eina_list_remove_list(skel_conf->conf_items, 
>>>>>                                  skel_conf->conf_items);
>>>>> -        /* cleanup stringshares !! ) */
>>>>> +
>>>>> +        /* cleanup stringshares */
>>>>>          if (ci->id) eina_stringshare_del(ci->id);
>>>>> +
>>>>>          /* keep the planet green */
>>>>>          E_FREE(ci);
>>>>>       }
>>>>> @@ -298,26 +299,6 @@
>>>>>     return ci->id;
>>>>>  }
>>>>>  
>>>>> -/* gets called when container says remove this item */
>>>>> -static void 
>>>>> -_gc_id_del(E_Gadcon_Client_Class *client_class, const char *id) 
>>>>> -{
>>>>> -/* yes - don't do this. on shutdown gadgets are deleted and this
>>>>> means config
>>>>> - * for them is deleted - that means empty config is saved. keep
>>>> them
>>>>> around
>>>>> - * as if u add a gadget back it can pick up its old config again
>>>>> - * 
>>>>> -   Config_Item *ci = NULL;
>>>>> -   printf("SKEL ID_DEL: [%s]\n", id);
>>>>> -   if (!(ci = _skel_conf_item_get(id))) return;
>>>>> -
>>>>> -   // cleanup !!
>>>>> -   if (ci->id) eina_stringshare_del(ci->id);
>>>>> -
>>>>> -   skel_conf->conf_items =
>> eina_list_remove(skel_conf->conf_items,
>>>>> ci);
>>>>> -   E_FREE(ci);
>>>>> - */
>>>>> -}
>>>>> -
>>>>>  static Evas_Object *
>>>>>  _gc_icon(E_Gadcon_Client_Class *client_class, Evas *evas) 
>>>>>  {
>>>>>
>>>>>
>>>>>
>> -------------------------------------------------------------------------
>>>>> This SF.Net email is sponsored by the Moblin Your Move
>> Developer's
>>>>> challenge
>>>>> Build the coolest Linux based applications with Moblin SDK & win
>>>> great
>>>>> prizes
>>>>> Grand prize is a trip for two to an Open Source event anywhere in
>>>> the
>>>>> world
>>>>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>>>>> _______________________________________________
>>>>> enlightenment-svn mailing list
>>>>> [EMAIL PROTECTED]
>>>>> https://lists.sourceforge.net/lists/listinfo/enlightenment-svn
>> -------------------------------------------------------------------------
>>>> This SF.Net email is sponsored by the Moblin Your Move Developer's
>>>> challenge
>>>> Build the coolest Linux based applications with Moblin SDK & win
>> great
>>>> prizes
>>>> Grand prize is a trip for two to an Open Source event anywhere in
>> the
>>>> world
>>>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>>>> _______________________________________________
>>>> enlightenment-devel mailing list
>>>> enlightenment-devel@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
> 


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to