summaryrefslogtreecommitdiff
path: root/src/plugins/geoservices/nokia/qgeouriprovider.cpp
diff options
context:
space:
mode:
authorAlex Blasche <alexander.blasche@qt.io>2016-08-26 13:12:00 +0200
committerAlex Blasche <alexander.blasche@qt.io>2016-08-26 11:21:21 +0000
commit9305015c3171dfe944e967081e879a365ca9a63f (patch)
tree1d2433c54bdcb9f1cf65b87cc4f2279d55a1e19b /src/plugins/geoservices/nokia/qgeouriprovider.cpp
parentf025ce23a742495c6cb7badad5b561a9eeb94025 (diff)
downloadqtlocation-9305015c3171dfe944e967081e879a365ca9a63f.tar.gz
Remove QtSystemInfo dependency from QtLocation
This was done to detect a Chinese network operator. In such cases a different places and geocoding manager is required which takes into account the shifting of map coordinates. This requirement still exists in China but QtSystemInfo is not even a released API. It makes no sense to keep the depending symbols around. QGeoUriProvider will remain though in case Chinese customers may want to adjust this behavior. Change-Id: I5ee0edbf00cd561923457b449c5c9de675aa41d1 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/plugins/geoservices/nokia/qgeouriprovider.cpp')
-rw-r--r--src/plugins/geoservices/nokia/qgeouriprovider.cpp37
1 files changed, 0 insertions, 37 deletions
diff --git a/src/plugins/geoservices/nokia/qgeouriprovider.cpp b/src/plugins/geoservices/nokia/qgeouriprovider.cpp
index 05ace120..80b47f31 100644
--- a/src/plugins/geoservices/nokia/qgeouriprovider.cpp
+++ b/src/plugins/geoservices/nokia/qgeouriprovider.cpp
@@ -35,10 +35,6 @@
****************************************************************************/
#include "qgeouriprovider.h"
-#ifdef USE_CHINA_NETWORK_REGISTRATION
-#include <QNetworkInfo>
-#endif
-
#include <QMap>
#include <QVariant>
#include <QSet>
@@ -46,14 +42,6 @@
QT_BEGIN_NAMESPACE
-namespace
-{
- const QString CHINA_MCC = QLatin1String("460"); // China mobile country code
- const QString CHINA2_MCC = QLatin1String("461"); // China mobile country code
- const QString HONG_KONG_MCC = QLatin1String("454"); // Hong Kong mobile country code
- const QString MACAU_MCC = QLatin1String("455"); // Macau mobile country code
-}
-
QGeoUriProvider::QGeoUriProvider(
QObject *parent,
const QVariantMap &parameters,
@@ -61,17 +49,11 @@ QGeoUriProvider::QGeoUriProvider(
const QString &internationalHost,
const QString &localizedHost)
: QObject(parent)
-#ifdef USE_CHINA_NETWORK_REGISTRATION
- , m_networkInfo(new QNetworkInfo(this))
-#endif
, m_internationalHost(parameters.value(hostParameterName, internationalHost).toString())
, m_localizedHost(localizedHost)
, m_firstSubdomain(QChar::Null)
, m_maxSubdomains(0)
{
-#ifdef USE_CHINA_NETWORK_REGISTRATION
- QObject::connect(m_networkInfo, SIGNAL(currentMobileCountryCodeChanged(int,QString)), this, SLOT(mobileCountryCodeChanged(int,QString)));
-#endif
setCurrentHost(isInternationalNetwork() || m_localizedHost.isEmpty() ? m_internationalHost : m_localizedHost);
}
@@ -109,26 +91,7 @@ void QGeoUriProvider::mobileCountryCodeChanged(int interface, const QString& mcc
bool QGeoUriProvider::isInternationalNetwork() const
{
-#ifndef USE_CHINA_NETWORK_REGISTRATION
- return true;
-#else
- static QSet<QString> codes;
- if (codes.empty()) {
- codes.insert(CHINA_MCC);
- codes.insert(CHINA2_MCC);
- }
-
- QNetworkInfo::NetworkMode mode = m_networkInfo->currentNetworkMode();
-
- int interfaces = m_networkInfo->networkInterfaceCount(mode);
- for (int i = 0; i < interfaces; ++i) {
- QString mcc = m_networkInfo->currentMobileCountryCode(interfaces);
- if (codes.contains(mcc))
- return false;
- }
-
return true;
-#endif // USE_CHINA_NETWORK_REGISTRATION
}
QT_END_NAMESPACE