Amarok ... was Re: Junior Jobs

Bart Cerneels bart.cerneels at kde.org
Wed Oct 13 09:19:07 CEST 2010


On Sun, Oct 10, 2010 at 19:50, Chinmaya Padhi <padhi.chinmaya at gmail.com> wrote:
> Hi ,
>
> I am working on this JJ,    185397        wis      NOR      Linu
> amarok-bugs-dist kde org      NEW            JJ: Saved playlist default name
> could be smarter
> In the SqlPlaylist:: savetoDb(bool tracks)
>
> I have added the below code to check for unique playlist names but every
> time i run this query , the value.IsEmpty is always zero. I dont understand
> what is wrong with the code .
>
> SqlStorage *sql = CollectionManager::instance()->sqlStorage();
>     QString sqlQuery = "SELECT playlist_id from playlists WHERE name='%1'";
>         sqlQuery = sqlQuery.arg( sql->escape( m_name ) );
>     QStringList value = sql->query( sqlQuery );
>     if ( !value.isEmpty() )
>        m_name = m_name + KGlobal::locale()->formatDateTime(
> QDateTime::currentDateTime(), KLocale::LongDate, true );
>
> ~Chinmaya

Hey Chinmaya

I think you might be taking the wrong approach to this feature.
The name of the saved playlist is determined in
Playlist::Dock::slotSaveCurrentPlaylist() (or PlaylistManager::save()
but it's deprecated). I propose you implement the logic to determine
the name there so it will work for all providers that can save
playlists. Your current code will only work for playlists saved to the
database; it would be very nice if the intelligent playlist naming
would also work when saving to iPod for instance.

Bart


More information about the Amarok-devel mailing list