void IpodPlaylistProvider::rename( Playlists::PlaylistPtr playlist, const QString &newName ) { if( !m_playlists.contains( playlist ) ) // make following static cast safe return; KSharedPtr<IpodPlaylist> ipodPlaylist = KSharedPtr<IpodPlaylist>::staticCast( playlist ); if( ipodPlaylist->type() != IpodPlaylist::Normal ) return; // special playlists cannot be renamed playlist->setName( newName ); emit updated(); emit startWriteDatabaseTimer(); }
QActionList IpodPlaylistProvider::trackActions( Playlists::PlaylistPtr playlist, int trackIndex ) { QList<QAction *> actions; if( !m_playlists.contains( playlist ) ) // make following static cast safe return actions; KSharedPtr<IpodPlaylist> ipodPlaylist = KSharedPtr<IpodPlaylist>::staticCast( playlist ); switch( ipodPlaylist->type() ) { case IpodPlaylist::Normal: actions << Playlists::UserPlaylistProvider::trackActions( playlist, trackIndex ); break; case IpodPlaylist::Stale: case IpodPlaylist::Orphaned: actions << m_coll->m_consolidateAction; break; } return actions; }