diff --git a/src/libtomahawk/resolvers/QtScriptResolver.cpp b/src/libtomahawk/resolvers/QtScriptResolver.cpp index d8cc489be..b17cb9ff9 100644 --- a/src/libtomahawk/resolvers/QtScriptResolver.cpp +++ b/src/libtomahawk/resolvers/QtScriptResolver.cpp @@ -40,7 +40,6 @@ #include "jobview/ErrorStatusMessage.h" #include "utils/TomahawkUtilsGui.h" -#include "utils/Logger.h" #include "config.h" diff --git a/src/libtomahawk/resolvers/QtScriptResolver.h b/src/libtomahawk/resolvers/QtScriptResolver.h index f2624f200..9b9bca4db 100644 --- a/src/libtomahawk/resolvers/QtScriptResolver.h +++ b/src/libtomahawk/resolvers/QtScriptResolver.h @@ -24,6 +24,8 @@ #include "Query.h" #include "utils/TomahawkUtils.h" #include "config.h" +#include "TomahawkVersion.h" +#include "utils/Logger.h" #include #include @@ -96,6 +98,19 @@ public: settings()->setAttribute( QWebSettings::LocalStorageDatabaseEnabled, true ); settings()->setAttribute( QWebSettings::LocalContentCanAccessFileUrls, true ); settings()->setAttribute( QWebSettings::LocalContentCanAccessRemoteUrls, true ); + + // Tomahawk is not a user agent + m_header = QWebPage::userAgentForUrl( QUrl() ).replace( QString( "%1/%2" ) + .arg( TOMAHAWK_APPLICATION_NAME ) + .arg( TOMAHAWK_VERSION ) + ,""); + tLog() << "QtScriptResolver Using header" << m_header; + } + + QString userAgentForUrl ( const QUrl & url ) const + { + Q_UNUSED(url); + return m_header; } void setScriptPath( const QString& scriptPath ) @@ -115,6 +130,7 @@ protected: private: QtScriptResolver* m_parent; QString m_scriptPath; + QString m_header; };