mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-09 23:57:34 +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:
@@ -464,14 +464,12 @@ JSResolverHelper::customIODeviceFactory( const Tomahawk::result_ptr&, const QStr
|
|||||||
boost::function< void( const QString&, QSharedPointer< QIODevice >& ) > callback )
|
boost::function< void( const QString&, QSharedPointer< QIODevice >& ) > callback )
|
||||||
{
|
{
|
||||||
//can be sync or async
|
//can be sync or async
|
||||||
QString origResultUrl = QString( QUrl( url ).toEncoded() );
|
|
||||||
|
|
||||||
if ( m_urlCallbackIsAsync )
|
if ( m_urlCallbackIsAsync )
|
||||||
{
|
{
|
||||||
QString qid = uuid();
|
QString qid = uuid();
|
||||||
QString getUrl = QString( "Tomahawk.resolver.instance.%1( '%2', '%3' );" ).arg( m_urlCallback )
|
QString getUrl = QString( "Tomahawk.resolver.instance.%1( '%2', '%3' );" ).arg( m_urlCallback )
|
||||||
.arg( qid )
|
.arg( qid )
|
||||||
.arg( origResultUrl );
|
.arg( url );
|
||||||
|
|
||||||
m_streamCallbacks.insert( qid, callback );
|
m_streamCallbacks.insert( qid, callback );
|
||||||
m_resolver->d_func()->engine->mainFrame()->evaluateJavaScript( getUrl );
|
m_resolver->d_func()->engine->mainFrame()->evaluateJavaScript( getUrl );
|
||||||
@@ -479,7 +477,7 @@ JSResolverHelper::customIODeviceFactory( const Tomahawk::result_ptr&, const QStr
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
QString getUrl = QString( "Tomahawk.resolver.instance.%1( '%2' );" ).arg( m_urlCallback )
|
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();
|
QString urlStr = m_resolver->d_func()->engine->mainFrame()->evaluateJavaScript( getUrl ).toString();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user