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

List:       kde-commits
Subject:    Re: extragear/multimedia/amarok/src/scriptengine
From:       Leonardo Franchi <lfranchi () kde ! org>
Date:       2009-05-04 20:28:37
Message-ID: 200905042128.37529.lfranchi () kde ! org
[Download RAW message or body]

On Monday 04 May 2009 12:31:19 Dan Meltzer wrote:
> On Mon, May 4, 2009 at 4:35 AM, Leo Franchi <lfranchi@kde.org> wrote:
> > SVN commit 963223 by lfranchi:
> >
> > +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....


I thought about this, but my reasoning was as such:

1) Script authors don't care about uidUrl. it's something like 
sqltrack:/<md5sum>, so really not useful at all. 
2) In normal usage the "url" of a track is the location on disk or the 
playable url, so that is the expected outcome


we could change it to playableUrl, but that could confuse authors as they 
would then think "so is there another url() that returns a different url?" 
which is confusing.

leo

> > +}
> > +
> >  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 );

-----
lfranchi@kde.org		Tufts  University 2010
leonardo.franchi@tufts.edu                 The KDE Project
[prev in list] [next in list] [prev in thread] [next in thread] 

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