Better User Agent for Subsurface

This one is less verbose and very easy to parse. It's guaranteed to have
five components, separated by ':' with no other ':' in the string:

Subsurface:<version>:<PrettyOSName>:<appCpuArch[/osCpuArch]>:<UILang>

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2014-08-08 11:13:05 -07:00
parent a9f59c0cb3
commit 827d4740c3
4 changed files with 19 additions and 2 deletions

View file

@ -28,7 +28,7 @@ void UpdateManager::checkForUpdates()
QNetworkRequest request;
request.setUrl(url);
request.setRawHeader("Accept", "text/xml");
QString userAgent = UserSurvey::getVersion().replace("\n", " ");
QString userAgent = UserSurvey::getUserAgent();
request.setRawHeader("User-Agent", userAgent.toUtf8());
connect(SubsurfaceWebServices::manager()->get(request), SIGNAL(finished()), this, SLOT(requestReceived()));
}