Re: GtkTreeModelSort insert function does not respect default sort



On 2/11/02 12:46 PM, "Jonathan Blandford" <jrb redhat com> wrote:

> Darin Adler <darin bentspoon com> writes:
> 
>> Here's my cut at a patch. OK to commit?
> 
>> +#define NO_SORT_FUNC ((GtkTreeIterCompareFunc) 0x1)
> 
> Good idea.
> 
>> +      GtkTreeDataSortHeader *header;
>> +      
>> +      header = _gtk_tree_data_list_get_header (tree_model_sort->sort_list,
>> +                           tree_model_sort->sort_column_id);
>> +      
>> +      if (!header)
>> +    return 0;
> 
> Should this happen?  Returning 0 arbitrarily seems wrong?  I'd rather
> see a g_return_if_fail here then just silently return 0.

Sounds good.

>> +      func = tree_model_sort->default_sort_func;
>> +      data = tree_model_sort->default_sort_data;
>> +      
>> +      if (func == NO_SORT_FUNC)
>> +    return 0;
> 
> This line here concerns me.  If func is NO_SORT_FUNC, then the order it
> needs to return is the order it is in the child model, not just 0.

OK. I was just aping the existing behavior without thinking it through. I'll
see what I can do to fix it correctly.

    -- Darin




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