Re: Patch that adds some API to the merge folder



On Fri, 2007-08-31 at 12:51 +0200, Sergio Villar Senin wrote:
> Philip Van Hoof wrote:
> > On Fri, 2007-08-31 at 12:10 +0200, Sergio Villar Senin wrote:
> > 
> >> I'd like to add two new functions to the TnyMergeFolder API. These two
> >> ones are:
> >>
> >> void tny_merge_folder_remove_folder (TnyMergeFolder *self, TnyFolder
> >> folder);
> > 
> > This one sounds good
> > 
> >> gint tny_merge_folder_get_num_folders (TnyMergeFolder *self);
> > 
> > Either this and change tny_list_get_length to tny_list_get_num_items or
> > change this to tny_merge_folder_get_length or something. This feels a
> > little bit inconsistent in my opinion :-\
> 
> Sure, I was not very happy with the name. I was doubting between adding
> this function or another one that just returns the list of folders, but
> maybe we do not want to expose too much that list, not sure.

I would do that, indeed. Why not? The app developer had to add the
items, so why not allow him to get them too?

For list APIs we, however, never return lists in Tinymail. So always
make an API that returns void and accepts a (new) TnyList.

The count, you can simply just tny_list_get_length that list and unref
the list. On performance, that's fast enough (just some reference adding
and creating a glist, nothing to worry about for this infrastructure,
unless you have 1000000 method folders in the merge folder).

How does that sound?


-- 
Philip Van Hoof, software developer
home: me at pvanhoof dot be 
gnome: pvanhoof at gnome dot org 
http://www.pvanhoof.be/blog







[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]