diff options
Diffstat (limited to 'qt-mobile')
-rw-r--r-- | qt-mobile/gpslocation.cpp | 3 | ||||
-rw-r--r-- | qt-mobile/gpslocation.h | 1 |
2 files changed, 4 insertions, 0 deletions
diff --git a/qt-mobile/gpslocation.cpp b/qt-mobile/gpslocation.cpp index f78a482a0..b109a01a3 100644 --- a/qt-mobile/gpslocation.cpp +++ b/qt-mobile/gpslocation.cpp @@ -28,6 +28,7 @@ GpsLocation::GpsLocation(QObject *parent) } else { status("don't have GPS source"); } + userAgent = getUserAgent(); } void GpsLocation::serviceEnable(bool toggle) @@ -95,6 +96,7 @@ QString GpsLocation::getUserid(QString user, QString passwd) data = user + " " + passwd; QNetworkRequest request; request.setUrl(url); + request.setRawHeader("User-Agent", getUserAgent().toUtf8()); request.setRawHeader("Accept", "text/html"); request.setRawHeader("Content-type", "application/x-www-form-urlencoded"); reply = manager->post(request, data.toUtf8()); @@ -299,6 +301,7 @@ void GpsLocation::uploadToServer() status(data.toString(QUrl::FullyEncoded).toUtf8()); QNetworkRequest request; request.setUrl(url); + request.setRawHeader("User-Agent", getUserAgent().toUtf8()); request.setRawHeader("Accept", "text/json"); request.setRawHeader("Content-type", "application/x-www-form-urlencoded"); reply = manager->post(request, data.toString(QUrl::FullyEncoded).toUtf8()); diff --git a/qt-mobile/gpslocation.h b/qt-mobile/gpslocation.h index d00fbae6a..82cab8082 100644 --- a/qt-mobile/gpslocation.h +++ b/qt-mobile/gpslocation.h @@ -24,6 +24,7 @@ private: void status(QString msg); QSettings *geoSettings; QNetworkReply *reply; + QString userAgent; signals: |