mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-07-31 03:10:12 +02:00
On blacklisted redirect, emit correct final URL
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
@@ -42,6 +42,7 @@ signals:
|
||||
void redirected();
|
||||
|
||||
void finished();
|
||||
void finished( const QUrl& finalUrl );
|
||||
void error( QNetworkReply::NetworkError error );
|
||||
|
||||
private slots:
|
||||
|
@@ -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();
|
||||
|
||||
|
@@ -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 );
|
||||
|
Reference in New Issue
Block a user