append $SWISSSURFER_USERAGENT to user agent; refs #88

This commit is contained in:
Marc Wäckerlin
2011-08-25 11:46:53 +00:00
parent 06c20e98ea
commit d9baec2850
8 changed files with 662 additions and 555 deletions

View File

@@ -19,8 +19,9 @@ class WebPage: public QWebPage {
protected:
virtual QWebPage* createWindow(WebWindowType type);
virtual QString userAgentForUrl(const QUrl& url) const {
return QProcessEnvironment::systemEnvironment()
.value("SWISSSURFER_USERAGENT", QWebPage::userAgentForUrl(url));
QString add(QProcessEnvironment::systemEnvironment()
.value("SWISSSURFER_USERAGENT"));
return QWebPage::userAgentForUrl(url)+(add.size()?" "+add:QString());
}
private:
Browser* _browser;