Quantcast

wxDVC: why pass root item to some model functions?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

wxDVC: why pass root item to some model functions?

Vadim Zeitlin-4
 Hello again,

 Another, more minor, question I have about wxDVC is why does it pass, at
least in generic version, the root pseudo item to such model methods as
GetParent() and IsContainer() (and possible HasContainerColumns() too but I
didn't test this)? It seems pretty obvious that the root item never has any
parent and always does have children (and hence is a container[*]) so why
burden the user code defining the model with checks for item.IsOk()
especially when forgetting them can/will easily result in a crash?

 If there is no hidden reason for this, can I change this please?

 Thanks,
VZ

[*] Another regret I have with wxDVC is that it seems to do its utmost
    to use names incompatible with the rest of wx API: it's really a pity
    that IsContainer() isn't called HasChildren(), as in wxTreeCtrl.

_______________________________________________
wx-dev mailing list
[hidden email]
http://lists.wxwidgets.org/mailman/listinfo/wx-dev

attachment0 (194 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: wxDVC: why pass root item to some model functions?

Robert Roebling

Vadim Zeitlin wrote:

> Another question I have about wxDVC is why does it pass, at
> least in generic version, the root pseudo item to such model
> methods as GetParent() and IsContainer() (and possible
> HasContainerColumns() too but I didn't test this)?

I don't remember where this happens and why (after all,
I didn't write the generic code) but it does seem useless.

> [...] that it seems to do its utmost to use names incompatible
>  with the rest of wx API: it's really a pity

Yes, I'm usually doing the "utmost" to harm this project.

  Robert


_______________________________________________
wx-dev mailing list
[hidden email]
http://lists.wxwidgets.org/mailman/listinfo/wx-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re[2]: wxDVC: why pass root item to some model functions?

Vadim Zeitlin-4
On Sat, 23 May 2009 10:13:01 +0200 Robert Roebling wrote:

RR> Vadim Zeitlin wrote:
RR>
RR> > Another question I have about wxDVC is why does it pass, at
RR> > least in generic version, the root pseudo item to such model
RR> > methods as GetParent() and IsContainer() (and possible
RR> > HasContainerColumns() too but I didn't test this)?
RR>
RR> I don't remember where this happens and why (after all,
RR> I didn't write the generic code) but it does seem useless.

 Ok, I'll change this then, thanks for confirmation.


RR> > [...] that it seems to do its utmost to use names incompatible
RR> >  with the rest of wx API: it's really a pity
RR>
RR> Yes, I'm usually doing the "utmost" to harm this project.

 Obviously I didn't mean that it was done intentionally and if you didn't
write this code the explanation is probably as simple as that the person
who did write it didn't know about the rest of wx API. Anyhow, if there is
anybody to blame it's me as I had repeatedly promised to look at wxDVC API
when it was developed and never had time to do it while reviewing it back
then could have helped a lot with seeveral problems I have with it now (of
which naming is just a single, and minor, even if annoying, issue). I hope
that one day we can start using code review for wx classes, especially ones
as important as this one.

 Regards,
VZ

_______________________________________________
wx-dev mailing list
[hidden email]
http://lists.wxwidgets.org/mailman/listinfo/wx-dev

attachment0 (194 bytes) Download Attachment
Loading...