mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-07-31 19:30:21 +02:00
TWK-414: Fix selecting newly created playlists and stations.
God this was a PITA. What is going on: Playlists are created by collection item. SourcesModel::linkSourceItemToPage is called from *constructor* of PlaylistItem, so BEFORE the CollectionItem calls endRowsAdded(). This means when the SourcesProxyModel does the mapFromSource() during the activateIndex() call (from linkSourceItemToPage) it won't have the new index in the mapping yet as endRowsAdded() hasn't been called. So that will fail. We have to queue the signal *from the source model to the proxy* not from the proxy to the view. EUGH. Also, fix a few logic errors from teh ViewManager/WeakPointer refactor that had bad logic
This commit is contained in:
@@ -174,7 +174,7 @@ ViewManager::show( const Tomahawk::playlist_ptr& playlist )
|
||||
{
|
||||
PlaylistView* view;
|
||||
|
||||
if ( !m_playlistViews.contains( playlist ) || !m_playlistViews.value( playlist ).isNull() )
|
||||
if ( !m_playlistViews.contains( playlist ) || m_playlistViews.value( playlist ).isNull() )
|
||||
{
|
||||
view = createPageForPlaylist( playlist );
|
||||
}
|
||||
@@ -747,11 +747,11 @@ ViewManager::onWidgetDestroyed( QWidget* widget )
|
||||
{
|
||||
ViewPage* page = m_pageHistory.at( i );
|
||||
|
||||
if ( !playlistForInterface( page->playlistInterface() ).isNull() )
|
||||
if ( playlistForInterface( page->playlistInterface() ).isNull() )
|
||||
{
|
||||
m_playlistViews.remove( playlistForInterface( page->playlistInterface() ) );
|
||||
}
|
||||
if ( !dynamicPlaylistForInterface( page->playlistInterface() ).isNull() )
|
||||
if ( dynamicPlaylistForInterface( page->playlistInterface() ).isNull() )
|
||||
{
|
||||
m_dynamicWidgets.remove( dynamicPlaylistForInterface( page->playlistInterface() ) );
|
||||
}
|
||||
|
Reference in New Issue
Block a user