Amarok.Playist.addMediaList from QtScript

Mark Kretschmann kretschmann at kde.org
Sat May 30 13:15:52 CEST 2009


On Sat, May 30, 2009 at 12:25 PM, Michael Liddle <mike at liddle.net.nz> wrote:
> Hi there,
>
> I'm trying to use the aforementioned method but am having no luck. From
> the script, despite trying to catch an error nothing results (i.e.
> nothing is added to the playlist). When I run similar code in the script
> console I get the error:
>
> "TypeError: cannot call addMediaList(): argument 1 has unknown type
> `QList<QUrl>' (register the type with qScriptRegisterMetaType())"
>
> But I'm not able to work out what to do...
>
> I am able to add the same urls one by one (with
> Amarok.Playist.addMedia). What am I missing here?

Ok, I've just added one line in AmarokPlaylistScript.cpp to register
the MetaType:

       qRegisterMetaType<QList<QUrl> >( "QList<QUrl>" );

Now I'm no longer getting the error about the unknown type. Could you
test if this fixes your problem? (You would have to build Amarok from
SVN though.)

-- 
Mark Kretschmann
Amarok Developer
www.kde.org - amarok.kde.org


More information about the Amarok-devel mailing list