mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-24 14:42:53 +02:00
Update headers in QtScriptResolver
This commit is contained in:
committed by
Christian Muehlhaeuser
parent
b155b301dd
commit
edccc2291a
@@ -40,7 +40,6 @@
|
||||
#include "jobview/ErrorStatusMessage.h"
|
||||
|
||||
#include "utils/TomahawkUtilsGui.h"
|
||||
#include "utils/Logger.h"
|
||||
|
||||
#include "config.h"
|
||||
|
||||
|
@@ -24,6 +24,8 @@
|
||||
#include "Query.h"
|
||||
#include "utils/TomahawkUtils.h"
|
||||
#include "config.h"
|
||||
#include "TomahawkVersion.h"
|
||||
#include "utils/Logger.h"
|
||||
|
||||
#include <QtCore/QDir>
|
||||
#include <QtCore/QFile>
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user