[Aptitude-devel] Experimental package and package_pool implementation

Piotr Galiszewski piotr at galiszewski.pl
Wed Jul 14 16:34:37 UTC 2010


Resending, because aptitude list was missed

2010/7/14 Daniel Burrows <dburrows at google.com>:
> On Tue, Jul 13, 2010 at 4:46 PM, Piotr Galiszewski <piotr at galiszewski.pl> wrote:
>> 2010/7/14 Daniel Burrows <dburrows at google.com>:
>>>  Also, I meant to ask this before but forgot: what is the purpose of
>>> get_package_count and get_package_at_index?  Wouldn't it make
>>> more sense to retrieve packages by PkgIterator?
>>>
>>
>> Both methods are used directly by packages_model. They are the heart
>> of package_pool from other Qt classes perspective ;)
>
>  Huh, could you expand on that?  I was assuming that this was just a
> global cache of all the packages that anything used, but it sounds like it's
> doing more than that.  Are you storing these integers as indices into the
> package list, then?  Why not just store direct pointers to the packages?
>
>  Is there a version of packages_model that I could look at to see how this
> works?  The version in 004- doesn't access package_pool as far as I can
> see.
>

Indexes are not stored. Packages count is used to determine how much
rows should be added to view, packages_at_index is used to get
information about package that should be shown in given row. It is
simple and typical for model in Qt Model Architecture

Here is an example from previous posting (with aware_object but this
is only think which will change)
http://gitorious.org/aptitude/aptitude/commit/d7659aa1fc44ad3d6fdfc34705c68e4f89fbdbc0

>
>  Also, I just noticed that the casing of the GPL notice in package_pool.h
> seems to be a bit "interesting" :)
>
> // This program is distributed in the hope that it will be useful, but
> // WITHOUT ANY WARRANTY; without even the implied warranty of
> // MERCHANtabILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> // General Public License for more details.
>
>  I smell a global search and replace on "tab"...
>
Everything should be fixed now.

>  Daniel
>
--
Regards
Piotr Galiszewski



More information about the Aptitude-devel mailing list