diff --git a/src/libtomahawk/utils/NetworkReply.cpp b/src/libtomahawk/utils/NetworkReply.cpp index f366ae80e..c30e81e43 100644 --- a/src/libtomahawk/utils/NetworkReply.cpp +++ b/src/libtomahawk/utils/NetworkReply.cpp @@ -107,6 +107,7 @@ NetworkReply::networkLoadFinished() if ( m_blacklistedHosts.contains( redir.toUrl().host() ) ) { tLog( LOGVERBOSE ) << Q_FUNC_INFO << "Reached blacklisted host, not redirecting anymore."; + emit finished( redir.toUrl() ); emit finished(); } else @@ -116,5 +117,6 @@ NetworkReply::networkLoadFinished() } } else + emit finished( m_url ); emit finished(); } diff --git a/src/libtomahawk/utils/NetworkReply.h b/src/libtomahawk/utils/NetworkReply.h index d22009b25..bc883febe 100644 --- a/src/libtomahawk/utils/NetworkReply.h +++ b/src/libtomahawk/utils/NetworkReply.h @@ -42,6 +42,7 @@ signals: void redirected(); void finished(); + void finished( const QUrl& finalUrl ); void error( QNetworkReply::NetworkError error ); private slots: diff --git a/src/libtomahawk/utils/ShortenedLinkParser.cpp b/src/libtomahawk/utils/ShortenedLinkParser.cpp index bf58cce5d..b3c3e4e56 100644 --- a/src/libtomahawk/utils/ShortenedLinkParser.cpp +++ b/src/libtomahawk/utils/ShortenedLinkParser.cpp @@ -86,7 +86,7 @@ ShortenedLinkParser::lookupUrl( const QString& url ) reply->blacklistHostFromRedirection( "www.deezer.com" ); reply->blacklistHostFromRedirection( "deezer.com" ); - connect( reply, SIGNAL( finished() ), SLOT( lookupFinished() ) ); + connect( reply, SIGNAL( finished( QUrl ) ), SLOT( lookupFinished( QUrl ) ) ); m_queries.insert( reply ); @@ -98,7 +98,7 @@ ShortenedLinkParser::lookupUrl( const QString& url ) void -ShortenedLinkParser::lookupFinished() +ShortenedLinkParser::lookupFinished( const QUrl& url ) { NetworkReply* r = qobject_cast< NetworkReply* >( sender() ); Q_ASSERT( r ); @@ -109,7 +109,7 @@ ShortenedLinkParser::lookupFinished() #endif tLog( LOGVERBOSE ) << Q_FUNC_INFO << "Got an un-shortened url:" << r->reply()->url().toString(); - m_links << r->reply()->url().toString(); + m_links << url.toString(); m_queries.remove( r ); r->deleteLater(); diff --git a/src/libtomahawk/utils/ShortenedLinkParser.h b/src/libtomahawk/utils/ShortenedLinkParser.h index f35671b34..69e855b89 100644 --- a/src/libtomahawk/utils/ShortenedLinkParser.h +++ b/src/libtomahawk/utils/ShortenedLinkParser.h @@ -55,7 +55,7 @@ public: static bool handlesUrl( const QString& url ); public slots: - void lookupFinished(); + void lookupFinished( const QUrl& url ); signals: void urls( const QStringList& urls );