Changeset View
Changeset View
Standalone View
Standalone View
src/playlistmanager/PlaylistManager.cpp
Show First 20 Lines • Show All 228 Lines • ▼ Show 20 Line(s) | 226 | { | |||
---|---|---|---|---|---|
229 | 229 | | |||
230 | removePlaylist( playlist, provider->category() ); | 230 | removePlaylist( playlist, provider->category() ); | ||
231 | } | 231 | } | ||
232 | } | 232 | } | ||
233 | 233 | | |||
234 | void | 234 | void | ||
235 | PlaylistManager::removePlaylist( Playlists::PlaylistPtr playlist, int category ) | 235 | PlaylistManager::removePlaylist( Playlists::PlaylistPtr playlist, int category ) | ||
236 | { | 236 | { | ||
237 | if( typeid( *playlist.data() ) == typeid( SyncedPlaylist ) ) | 237 | if( auto syncedPlaylist = SyncedPlaylistPtr::dynamicCast( playlist ) ) | ||
238 | { | 238 | { | ||
239 | SyncedPlaylistPtr syncedPlaylist = SyncedPlaylistPtr::dynamicCast( playlist ); | | |||
240 | //TODO: this might be wrong if there were multiple playlists from the same provider. | 239 | //TODO: this might be wrong if there were multiple playlists from the same provider. | ||
241 | //remove the specific child playlist, not all from same provider. | 240 | //remove the specific child playlist, not all from same provider. | ||
242 | syncedPlaylist->removePlaylistsFrom( playlist->provider() ); | 241 | syncedPlaylist->removePlaylistsFrom( playlist->provider() ); | ||
243 | if( syncedPlaylist->isEmpty() ) | 242 | if( syncedPlaylist->isEmpty() ) | ||
244 | m_playlistMap.remove( category, playlist ); | 243 | m_playlistMap.remove( category, playlist ); | ||
245 | 244 | | |||
246 | m_syncNeeded.removeAll( syncedPlaylist ); | 245 | m_syncNeeded.removeAll( syncedPlaylist ); | ||
247 | } | 246 | } | ||
▲ Show 20 Lines • Show All 285 Lines • Show Last 20 Lines |