mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-06 14:16:32 +02:00
Update headers in QtScriptResolver
This commit is contained in:
@@ -36,7 +36,6 @@
|
||||
#include "jobview/ErrorStatusMessage.h"
|
||||
|
||||
#include "utils/TomahawkUtilsGui.h"
|
||||
#include "utils/Logger.h"
|
||||
|
||||
#include "config.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;
|
||||
};
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user