KDE/kdevplatform/debugger/variable

Vladimir Prus ghost at cs.msu.su
Wed Oct 14 14:41:08 UTC 2009


On Wednesday 14 October 2009 Niko Sams wrote:

> On Tue, Oct 13, 2009 at 22:27, Vladimir Prus <ghost at cs.msu.su> wrote:
> > On Sunday 11 October 2009 Niko Sams wrote:
> >
> >> SVN commit 1033903 by nsams:
> >>
> >> Make methods public to modify children from outside.
> >> (Needed in xdebug plugin)
> >>
> >>  M  +5 -1      variablecollection.h
> >>
> >>
> >> --- trunk/KDE/kdevplatform/debugger/variable/variablecollection.h #1033902:1033903
> >> @@ -140,8 +140,12 @@
> >>      Locals(TreeModel* model, TreeItem* parent);
> >>      void updateLocals(QStringList locals);
> >>
> >> +    using TreeItem::setHasMore;
> >> +    using TreeItem::child;
> >> +    using TreeItem::childCount;
> >> +    using TreeItem::appendChild;
> >> +    using TreeItem::removeChild;
> >>      using TreeItem::deleteChildren;
> >> -    using TreeItem::setHasMore;
> >
> > Why is this actually needed? Why can't xdebug plugin derive from the Variable class?
> I added this to Locals only.
> Because I can't use updateLocals - as I get more information from the
> debugger (like
> values and children) for the locals.

Can you clarify this part? Are you fetching things more incrementally?
Or, can you point me at whatever implementation for xdebug you have,
so that I can take a look.

> Another option would be to make updateLocals more flexible.
> 
> What's so bad about making it public?

In general, I prefer interfaces to be as close as possible. Allowing
random third parties to add children open a door to all kind of abuse.

> Imho making those methods public in TreeItem would make things easier. Is there
> any disadvantage?

There's also technical disadvantage that some of those methods have funny
interaction with the implicit "ellipsis" item.

- Volodya




More information about the KDevelop-devel mailing list