diff --git a/src/libtomahawk/resolvers/QtScriptResolver.cpp b/src/libtomahawk/resolvers/QtScriptResolver.cpp index 1d844eab1..54d46370a 100644 --- a/src/libtomahawk/resolvers/QtScriptResolver.cpp +++ b/src/libtomahawk/resolvers/QtScriptResolver.cpp @@ -36,7 +36,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 9ec07c72e..c2b8fa3c0 100644 --- a/src/libtomahawk/resolvers/QtScriptResolver.h +++ b/src/libtomahawk/resolvers/QtScriptResolver.h @@ -25,6 +25,8 @@ #include "Query.h" #include "utils/TomahawkUtils.h" #include "config.h" +#include "TomahawkVersion.h" +#include "utils/Logger.h" #include <QDir> #include <QFile> @@ -103,6 +105,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 ) @@ -122,6 +137,7 @@ protected: private: QtScriptResolver* m_parent; QString m_scriptPath; + QString m_header; };