diff options
Diffstat (limited to 'src')
20 files changed, 90 insertions, 55 deletions
diff --git a/src/plugins/geoservices/nokia/nokia.pro b/src/plugins/geoservices/nokia/nokia.pro index 647a0a4e..f9c6a5cc 100644 --- a/src/plugins/geoservices/nokia/nokia.pro +++ b/src/plugins/geoservices/nokia/nokia.pro @@ -8,6 +8,7 @@ contains(QT_CONFIG, location-china-support) { } PLUGIN_TYPE = geoservices +PLUGIN_CLASS_NAME = NokiaGeoServicePlugin load(qt_plugin) HEADERS += \ diff --git a/src/plugins/geoservices/nokia/qplacemanagerengine_nokiav2.cpp b/src/plugins/geoservices/nokia/qplacemanagerengine_nokiav2.cpp index 5543d001..30ad5808 100644 --- a/src/plugins/geoservices/nokia/qplacemanagerengine_nokiav2.cpp +++ b/src/plugins/geoservices/nokia/qplacemanagerengine_nokiav2.cpp @@ -600,39 +600,43 @@ QPlaceReply *QPlaceManagerEngineNokiaV2::initializeCategories() if (m_categoryReply) return m_categoryReply.data(); - m_tempTree.clear(); - CategoryParser parser; + m_tempTree.clear(); + CategoryParser parser; - if (!parser.parse(m_localDataPath + QLatin1String("/offline/offline-mapping.json"))) { - PlaceCategoryNode rootNode; + if (parser.parse(m_localDataPath + QLatin1String("/offline/offline-mapping.json"))) { + m_tempTree = parser.tree(); + } else { + PlaceCategoryNode rootNode; - for (int i = 0; FIXED_CATEGORIES_indices[i] != -1; ++i) { - const QString id = QString::fromLatin1(FIXED_CATEGORIES_string + - FIXED_CATEGORIES_indices[i]); - m_tempTree.insert(id, PlaceCategoryNode()); - rootNode.childIds.append(id); - } + for (int i = 0; FIXED_CATEGORIES_indices[i] != -1; ++i) { + const QString id = QString::fromLatin1(FIXED_CATEGORIES_string + + FIXED_CATEGORIES_indices[i]); - m_tempTree.insert(QString(), rootNode); - } else { - m_tempTree = parser.tree(); - } + PlaceCategoryNode node; + node.category.setCategoryId(id); - //request all categories in the tree from the server - //because we don't want the root node, we remove it from the list - QStringList ids = m_tempTree.keys(); - ids.removeAll(QString()); - foreach (const QString &id, ids) { - QUrl requestUrl(QString::fromLatin1("http://") + m_uriProvider->getCurrentHost() + - QLatin1String("/places/v1/categories/places/") + id); - QNetworkReply *networkReply = sendRequest(requestUrl); - connect(networkReply, SIGNAL(finished()), this, SLOT(categoryReplyFinished())); - connect(networkReply, SIGNAL(error(QNetworkReply::NetworkError)), - this, SLOT(categoryReplyError())); - - m_categoryRequests.insert(id, networkReply); + m_tempTree.insert(id, node); + rootNode.childIds.append(id); } + m_tempTree.insert(QString(), rootNode); + } + + //request all categories in the tree from the server + //because we don't want the root node, we remove it from the list + QStringList ids = m_tempTree.keys(); + ids.removeAll(QString()); + foreach (const QString &id, ids) { + QUrl requestUrl(QString::fromLatin1("http://") + m_uriProvider->getCurrentHost() + + QLatin1String("/places/v1/categories/places/") + id); + QNetworkReply *networkReply = sendRequest(requestUrl); + connect(networkReply, SIGNAL(finished()), this, SLOT(categoryReplyFinished())); + connect(networkReply, SIGNAL(error(QNetworkReply::NetworkError)), + this, SLOT(categoryReplyError())); + + m_categoryRequests.insert(id, networkReply); + } + QPlaceCategoriesReplyImpl *reply = new QPlaceCategoriesReplyImpl(this); connect(reply, SIGNAL(finished()), this, SLOT(replyFinished())); connect(reply, SIGNAL(error(QPlaceReply::Error,QString)), @@ -764,6 +768,8 @@ void QPlaceManagerEngineNokiaV2::categoryReplyFinished() if (!reply) return; + QString categoryId; + if (reply->error() == QNetworkReply::NoError) { QJsonDocument document = QJsonDocument::fromJson(reply->readAll()); if (!document.isObject()) { @@ -777,7 +783,7 @@ void QPlaceManagerEngineNokiaV2::categoryReplyFinished() QJsonObject category = document.object(); - QString categoryId = category.value(QLatin1String("categoryId")).toString(); + categoryId = category.value(QLatin1String("categoryId")).toString(); if (m_tempTree.contains(categoryId)) { PlaceCategoryNode node = m_tempTree.value(categoryId); node.category.setName(category.value(QLatin1String("name")).toString()); @@ -786,14 +792,23 @@ void QPlaceManagerEngineNokiaV2::categoryReplyFinished() m_tempTree.insert(categoryId, node); } + } else { + categoryId = m_categoryRequests.key(reply); + PlaceCategoryNode rootNode = m_tempTree.value(QString()); + rootNode.childIds.removeAll(categoryId); + m_tempTree.insert(QString(), rootNode); + m_tempTree.remove(categoryId); } - m_categoryRequests.remove(m_categoryRequests.key(reply)); + m_categoryRequests.remove(categoryId); reply->deleteLater(); - if (m_categoryRequests.isEmpty() && m_categoryReply) { + if (m_categoryRequests.isEmpty()) { m_categoryTree = m_tempTree; - m_categoryReply.data()->emitFinished(); + m_tempTree.clear(); + + if (m_categoryReply) + m_categoryReply.data()->emitFinished(); } } diff --git a/src/plugins/geoservices/osm/osm.pro b/src/plugins/geoservices/osm/osm.pro index 897ebbfc..cb82aeaa 100644 --- a/src/plugins/geoservices/osm/osm.pro +++ b/src/plugins/geoservices/osm/osm.pro @@ -2,6 +2,7 @@ TARGET = qtgeoservices_osm QT += location-private positioning-private network PLUGIN_TYPE = geoservices +PLUGIN_CLASS_NAME = OSMGeoServicePlugin load(qt_plugin) HEADERS += \ diff --git a/src/plugins/position/android/src/src.pro b/src/plugins/position/android/src/src.pro index a61b77b5..4f1e4412 100644 --- a/src/plugins/position/android/src/src.pro +++ b/src/plugins/position/android/src/src.pro @@ -2,6 +2,7 @@ TARGET = qtposition_android QT = core positioning PLUGIN_TYPE = position +PLUGIN_CLASS_NAME = AndroidPositionPlugin load(qt_plugin) diff --git a/src/plugins/position/blackberry/blackberry.pro b/src/plugins/position/blackberry/blackberry.pro index e3543107..852f6dc7 100644 --- a/src/plugins/position/blackberry/blackberry.pro +++ b/src/plugins/position/blackberry/blackberry.pro @@ -2,6 +2,7 @@ TARGET = qtposition_blackberry QT = core positioning PLUGIN_TYPE = position +PLUGIN_CLASS_NAME = BBPositionPlugin load(qt_plugin) INCLUDEPATH += $$QT.location.includes diff --git a/src/plugins/position/corelocation/corelocation.pro b/src/plugins/position/corelocation/corelocation.pro index 1a1a2a39..544d825a 100644 --- a/src/plugins/position/corelocation/corelocation.pro +++ b/src/plugins/position/corelocation/corelocation.pro @@ -2,7 +2,7 @@ TARGET = qtposition_cl QT = core positioning PLUGIN_TYPE = position -PLUGIN_CLASS_NAME = QGeoPositionInfoSourceFactoryCL +PLUGIN_CLASS_NAME = IOSPositionPlugin load(qt_plugin) INCLUDEPATH += $$QT.location.includes diff --git a/src/plugins/position/geoclue/geoclue.pro b/src/plugins/position/geoclue/geoclue.pro index 5c318645..9db7839f 100644 --- a/src/plugins/position/geoclue/geoclue.pro +++ b/src/plugins/position/geoclue/geoclue.pro @@ -2,6 +2,7 @@ TARGET = qtposition_geoclue QT = core positioning PLUGIN_TYPE = position +PLUGIN_CLASS_NAME = GeoCluePositionPlugin load(qt_plugin) HEADERS += \ diff --git a/src/plugins/position/gypsy/gypsy.pro b/src/plugins/position/gypsy/gypsy.pro index f67d41e7..3bd9b144 100644 --- a/src/plugins/position/gypsy/gypsy.pro +++ b/src/plugins/position/gypsy/gypsy.pro @@ -2,6 +2,7 @@ TARGET = qtposition_gypsy QT = core positioning PLUGIN_TYPE = position +PLUGIN_CLASS_NAME = GypsyPositionPlugin load(qt_plugin) HEADERS += \ diff --git a/src/plugins/position/positionpoll/positionpoll.pro b/src/plugins/position/positionpoll/positionpoll.pro index 1b7e38f5..4af58327 100644 --- a/src/plugins/position/positionpoll/positionpoll.pro +++ b/src/plugins/position/positionpoll/positionpoll.pro @@ -2,6 +2,7 @@ TARGET = qtposition_positionpoll QT = core positioning PLUGIN_TYPE = position +PLUGIN_CLASS_NAME = PollPositionPlugin load(qt_plugin) SOURCES += \ diff --git a/src/plugins/position/simulator/simulator.pro b/src/plugins/position/simulator/simulator.pro index 17948ca5..18d12dfb 100644 --- a/src/plugins/position/simulator/simulator.pro +++ b/src/plugins/position/simulator/simulator.pro @@ -2,6 +2,7 @@ TARGET = qtposition_simulator QT = core network positioning PLUGIN_TYPE = position +PLUGIN_CLASS_NAME = SimulatorPositionPlugin load(qt_plugin) INCLUDEPATH += $$QT.location.includes diff --git a/src/positioning/doc/qtpositioning.qdocconf b/src/positioning/doc/qtpositioning.qdocconf index 10e7b19f..e2c0cc4b 100644 --- a/src/positioning/doc/qtpositioning.qdocconf +++ b/src/positioning/doc/qtpositioning.qdocconf @@ -55,3 +55,5 @@ imagedirs += images navigation.landingpage = "Qt Positioning" navigation.cppclassespage = "Qt Positioning C++ Classes" navigation.qmltypespage = "Qt Positioning QML Types" + +manifestmeta.thumbnail.names += "QtPositioning/Log File*" diff --git a/src/positioning/doc/src/examples/declarative-flickr.qdoc b/src/positioning/doc/src/examples/declarative-flickr.qdoc index af8f4680..a1d0bb58 100644 --- a/src/positioning/doc/src/examples/declarative-flickr.qdoc +++ b/src/positioning/doc/src/examples/declarative-flickr.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the documentation of the Qt Toolkit. @@ -34,7 +34,7 @@ fetch local content from a web service. This is a small example, illustrating one of the very core parts of the - Qt Positioning API: the ability to retrieve and use the user's current + \l{Qt Positioning} API: the ability to retrieve and use the user's current geographic position. Key QML types shown in this example: @@ -45,7 +45,9 @@ \image qml-flickr-1.jpg - \section2 Retrieving the Current Position + \include examples-run.qdocinc + + \section1 Retrieving the Current Position Retrieving the user's current position is achieved using the PositionSource type. In this example, we instantiate the PositionSource as part of the @@ -67,7 +69,7 @@ \snippet flickr/flickrmobile/GeoTab.qml props - \section2 Using the Current Position + \section1 Using the Current Position The longitude and latitude values retrieved here are eventually set on in properties on the RestModel component. The RestModel is an XmlListModel, diff --git a/src/positioning/doc/src/examples/qtpositioning-examples.qdoc b/src/positioning/doc/src/examples/qtpositioning-examples.qdoc index ac1d79ec..331c5536 100644 --- a/src/positioning/doc/src/examples/qtpositioning-examples.qdoc +++ b/src/positioning/doc/src/examples/qtpositioning-examples.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the documentation of the Qt Toolkit. @@ -32,7 +32,6 @@ \ingroup all-examples \ingroup qtpositioning - These are the Qt Positioning examples. + These are the \l{Qt Positioning} examples. */ - diff --git a/src/positioning/doc/src/examples/satelliteinfo.qdoc b/src/positioning/doc/src/examples/satelliteinfo.qdoc index 1edb8f6c..6a3ee8cb 100644 --- a/src/positioning/doc/src/examples/satelliteinfo.qdoc +++ b/src/positioning/doc/src/examples/satelliteinfo.qdoc @@ -35,7 +35,7 @@ \ingroup qtpositioning-examples - Key Qt Positioning classes used in this example: + Key \l{Qt Positioning} classes used in this example: \list \li \l{QGeoSatelliteInfo} @@ -70,4 +70,6 @@ If the platform does not provide satellite information the application automatically switches into a demo mode whereby it continuously switches between predefined sets of satellite data. + + \include examples-run.qdocinc */ diff --git a/src/positioning/doc/src/examples/weatherinfo.qdoc b/src/positioning/doc/src/examples/weatherinfo.qdoc index 0c98cc04..a836d028 100644 --- a/src/positioning/doc/src/examples/weatherinfo.qdoc +++ b/src/positioning/doc/src/examples/weatherinfo.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the documentation of the Qt Toolkit. @@ -34,7 +34,7 @@ \ingroup qtpositioning-examples - Key Qt Positioning classes used in this example: + Key \l{Qt Positioning} classes used in this example: \list \li \l{QGeoPositionInfo} @@ -43,6 +43,8 @@ \image ../images/example-weatherinfo.png + \include examples-run.qdocinc + The key part of this example is the application's data model, contained in the WeatherData and AppModel classes. WeatherData represents the weather information taken from the HTTP service. It is a simple data class, but we diff --git a/src/positioning/qdoublevector2d_p.h b/src/positioning/qdoublevector2d_p.h index b99e392c..3225a28e 100644 --- a/src/positioning/qdoublevector2d_p.h +++ b/src/positioning/qdoublevector2d_p.h @@ -65,7 +65,7 @@ QT_BEGIN_NAMESPACE class QDoubleVector3D; -class Q_POSITIONING_EXPORT_PRIVATE QDoubleVector2D +class Q_POSITIONING_EXPORT QDoubleVector2D { public: Q_DECL_CONSTEXPR inline QDoubleVector2D(); diff --git a/src/positioning/qdoublevector3d_p.h b/src/positioning/qdoublevector3d_p.h index d3f40193..82ecefbf 100644 --- a/src/positioning/qdoublevector3d_p.h +++ b/src/positioning/qdoublevector3d_p.h @@ -63,7 +63,7 @@ QT_BEGIN_NAMESPACE -class Q_POSITIONING_EXPORT_PRIVATE QDoubleVector3D +class Q_POSITIONING_EXPORT QDoubleVector3D { public: Q_DECL_CONSTEXPR inline QDoubleVector3D(); diff --git a/src/positioning/qgeoprojection_p.h b/src/positioning/qgeoprojection_p.h index d0280030..c31daa86 100644 --- a/src/positioning/qgeoprojection_p.h +++ b/src/positioning/qgeoprojection_p.h @@ -64,7 +64,7 @@ QT_BEGIN_NAMESPACE class QGeoCoordinate; class QDoubleVector2D; -class Q_POSITIONING_EXPORT_PRIVATE QGeoProjection +class Q_POSITIONING_EXPORT QGeoProjection { public: static QDoubleVector2D coordToMercator(const QGeoCoordinate &coord); diff --git a/src/positioning/qpositioningglobal.h b/src/positioning/qpositioningglobal.h index 5d1c3dea..4a919ee6 100644 --- a/src/positioning/qpositioningglobal.h +++ b/src/positioning/qpositioningglobal.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the QtPositioning module of the Qt Toolkit. @@ -48,14 +48,11 @@ QT_BEGIN_NAMESPACE #ifndef QT_STATIC # if defined(QT_BUILD_POSITIONING_LIB) # define Q_POSITIONING_EXPORT Q_DECL_EXPORT -# define Q_POSITIONING_EXPORT_PRIVATE Q_DECL_EXPORT # else # define Q_POSITIONING_EXPORT Q_DECL_IMPORT -# define Q_POSITIONING_EXPORT_PRIVATE Q_DECL_IMPORT # endif #else # define Q_POSITIONING_EXPORT -# define Q_POSITIONING_EXPORT_PRIVATE #endif diff --git a/src/src.pro b/src/src.pro index c00a4b8a..dc0dcad1 100644 --- a/src/src.pro +++ b/src/src.pro @@ -5,9 +5,13 @@ SUBDIRS += positioning plugins.depends = positioning SUBDIRS += plugins -positioning_doc_snippets.subdir = positioning/doc/snippets -positioning_doc_snippets.depends = positioning -SUBDIRS += positioning_doc_snippets +contains(QT_CONFIG, private_tests) { + positioning_doc_snippets.subdir = positioning/doc/snippets + #plugin dependency required during static builds + positioning_doc_snippets.depends = positioning plugins + + SUBDIRS += positioning_doc_snippets +} qtHaveModule(quick) { SUBDIRS += 3rdparty @@ -18,9 +22,13 @@ qtHaveModule(quick) { plugins.depends += location imports.depends += location - location_doc_snippets.subdir = location/doc/snippets - location_doc_snippets.depends = location - SUBDIRS += location_doc_snippets + contains(QT_CONFIG, private_tests) { + location_doc_snippets.subdir = location/doc/snippets + #plugin dependency required during static builds + location_doc_snippets.depends = location plugins + + SUBDIRS += location_doc_snippets + } imports.depends += positioning SUBDIRS += imports |