diff options
author | michalk <qt-info@nokia.com> | 2011-07-20 13:34:28 +0300 |
---|---|---|
committer | michalk <qt-info@nokia.com> | 2011-07-20 16:07:56 +0300 |
commit | d41735afd1c1e17faf3a00c220c823defee70868 (patch) | |
tree | ff92a9935c2ef74c93a484ab6b4d892422ec4ea2 /plugins/geoservices | |
parent | b07769b9f8a131d4c26fee0e1862cabcca5a0634 (diff) |
nokia plugin: add search china url for shifting
Diffstat (limited to 'plugins/geoservices')
-rw-r--r-- | plugins/geoservices/nokia/qgeosearchmanagerengine_nokia.cpp | 15 | ||||
-rw-r--r-- | plugins/geoservices/nokia/qgeosearchmanagerengine_nokia.h | 8 |
2 files changed, 23 insertions, 0 deletions
diff --git a/plugins/geoservices/nokia/qgeosearchmanagerengine_nokia.cpp b/plugins/geoservices/nokia/qgeosearchmanagerengine_nokia.cpp index 04db58be18..5ca882deac 100644 --- a/plugins/geoservices/nokia/qgeosearchmanagerengine_nokia.cpp +++ b/plugins/geoservices/nokia/qgeosearchmanagerengine_nokia.cpp @@ -108,6 +108,11 @@ QGeoSearchManagerEngineNokia::QGeoSearchManagerEngineNokia(const QMap<QString, Q if (errorString) *errorString = ""; +#ifdef USE_CHINA_NETWORK_REGISTRATION + connect(&m_networkInfo, SIGNAL(currentMobileCountryCodeChanged(const QString&)), SLOT(currentMobileCountryCodeChanged(const QString&))); + currentMobileCountryCodeChanged(m_networkInfo.currentMobileCountryCode()); +#endif + } QGeoSearchManagerEngineNokia::~QGeoSearchManagerEngineNokia() {} @@ -297,3 +302,13 @@ void QGeoSearchManagerEngineNokia::placesError(QGeoSearchReply::Error error, con emit this->error(reply, error, errorString); } + +void QGeoSearchManagerEngineNokia::currentMobileCountryCodeChanged(const QString & mcc) +{ + if(mcc == "460" || mcc == "461"){ + m_host="pr.geo.maps.svc.ovi.com.cn"; + } + else{ + m_host ="loc.desktop.maps.svc.ovi.com"; + } +} diff --git a/plugins/geoservices/nokia/qgeosearchmanagerengine_nokia.h b/plugins/geoservices/nokia/qgeosearchmanagerengine_nokia.h index 5fad069c91..19a252513f 100644 --- a/plugins/geoservices/nokia/qgeosearchmanagerengine_nokia.h +++ b/plugins/geoservices/nokia/qgeosearchmanagerengine_nokia.h @@ -57,6 +57,10 @@ #include <QNetworkAccessManager> #include <QLocale> +#ifdef USE_CHINA_NETWORK_REGISTRATION +#include "../../../src/systeminfo/qsystemnetworkinfo.h" +#endif + QTM_USE_NAMESPACE @@ -83,6 +87,7 @@ public: private slots: void placesFinished(); void placesError(QGeoSearchReply::Error error, const QString &errorString); + void currentMobileCountryCodeChanged(const QString& mcc); private: static QString trimDouble(double degree, int decimalDigits = 10); @@ -92,6 +97,9 @@ private: QString m_host; QString m_token; QString m_referer; +#ifdef USE_CHINA_NETWORK_REGISTRATION + QSystemNetworkInfo m_networkInfo; +#endif }; #endif |