1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-09 15:47:38 +02:00

Don't pass an Url needlessly through QUrl

This does more harm than good: If the first part after the protocol is
numeric QUrl assumes this is a byteencoded IPv4 address and converts it
to the dot notation. If we actually want to pass a numeric ID here, this
will turn the ID into an IP which is then useless for us.
This commit is contained in:
Uwe L. Korn
2014-09-22 13:30:14 +01:00
parent ca6f5148e3
commit 84a5ea06ee

View File

@@ -464,14 +464,12 @@ JSResolverHelper::customIODeviceFactory( const Tomahawk::result_ptr&, const QStr
boost::function< void( const QString&, QSharedPointer< QIODevice >& ) > callback )
{
//can be sync or async
QString origResultUrl = QString( QUrl( url ).toEncoded() );
if ( m_urlCallbackIsAsync )
{
QString qid = uuid();
QString getUrl = QString( "Tomahawk.resolver.instance.%1( '%2', '%3' );" ).arg( m_urlCallback )
.arg( qid )
.arg( origResultUrl );
.arg( url );
m_streamCallbacks.insert( qid, callback );
m_resolver->d_func()->engine->mainFrame()->evaluateJavaScript( getUrl );
@@ -479,7 +477,7 @@ JSResolverHelper::customIODeviceFactory( const Tomahawk::result_ptr&, const QStr
else
{
QString getUrl = QString( "Tomahawk.resolver.instance.%1( '%2' );" ).arg( m_urlCallback )
.arg( origResultUrl );
.arg( url );
QString urlStr = m_resolver->d_func()->engine->mainFrame()->evaluateJavaScript( getUrl ).toString();