1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-06 22:26:32 +02:00

Remove duplicate function, and fix copy link from sidebar track page

This commit is contained in:
Leo Franchi
2012-06-17 16:51:56 +02:00
parent a8f0053fc8
commit 1fe28714cb
3 changed files with 4 additions and 16 deletions

View File

@@ -97,20 +97,6 @@ GlobalActionManager::openLinkFromQuery( const query_ptr& query ) const
} }
QUrl
GlobalActionManager::copyOpenLink( const query_ptr& query ) const
{
const QUrl link = openLinkFromQuery( query );
QClipboard* cb = QApplication::clipboard();
QByteArray data = link.toEncoded();
data.replace( "'", "%27" ); // QUrl doesn't encode ', which it doesn't have to. Some apps don't like ' though, and want %27. Both are valid.
cb->setText( data );
return link;
}
QUrl QUrl
GlobalActionManager::copyOpenLink( const artist_ptr& artist ) const GlobalActionManager::copyOpenLink( const artist_ptr& artist ) const
{ {

View File

@@ -46,7 +46,6 @@ public:
QUrl copyOpenLink( const Tomahawk::artist_ptr& artist ) const; QUrl copyOpenLink( const Tomahawk::artist_ptr& artist ) const;
QUrl copyOpenLink( const Tomahawk::album_ptr& album ) const; QUrl copyOpenLink( const Tomahawk::album_ptr& album ) const;
QUrl copyOpenLink( const Tomahawk::query_ptr& query ) const;
QUrl openLink( const QString& title, const QString& artist, const QString& album ) const; QUrl openLink( const QString& title, const QString& artist, const QString& album ) const;
@@ -61,7 +60,10 @@ public slots:
/// Takes a spotify link and performs the default open action on it /// Takes a spotify link and performs the default open action on it
bool openRdioLink( const QString& link ); bool openRdioLink( const QString& link );
/// Creates a link from the requested data and copies it to the clipboard
void copyToClipboard( const Tomahawk::query_ptr& query ); void copyToClipboard( const Tomahawk::query_ptr& query );
QString copyPlaylistToClipboard( const Tomahawk::dynplaylist_ptr& playlist ); QString copyPlaylistToClipboard( const Tomahawk::dynplaylist_ptr& playlist );
void savePlaylistToFile( const Tomahawk::playlist_ptr& playlist, const QString& filename ); void savePlaylistToFile( const Tomahawk::playlist_ptr& playlist, const QString& filename );

View File

@@ -165,7 +165,7 @@ TemporaryPageItem::linkActionTriggered( QAction* action )
{ {
TrackInfoWidget* tPage = dynamic_cast< TrackInfoWidget* >( m_page ); TrackInfoWidget* tPage = dynamic_cast< TrackInfoWidget* >( m_page );
Q_ASSERT( tPage ); Q_ASSERT( tPage );
GlobalActionManager::instance()->copyOpenLink( tPage->query() ); GlobalActionManager::instance()->copyToClipboard( tPage->query() );
break; break;
} }