mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-03-24 09:49:42 +01:00
crash fix and only show spotify sync context menu for local playlists
This commit is contained in:
parent
03c57d3a0f
commit
3cb079b014
src
@ -172,7 +172,6 @@ SpotifyAccount::syncActionTriggered( bool checked )
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
stopPlaylistSync( info, true );
|
||||
}
|
||||
}
|
||||
|
@ -144,11 +144,10 @@ SourceTreeView::setupMenus()
|
||||
bool readonly = true;
|
||||
SourcesModel::RowType type = ( SourcesModel::RowType )model()->data( m_contextMenuIndex, SourcesModel::SourceTreeItemTypeRole ).toInt();
|
||||
|
||||
const PlaylistItem* item = itemFromIndex< PlaylistItem >( m_contextMenuIndex );
|
||||
const playlist_ptr playlist = item->playlist();
|
||||
|
||||
if ( type == SourcesModel::StaticPlaylist || type == SourcesModel::AutomaticPlaylist || type == SourcesModel::Station )
|
||||
{
|
||||
const PlaylistItem* item = itemFromIndex< PlaylistItem >( m_contextMenuIndex );
|
||||
const playlist_ptr playlist = item->playlist();
|
||||
|
||||
if ( !playlist.isNull() )
|
||||
{
|
||||
@ -206,10 +205,14 @@ SourceTreeView::setupMenus()
|
||||
addToLocalAction->setEnabled( readonly );
|
||||
|
||||
// Handle any custom actions registered for playlists
|
||||
if ( !ActionCollection::instance()->getAction( ActionCollection::LocalPlaylists ).isEmpty() )
|
||||
if ( type == SourcesModel::StaticPlaylist && !readonly &&
|
||||
!ActionCollection::instance()->getAction( ActionCollection::LocalPlaylists ).isEmpty() )
|
||||
{
|
||||
m_playlistMenu.addSeparator();
|
||||
|
||||
|
||||
const PlaylistItem* item = itemFromIndex< PlaylistItem >( m_contextMenuIndex );
|
||||
const playlist_ptr playlist = item->playlist();
|
||||
foreach ( QAction* action, ActionCollection::instance()->getAction( ActionCollection::LocalPlaylists ) )
|
||||
{
|
||||
if ( QObject* notifier = ActionCollection::instance()->actionNotifier( action ) )
|
||||
|
Loading…
x
Reference in New Issue
Block a user