[Installit-dev] TreeView/TreeModel implementation

Jannis Pohlmann info at sten-net.de
Wed Oct 5 09:41:28 CEST 2005


Tuukka Mäkinen schrieb:
> Jannis Pohlmann wrote:
> 
>>Hi all,
>>
>>I wrote down some thoughts on the TreeModel/TreeView implementation we
>>will use for InstallIt on
>>http://dev.sten-net.de/2005/10/03/user-interface-complications/. You
>>don't have to visit the site because here is the content:
>>
> 
> ----- clip Lot of good stuff removed ----------
> 
>>This surely will cause some overhead and won’t solve every problem but
>>it’s a good starting point, I think. Any comments on this?
> 
> 
> I have no idea how to best implement such tree structure with categories 
> and groups so forgive me if my understanding and then what I write below 
> is completely wrong.
> 
> In the way to describe, if you unselect a group do you have to go 
> through all packages belonging to that group and see if it is still 
> enabled by some other group or explicit selection? Doesn't sound bad 
> unless groups can overlap. What I started thinking was counters. Add 
> selection counter to all packages so that you increase the counter when 
> the package is selected directly or indirectly and decrease it when it's 
> unselected. Anybody getting reminded of magic pointers or garbage 
> collection...

Correct, to prevent problems with packages being part of more than one
group, we would have to do this when disabling a group or group member:

  1. Determine the group
  2. Disable the group itself explicitely and the members implicitely
  3. Iterate over all enabled groups and re-enable members which were
     disabled just a second ago

And, enabling a package (from a category) explicitely would require to
iterate over all groups, searching for this package in order to enable
its checkbox. Well, you see, trees are fuckin' terrible to manage.

Anyway, this counter idea sounds like a good point (and, of course, it
reminds me of reference counting pointers). I will think about this. At
the moment I'm very busy with other stuff apart from InstallIt.

Thanks for the input again,
Jannis



More information about the Installit-dev mailing list