Qt Branch trip handling

Tomaz Canabrava tcanabrava at kde.org
Thu May 2 12:34:18 PDT 2013


They are, because they are used by the model::headerData() method to get
the name of the columns.

TreeItemDT = RootItem ( data fills the columns )
TripItem : public TreeItemDT ( only has LOCATION and TIME )
DiveItem  : public TreeItemDT ( has everything )

nothing is being wasted here.
I dislike a bit the way of switch statement of subsurface with a lot of
items, sometimes a

switch ( bleh ){
   case 1 : return item->text(); break;
   case 2 : return item->icon(); break;
}

helps legibility with long switches - and we have more than 10 columns, it
looks like a really long code where we are actually just returning stuff. :)




2013/5/2 Amit Chaudhuri <amit.k.chaudhuri at gmail.com>

> Ah...I do indeed see the number of dives...and hadn't done the comparison
> with Gtk UI.
>
> But that means that the guts of TreeItemDT::data are not required...
>
>
> On Thu, May 2, 2013 at 7:28 PM, Dirk Hohndel <dirk at hohndel.org> wrote:
>
>> On Thu, 2013-05-02 at 19:16 +0100, Amit Chaudhuri wrote:
>> > Hi guys.
>> >
>> > I really like the fact that we now have some trip support in the dive
>> > list.
>> >
>> >
>> > I think things are a bit confused though.  There is a data method in
>> > TreeItemDT and an overload in the derived TripItem.  The latter wins
>> > out so we don't see much beyond the location at the trip level.
>>
>> You should get the date (with number of dives in the trip) as well with
>> the latest Qt branch.
>>
>> > The other method has a lot more 'stuff' in it and so if we use that
>> > there's a whole load of additional (placeholder) stuff visible.  Not
>> > quite sure what the intention is but recognise its a work in progress.
>> > And it's perfectly possible I stuffed up a merge, so please let me
>> > know if you think the problem is at my end and not in the Qt branch.
>>
>> Maybe I'm missing what you are looking for. In the Gtk UI the trip line
>> contains only date (with # of dives in the trip) plus location - nothing
>> else. And the latest Qt branch should show the same.
>>
>> /D
>>
>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20130502/e05d2fa6/attachment.html>


More information about the subsurface mailing list