[Installit-dev] TreeView/TreeModel implementation

Jannis Pohlmann info at sten-net.de
Wed Oct 5 12:47:02 CEST 2005


>>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...

I thought about counters for a while and I finally think we should not
use them. The reason is, and it's very obvious, that we would run into
lots of new troubles. For example, if you disable a package (from a
category) which is a member of an enabled group, the package shouldn't
be disabled (we would have to raise an error dialog, here).

If you run into too much complications with a concept, it's likely that
the whole concept is, well, shit. And that's what we have here.

I will drop what we currently know as "groups" in favor of something
widely known as "meta package". A meta package is a package without
header file. Instead of "group members" it has a list of packages it
depends on. Of course, meta packages also belong into categories. This
means:

  - If you select (enable) a meta package, all of its dependencies are
    selected.
  - If you deselect (disable) a meta package, only the meta package is
    deselected - the dependencies aren't.
  - Selecting/deselecting a package which is in the dependency list of a
    meta package doesn't affect the meta-package.

Having said this, our tree structure just looks like this:

  File Management
      Thunar 1.0
      Xffm 4.3.4
  Desktop Environments
      Xfce 4.2.2 [Meta]
      Xfce 4.2.3 [Meta]
  Xfce Libraries
      libxfce4util 4.2.2
      libxfce4util 4.2.3
      libxfcegui4 4.2.2
      libxfcegui4 4.2.3
      libexo 1.0
      libtubo 1.0

What means, that we just have categories and packages. We only have to
check the dependencies of each package recursively when selecting a
package. If the user deselects a package, we could of course ask him
whether he wants to deselect all its dependencies or not.

I think this is lots easier to implement.

Regards,
Jannis



More information about the Installit-dev mailing list