1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-18 23:09:42 +01:00

Don't check whitelist everytime we want to resolve a redirect

This commit is contained in:
Stefan Derkits 2012-01-04 16:37:04 +01:00
parent 014c6e7344
commit 3655a2b537
2 changed files with 9 additions and 3 deletions

View File

@ -57,7 +57,6 @@ ShortenedLinkParser::handlesUrl( const QString& url )
url.contains( "itun.es" ) ||
url.contains( "tinyurl.com" ) ||
url.contains( "tinysong.com" ) ||
url.contains( "grooveshark.com" ) ||
url.contains( "rd.io" ) );
}
@ -67,7 +66,14 @@ ShortenedLinkParser::lengthenUrl( const QString& url )
{
if ( !handlesUrl( url ) )
return;
lengthenShortUrl( url );
}
void
ShortenedLinkParser::lengthenShortUrl ( const QString& url )
{
tDebug() << "Looking up..." << url;
QNetworkReply* reply = TomahawkUtils::nam()->get( QNetworkRequest( QUrl( url ) ) );
@ -76,7 +82,6 @@ ShortenedLinkParser::lengthenUrl( const QString& url )
m_queries.insert( reply );
}
void
ShortenedLinkParser::lookupFinished()
{
@ -89,7 +94,7 @@ ShortenedLinkParser::lookupFinished()
tDebug() << "RedirectionTargetAttribute set on " << redir;
m_queries.remove( r );
r->deleteLater();
lengthenUrl( redir.toUrl().toString() );
lengthenShortUrl( redir.toUrl().toString() );
}
else
{

View File

@ -56,6 +56,7 @@ signals:
private:
void lengthenUrl( const QString& url );
void lengthenShortUrl( const QString& url );
void checkFinished();
QStringList m_links;