1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-07-31 11:20:22 +02:00

* Fixed crashing after a right-click on the Super Collection.

This commit is contained in:
Christian Muehlhaeuser
2011-07-04 02:42:42 +02:00
parent 15cdc8f910
commit 5e9fa24008

View File

@@ -127,7 +127,7 @@ SourceTreeView::setupMenus()
m_playlistMenu.clear(); m_playlistMenu.clear();
m_roPlaylistMenu.clear(); m_roPlaylistMenu.clear();
m_latchMenu.clear(); m_latchMenu.clear();
bool readonly = true; bool readonly = true;
SourcesModel::RowType type = ( SourcesModel::RowType )model()->data( m_contextMenuIndex, SourcesModel::SourceTreeItemTypeRole ).toInt(); SourcesModel::RowType type = ( SourcesModel::RowType )model()->data( m_contextMenuIndex, SourcesModel::SourceTreeItemTypeRole ).toInt();
if ( type == SourcesModel::StaticPlaylist || type == SourcesModel::AutomaticPlaylist || type == SourcesModel::Station ) if ( type == SourcesModel::StaticPlaylist || type == SourcesModel::AutomaticPlaylist || type == SourcesModel::Station )
@@ -345,7 +345,7 @@ SourceTreeView::latchOn()
CollectionItem* item = itemFromIndex< CollectionItem >( m_contextMenuIndex ); CollectionItem* item = itemFromIndex< CollectionItem >( m_contextMenuIndex );
source_ptr source = item->source(); source_ptr source = item->source();
PlaylistInterface* pi = AudioEngine::instance()->playlist(); PlaylistInterface* pi = AudioEngine::instance()->playlist();
if ( pi && dynamic_cast< SourcePlaylistInterface* >( pi ) ) if ( pi && dynamic_cast< SourcePlaylistInterface* >( pi ) )
{ {
SourcePlaylistInterface* sourcepi = dynamic_cast< SourcePlaylistInterface* >( pi ); SourcePlaylistInterface* sourcepi = dynamic_cast< SourcePlaylistInterface* >( pi );
@@ -414,7 +414,7 @@ SourceTreeView::onCustomContextMenu( const QPoint& pos )
else if ( model()->data( m_contextMenuIndex, SourcesModel::SourceTreeItemTypeRole ) == SourcesModel::Collection ) else if ( model()->data( m_contextMenuIndex, SourcesModel::SourceTreeItemTypeRole ) == SourcesModel::Collection )
{ {
CollectionItem* item = itemFromIndex< CollectionItem >( m_contextMenuIndex ); CollectionItem* item = itemFromIndex< CollectionItem >( m_contextMenuIndex );
if ( !item->source()->isLocal() ) if ( !item->source().isNull() && !item->source()->isLocal() )
m_latchMenu.exec( mapToGlobal( pos ) ); m_latchMenu.exec( mapToGlobal( pos ) );
} }
} }