Rockbox mail archive
Subject: Re: Simplifying simple lists
Re: Simplifying simple lists
On 8 April 2010 22:24, Al Le <Al.Le_at_gmx.de> wrote:
> I'm looking at the simple list implementation and find it not as simple as it could/should be. I'd like to do the following changes as a first step:
> 1. Eliminate the 'count' parameter of the function 'simplelist_info_init'. If the custom 'get_name' callback is not set then the value of 'count' is ignored and the static value 'simplelist_line_count' is used instead. Hence, if you set a custom name callback you'll also set the number of items. But if you don't use a custom callback (most of the time I think) you shouldn't be forced to provide the count parameter.
> 2. In the function 'simplelist_info_init', I'd also set the value of simplelist_line_count to zero. Since at that point we begin to construct a new list. After a call to 'simplelist_info_init' we should be able to just call 'simplelist_addline' without any intermediate actions. As of now, you must call 'simplelist_set_line_count' in between.
> Any comments / thoughts / objections?
> I have other thoughts about this API, but I'll post them later in a separate mail.
> GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
> Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01
Received on 2010-04-08
Page was last modified "Jan 10 2012" The Rockbox Crew