diff --git a/src/AudioControls.cpp b/src/AudioControls.cpp index 53542edaf..7c6fd14aa 100644 --- a/src/AudioControls.cpp +++ b/src/AudioControls.cpp @@ -263,7 +263,7 @@ AudioControls::onPlaybackLoading( const Tomahawk::result_ptr& result ) ui->ownerButton->setToolTip( QString( tr( "Playing from %1" ) ).arg( result->friendlySource() ) ); QPixmap sourceIcon = result->sourceIcon().scaled( ui->ownerButton->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation); ui->ownerButton->setPixmap( sourceIcon ); - if ( QUrl( result->purchaseUrl() ).isValid() || !result->collection().isNull() ) + if ( QUrl( result->linkUrl() ).isValid() || !result->collection().isNull() ) ui->ownerButton->setCursor( Qt::PointingHandCursor ); else ui->ownerButton->setCursor( Qt::ArrowCursor ); @@ -390,15 +390,15 @@ void AudioControls::onPlaybackTimer( qint64 msElapsed ) { //tDebug() << Q_FUNC_INFO; - + m_phononTickCheckTimer.stop(); - + if ( m_currentTrack.isNull() ) { m_sliderTimeLine.stop(); return; } - + const int seconds = msElapsed / 1000; if ( seconds != m_lastTextSecondShown ) { @@ -414,7 +414,7 @@ AudioControls::onPlaybackTimer( qint64 msElapsed ) int currentTime = m_sliderTimeLine.currentTime(); //tDebug( LOGEXTRA ) << Q_FUNC_INFO << "msElapsed =" << msElapsed << "and timer current time =" << m_sliderTimeLine.currentTime(); - + // First condition checks for the common case where // 1) the track has been started // 2) we haven't seeked, @@ -675,7 +675,7 @@ AudioControls::onOwnerButtonClicked() { if ( m_currentTrack->collection().isNull() ) { - QUrl url = QUrl( m_currentTrack->purchaseUrl() ); + QUrl url = QUrl( m_currentTrack->linkUrl() ); if ( url.isValid() ) QDesktopServices::openUrl( url ); } diff --git a/src/libtomahawk/Result.h b/src/libtomahawk/Result.h index c196a05f3..38a47eac4 100644 --- a/src/libtomahawk/Result.h +++ b/src/libtomahawk/Result.h @@ -74,6 +74,7 @@ public: QString friendlySource() const; QPixmap sourceIcon() const; QString purchaseUrl() const { return m_purchaseUrl; } + QString linkUrl() const { return m_linkUrl; } unsigned int duration() const { return m_duration; } unsigned int bitrate() const { return m_bitrate; } @@ -90,6 +91,7 @@ public: void setCollection( const Tomahawk::collection_ptr& collection ); void setFriendlySource( const QString& s ) { m_friendlySource = s; } void setPurchaseUrl( const QString& u ) { m_purchaseUrl = u; } + void setLinkUrl( const QString& u ) { m_linkUrl = u; } void setArtist( const Tomahawk::artist_ptr& artist ); void setAlbum( const Tomahawk::album_ptr& album ); void setComposer( const Tomahawk::artist_ptr& composer ); @@ -143,6 +145,7 @@ private: QString m_track; QString m_url; QString m_purchaseUrl; + QString m_linkUrl; QString m_mimetype; QString m_friendlySource; diff --git a/src/libtomahawk/resolvers/QtScriptResolver.cpp b/src/libtomahawk/resolvers/QtScriptResolver.cpp index cea977454..081b8efc3 100644 --- a/src/libtomahawk/resolvers/QtScriptResolver.cpp +++ b/src/libtomahawk/resolvers/QtScriptResolver.cpp @@ -434,6 +434,7 @@ QtScriptResolver::parseResultVariantList( const QVariantList& reslist ) rp->setFriendlySource( name() ); rp->setSourceIcon( new QPixmap( icon() ) ); rp->setPurchaseUrl( m.value( "purchaseUrl" ).toString() ); + rp->setLinkUrl( m.value( "linkUrl" ).toString() ); rp->setScore( m.value( "score" ).toFloat() ); rp->setDiscNumber( m.value( "discnumber" ).toUInt() ); diff --git a/src/libtomahawk/resolvers/ScriptResolver.cpp b/src/libtomahawk/resolvers/ScriptResolver.cpp index 82df88664..88e6573a1 100644 --- a/src/libtomahawk/resolvers/ScriptResolver.cpp +++ b/src/libtomahawk/resolvers/ScriptResolver.cpp @@ -284,6 +284,7 @@ ScriptResolver::handleMsg( const QByteArray& msg ) rp->setFriendlySource( m_name ); rp->setSourceIcon( new QPixmap( m_icon ) ); rp->setPurchaseUrl( m.value( "purchaseUrl" ).toString() ); + rp->setLinkUrl( m.value( "linkUrl" ).toString() ); rp->setYear( m.value( "year").toUInt() ); rp->setDiscNumber( m.value( "discnumber" ).toUInt() );