Skip to content

Commit

Permalink
Update headers in QtScriptResolver
Browse files Browse the repository at this point in the history
  • Loading branch information
hugolm84 committed Feb 18, 2013
1 parent 3c95d57 commit a5f2b0e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/libtomahawk/resolvers/QtScriptResolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
#include "jobview/ErrorStatusMessage.h"

#include "utils/TomahawkUtilsGui.h"
#include "utils/Logger.h"

#include "config.h"

Expand Down
16 changes: 16 additions & 0 deletions src/libtomahawk/resolvers/QtScriptResolver.h
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -103,6 +105,19 @@ Q_OBJECT
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 )
Expand All @@ -122,6 +137,7 @@ public slots:
private:
QtScriptResolver* m_parent;
QString m_scriptPath;
QString m_header;
};


Expand Down

0 comments on commit a5f2b0e

Please sign in to comment.