mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-03-23 01:09:42 +01:00
Remove duplicate function, and fix copy link from sidebar track page
This commit is contained in:
parent
a8f0053fc8
commit
1fe28714cb
@ -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
|
||||
GlobalActionManager::copyOpenLink( const artist_ptr& artist ) const
|
||||
{
|
||||
|
@ -46,7 +46,6 @@ public:
|
||||
|
||||
QUrl copyOpenLink( const Tomahawk::artist_ptr& artist ) 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;
|
||||
|
||||
@ -61,7 +60,10 @@ public slots:
|
||||
/// Takes a spotify link and performs the default open action on it
|
||||
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 );
|
||||
|
||||
|
||||
QString copyPlaylistToClipboard( const Tomahawk::dynplaylist_ptr& playlist );
|
||||
void savePlaylistToFile( const Tomahawk::playlist_ptr& playlist, const QString& filename );
|
||||
|
||||
|
@ -165,7 +165,7 @@ TemporaryPageItem::linkActionTriggered( QAction* action )
|
||||
{
|
||||
TrackInfoWidget* tPage = dynamic_cast< TrackInfoWidget* >( m_page );
|
||||
Q_ASSERT( tPage );
|
||||
GlobalActionManager::instance()->copyOpenLink( tPage->query() );
|
||||
GlobalActionManager::instance()->copyToClipboard( tPage->query() );
|
||||
|
||||
break;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user