Re: Operation options (filtering, sorting and more)



On Tue, 2011-03-15 at 18:46 +0100, Guillaume Emont wrote:
> > I fail to see why having things separated can complicate the
> problem.
> Depends what you call separated. The things that Ifear would
> complicate
> the issue are:
>  - having more than one option structure passed to the media source
> operation function (_search()/_browse()/...)

I never said you need to pass more than one structure to operations: all
allowed options (filtering, sorting) will be encapsulated in one
GrlOptions.

>  - having unneeded inheritance.

Fair enough. Don't use it if it is not needed.

> I wouldn't be against something like:
> typedef struct {
>   GrlFilter *filter;
>   GrlSortParameters *sort_params;
> } _GrlOperationOptionsPriv;
> 
> void grl_operation_options_set_filter (GrlFilter *filter);
> void grl_operation_options_set_sort_parameters (GrlFilter *filter);
> 
> But I am not sure it is really needed, and it would need slightly more
> work on the caller side. 


What I mean is having a GrlFilter and related operations for filtering;
GrlSort and related operations for sort.

And have one api to add GrlFilter and GrlSort in a GrlOptions that would
be passed to the plugin. The same to recover them.

For me it is cleaner.


	J.A.




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