[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    Re: extragear/multimedia/amarok/src/scriptengine
From:       Dan Meltzer <parallelgrapefruit () gmail ! com>
Date:       2009-05-04 11:31:19
Message-ID: 46059ce10905040431s4f7bf371l45acc535e317cc53 () mail ! gmail ! com
[Download RAW message or body]

On Mon, May 4, 2009 at 4:35 AM, Leo Franchi <lfranchi@kde.org> wrote:
> SVN commit 963223 by lfranchi:
>
> add track.url() function to the scripting API, so scripts can properly
> use the setLyricsForTrack function which already exists (although it
> doesn't work yet)
>
>  M  +7 -0      MetaTypeExporter.cpp
>  M  +2 -0      MetaTypeExporter.h
>
>
> --- trunk/extragear/multimedia/amarok/src/scriptengine/MetaTypeExporter.cpp #963222:963223
> @@ -186,6 +186,13 @@
>     return ( track && track->album() ) ? track->album()->imageLocation().prettyUrl() : QString();
>  }
>
> +QString
> +MetaTrackPrototype::url() const
> +{
> +    GET_TRACK
> +    return track ? track->playableUrl().url() : QString();

You should either name the method playableUrl(), or, based on what its
used for, name it uidUrl() and use that instead. (TrackForUrl works
best with uidUrls, I think..)

Api differences between the scripts and the standard c++ code is going
to lead to headaches, especially with something like url(), where
there are 30 different options....
> +}
> +
>  QScriptValue
>  MetaTrackPrototype::imagePixmap( int size ) const
>  {
> --- trunk/extragear/multimedia/amarok/src/scriptengine/MetaTypeExporter.h #963222:963223
> @@ -52,6 +52,7 @@
>     Q_PROPERTY( bool isEditable READ isEditable )
>     Q_PROPERTY( QString lyrics WRITE setLyrics READ lyrics )
>     Q_PROPERTY( QString imageUrl WRITE setImageUrl READ imageUrl )
> +    Q_PROPERTY( QString url READ url )
>
>     public:
>         MetaTrackPrototype();
> @@ -85,6 +86,7 @@
>         QString lyrics() const;
>         QString title() const;
>         QString imageUrl() const;
> +        QString url() const;
>
>         void setScore( double score );
>         void setRating( int rating );
>

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic