From e53e51aefc1e24baac1d4550b093f2ce2e2cc2c3 Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Sat, 30 Jun 2012 23:35:04 +0200 Subject: [PATCH] * Add 'Copy Artist/Album Link' context menu items. --- src/libtomahawk/ContextMenu.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/libtomahawk/ContextMenu.cpp b/src/libtomahawk/ContextMenu.cpp index faaac4bbe..9f226450a 100644 --- a/src/libtomahawk/ContextMenu.cpp +++ b/src/libtomahawk/ContextMenu.cpp @@ -151,8 +151,8 @@ ContextMenu::setAlbums( const QList& albums ) addSeparator(); -/* if ( m_supportedActions & ActionCopyLink && itemCount() == 1 ) - m_sigmap->setMapping( addAction( tr( "Copy Album &Link" ) ), ActionCopyLink ); */ + if ( m_supportedActions & ActionCopyLink && itemCount() == 1 ) + m_sigmap->setMapping( addAction( tr( "Copy Album &Link" ) ), ActionCopyLink ); foreach ( QAction* action, actions() ) { @@ -193,8 +193,8 @@ ContextMenu::setArtists( const QList& artists ) addSeparator(); -/* if ( m_supportedActions & ActionCopyLink && itemCount() == 1 ) - m_sigmap->setMapping( addAction( tr( "Copy Artist &Link" ) ), ActionCopyLink ); */ + if ( m_supportedActions & ActionCopyLink && itemCount() == 1 ) + m_sigmap->setMapping( addAction( tr( "Copy Artist &Link" ) ), ActionCopyLink ); foreach ( QAction* action, actions() ) { @@ -274,6 +274,14 @@ ContextMenu::copyLink() { 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() ); + } }