where do they collections declare that they are queryable?

Ian Monroe ian.monroe at gmail.com
Sun Jul 26 19:32:04 CEST 2009


On Sun, Jul 26, 2009 at 10:34 AM, Casey Link<unnamedrambler at gmail.com> wrote:
>> I see where being enabled or not gets set, I can't figure out where a
>> collection being queryable gets set.
>
> That's because it isn't explicitly set (like it is for service
> collections like Ampache), but rather determined on the fly in
> CollectionManager::slotNewCollection( Amarok::Collection* newCollection )
>
> Personally, I don't understand the MetaObject blackmagic it is doing..
> but the key line is:
> enumValue == -1 ? status = CollectionEnabled : status =
> (CollectionStatus) enumValue;
>
> For the SqlCollection enumValue always == -1, so it's status is set to
> CollectionEnabled.
>
> I don't there there exists a collection that ever makes it to the
> latter half of that trinary operation, and I wouldn't know how to make
> one. Ask Maxx!

Ok, just to conclude the thread I figured out what this bitrotted code
was doign. Basically slotNewCollection is only called for
SqlCollection, so the code looks like it sets Enabled to all
collections thats because it does. (Enabled, btw, doesn't mean the
user decided to enable it, it means the collection is 'visible' and
queryable).

On top of that, Magnatune isn't even in the Collection Manager. I
don't know why.

Leo said he did a refactor of this class some months ago, we might try
to revive this.

Ian


More information about the Amarok-devel mailing list