Best way to generate The tagdialog lists for completion?
Maximilian Kossick
maximilian.kossick at googlemail.com
Fri Feb 29 23:32:05 CET 2008
On Fri, Feb 29, 2008 at 11:19 PM, Dan Meltzer
<parallelgrapefruit at gmail.com> wrote:
> 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.
>
3) Don't bother with all of that and just get QStringLists from the
local collection. We are only operating with Strings
in the tagdialog, so we don't need the actual Artists/Genre/whatever
objects. Any advanced use of Meta obejcts (like passing an Artist
object to a Track object to set the artist name) is going to be very
difficult because you might be working with objects from different
collections. Add a few methods to CollectionManager to get the
QStringLists, we can still change the implementations of those methods
later on
More information about the Amarok-devel
mailing list