On Sat, 16 Aug 2008, Frank Niessink wrote:
> Hi Jérôme,
>
> 2008/8/16 Jerome Laheurte <[EMAIL PROTECTED]>:
>>
>> Hi, Frank. I was implementing the 'Notes column' in the task viewer
>> when, after seeing some strange behaviour, I realized that in
>> itemctrl.py, columns are actually identified using their header
>> instead of name (see for instance Column.__eq__).
>>
>> Is there a good reason for that ? Obviously, when two columns have the
>> same header (say, 'Notes' and 'Attachments' having header ''), strange
>> things happen...
>
> I have been looking into this as well a couple of days ago. I changed
> Column.__eq__ to use column.name() instead of column.header(), but I
> kept running in different kinds of problems and didn't commit those
> changes. For example, in
> _BaseCtrlWithColumns._getColumnIndex(columnHeader) looks up the column
> index by using the column header. That won't work either when having
> two columns with the same header (''). _CtrlWithHideableColumns
> overrides _getColumnIndex, so that one needs to be changed too. So,
> it's not a one line change. On the other hand, it doesn't look too
> difficult to make _getColumnIndex use column.name() instead of
> column.header(), so please go ahead.
Yeah, I saw there were several instances of this. I'll try to
factorize this (after all, couldn't all methods use the overriden
__eq__ operator ?).
Cheers
Jérôme