1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-05 05:37:29 +02:00

* Add 'Copy Artist/Album Link' context menu items.

This commit is contained in:
Christian Muehlhaeuser
2012-06-30 23:35:04 +02:00
parent becb263635
commit afb624f8eb

View File

@@ -151,8 +151,8 @@ ContextMenu::setAlbums( const QList<Tomahawk::album_ptr>& albums )
addSeparator(); addSeparator();
/* if ( m_supportedActions & ActionCopyLink && itemCount() == 1 ) if ( m_supportedActions & ActionCopyLink && itemCount() == 1 )
m_sigmap->setMapping( addAction( tr( "Copy Album &Link" ) ), ActionCopyLink ); */ m_sigmap->setMapping( addAction( tr( "Copy Album &Link" ) ), ActionCopyLink );
foreach ( QAction* action, actions() ) foreach ( QAction* action, actions() )
{ {
@@ -193,8 +193,8 @@ ContextMenu::setArtists( const QList<Tomahawk::artist_ptr>& artists )
addSeparator(); addSeparator();
/* if ( m_supportedActions & ActionCopyLink && itemCount() == 1 ) if ( m_supportedActions & ActionCopyLink && itemCount() == 1 )
m_sigmap->setMapping( addAction( tr( "Copy Artist &Link" ) ), ActionCopyLink ); */ m_sigmap->setMapping( addAction( tr( "Copy Artist &Link" ) ), ActionCopyLink );
foreach ( QAction* action, actions() ) foreach ( QAction* action, actions() )
{ {
@@ -274,6 +274,14 @@ ContextMenu::copyLink()
{ {
GlobalActionManager::instance()->copyToClipboard( m_queries.first() ); GlobalActionManager::instance()->copyToClipboard( m_queries.first() );
} }
else if ( m_albums.count() )
{
GlobalActionManager::instance()->copyOpenLink( m_albums.first() );
}
else if ( m_artists.count() )
{
GlobalActionManager::instance()->copyOpenLink( m_artists.first() );
}
} }