Best way to generate The tagdialog lists for completion?

Dan Meltzer parallelgrapefruit at gmail.com
Fri Feb 29 23:19:40 CET 2008


I decided to dig into porting away from collectiondb again.

I'm working on tagdialog now, and am trying to port the CollectionDB
calls to get lists of artists/albums/genre's/composers.

I'm not sure about the most efficient way to get this data.  I can see
two ways of going about it:

1) get a list of albumpointers, a list of artistpointers, a list of
genrepointers, and a list of composerpointers from the collection.
Iterate over each list separatly and insert the names.

2) Use Data Pointers instead.  Use one loop through each set of
results, and try to dynamic_cast<> each item to
artist,album,genre,composer.  If It casts then insert it in the list
of strings for each.

I know dynamic_cast is slow, but is it slower than multiple loops? Or
would solution one be quicker?

Dan,


More information about the Amarok-devel mailing list