mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-04-04 16:12:24 +02:00
Generate toma.hk urls instead of tomahawk://, so they can be shortened
This commit is contained in:
parent
419a0c806f
commit
5cfbcae95e
@ -78,9 +78,9 @@ GlobalActionManager::openLinkFromQuery( const Tomahawk::query_ptr& query ) const
|
||||
}
|
||||
|
||||
QUrl
|
||||
GlobalActionManager::openLink( const QString& title, const QString& artist, const QString& album, bool tomahk ) const
|
||||
GlobalActionManager::openLink( const QString& title, const QString& artist, const QString& album ) const
|
||||
{
|
||||
QUrl link( tomahk ? "http://toma.hk/open/track/" : "tomahawk://open/track/" );
|
||||
QUrl link( QString( "%1/open/track/" ).arg( hostname() ) );
|
||||
|
||||
if( !title.isEmpty() )
|
||||
link.addQueryItem( "title", title );
|
||||
@ -95,7 +95,7 @@ GlobalActionManager::openLink( const QString& title, const QString& artist, cons
|
||||
QString
|
||||
GlobalActionManager::copyPlaylistToClipboard( const Tomahawk::dynplaylist_ptr& playlist )
|
||||
{
|
||||
QUrl link( QString( "tomahawk://%1/create/" ).arg( playlist->mode() == Tomahawk::OnDemand ? "station" : "autoplaylist" ) );
|
||||
QUrl link( QString( "%1/%2/create/" ).arg( hostname() ).arg( playlist->mode() == Tomahawk::OnDemand ? "station" : "autoplaylist" ) );
|
||||
|
||||
if( playlist->generator()->type() != "echonest" ) {
|
||||
qDebug() << "Only echonest generators are supported";
|
||||
@ -676,4 +676,8 @@ GlobalActionManager::waitingForResolved( bool success )
|
||||
m_waitingToPlay.clear();
|
||||
}
|
||||
|
||||
|
||||
QString
|
||||
GlobalActionManager::hostname() const
|
||||
{
|
||||
return QString( "http://toma.hk" );
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ public:
|
||||
virtual ~GlobalActionManager();
|
||||
|
||||
QUrl openLinkFromQuery( const Tomahawk::query_ptr& query ) const;
|
||||
QUrl openLink( const QString& title, const QString& artist, const QString& album, bool tomahk=false ) const;
|
||||
QUrl openLink( const QString& title, const QString& artist, const QString& album ) const;
|
||||
|
||||
void copyToClipboard( const Tomahawk::query_ptr& query ) const;
|
||||
QString copyPlaylistToClipboard( const Tomahawk::dynplaylist_ptr& playlist );
|
||||
@ -68,6 +68,7 @@ private:
|
||||
bool handleOpenCommand(const QUrl& url );
|
||||
|
||||
bool doQueueAdd( const QStringList& parts, const QList< QPair< QString, QString > >& queryItems );
|
||||
QString hostname() const;
|
||||
|
||||
Tomahawk::playlist_ptr m_toShow;
|
||||
Tomahawk::query_ptr m_waitingToBookmark;
|
||||
|
@ -78,7 +78,7 @@ TrackView::TrackView( QWidget* parent )
|
||||
setFont( f );
|
||||
#endif
|
||||
|
||||
QAction* createLinkAction = new QAction( tr( "Copy track link" ), this );
|
||||
QAction* createLinkAction = new QAction( tr( "Copy Track Link" ), this );
|
||||
connect( createLinkAction, SIGNAL( triggered( bool ) ), this, SLOT( copyLink() ) );
|
||||
addAction( createLinkAction );
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user