mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-06 22:26:32 +02:00
crash fix and only show spotify sync context menu for local playlists
This commit is contained in:
@@ -172,7 +172,6 @@ SpotifyAccount::syncActionTriggered( bool checked )
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
stopPlaylistSync( info, true );
|
stopPlaylistSync( info, true );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -144,11 +144,10 @@ SourceTreeView::setupMenus()
|
|||||||
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();
|
||||||
|
|
||||||
const PlaylistItem* item = itemFromIndex< PlaylistItem >( m_contextMenuIndex );
|
|
||||||
const playlist_ptr playlist = item->playlist();
|
|
||||||
|
|
||||||
if ( type == SourcesModel::StaticPlaylist || type == SourcesModel::AutomaticPlaylist || type == SourcesModel::Station )
|
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() )
|
if ( !playlist.isNull() )
|
||||||
{
|
{
|
||||||
@@ -206,10 +205,14 @@ SourceTreeView::setupMenus()
|
|||||||
addToLocalAction->setEnabled( readonly );
|
addToLocalAction->setEnabled( readonly );
|
||||||
|
|
||||||
// Handle any custom actions registered for playlists
|
// 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();
|
m_playlistMenu.addSeparator();
|
||||||
|
|
||||||
|
|
||||||
|
const PlaylistItem* item = itemFromIndex< PlaylistItem >( m_contextMenuIndex );
|
||||||
|
const playlist_ptr playlist = item->playlist();
|
||||||
foreach ( QAction* action, ActionCollection::instance()->getAction( ActionCollection::LocalPlaylists ) )
|
foreach ( QAction* action, ActionCollection::instance()->getAction( ActionCollection::LocalPlaylists ) )
|
||||||
{
|
{
|
||||||
if ( QObject* notifier = ActionCollection::instance()->actionNotifier( action ) )
|
if ( QObject* notifier = ActionCollection::instance()->actionNotifier( action ) )
|
||||||
|
Reference in New Issue
Block a user