From 4f3ae14dbff4c0d0f604ddbfcd0e0b0c4b434343 Mon Sep 17 00:00:00 2001 From: Stefan Derkits Date: Wed, 4 Jan 2012 17:03:48 +0100 Subject: [PATCH] Better function naming in shortenedlinkparser --- src/libtomahawk/utils/shortenedlinkparser.cpp | 18 ++++-------------- src/libtomahawk/utils/shortenedlinkparser.h | 3 +-- 2 files changed, 5 insertions(+), 16 deletions(-) diff --git a/src/libtomahawk/utils/shortenedlinkparser.cpp b/src/libtomahawk/utils/shortenedlinkparser.cpp index 911921153..6d89aba69 100644 --- a/src/libtomahawk/utils/shortenedlinkparser.cpp +++ b/src/libtomahawk/utils/shortenedlinkparser.cpp @@ -35,7 +35,8 @@ ShortenedLinkParser::ShortenedLinkParser ( const QStringList& urls, QObject* par : QObject( parent ) { foreach ( const QString& url, urls ) - lengthenUrl( url ); + if ( handlesUrl( url ) ) + lookupUrl( url ) ; } @@ -60,19 +61,8 @@ ShortenedLinkParser::handlesUrl( const QString& url ) url.contains( "rd.io" ) ); } - void -ShortenedLinkParser::lengthenUrl( const QString& url ) -{ - if ( !handlesUrl( url ) ) - return; - - lengthenShortUrl( url ); - -} - -void -ShortenedLinkParser::lengthenShortUrl ( const QString& url ) +ShortenedLinkParser::lookupUrl ( const QString& url ) { tDebug() << "Looking up..." << url; @@ -94,7 +84,7 @@ ShortenedLinkParser::lookupFinished() tDebug() << "RedirectionTargetAttribute set on " << redir; m_queries.remove( r ); r->deleteLater(); - lengthenShortUrl( redir.toUrl().toString() ); + lookupUrl( redir.toUrl().toString() ); } else { diff --git a/src/libtomahawk/utils/shortenedlinkparser.h b/src/libtomahawk/utils/shortenedlinkparser.h index 53fd655a6..4fd358749 100644 --- a/src/libtomahawk/utils/shortenedlinkparser.h +++ b/src/libtomahawk/utils/shortenedlinkparser.h @@ -55,8 +55,7 @@ signals: void urls( const QStringList& urls ); private: - void lengthenUrl( const QString& url ); - void lengthenShortUrl( const QString& url ); + void lookupUrl( const QString& url ); void checkFinished(); QStringList m_links;