diff options
author | Aaron McCarthy <aaron.mccarthy@jollamobile.com> | 2014-01-20 10:57:08 +1000 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-01-22 01:47:34 +0100 |
commit | 0b36e73112b099090f5dcbbc21d172dcc7c97f30 (patch) | |
tree | 92779dfa9e00b8933e53dd0aafebf6947fbf5905 /src/plugins/geoservices/nokia/placesv2/jsonparserhelpers.cpp | |
parent | bdcc97c444fadc566b4476f5f91b02bd8be21ec3 (diff) | |
download | qtlocation-0b36e73112b099090f5dcbbc21d172dcc7c97f30.tar.gz |
Remove offset attribute from place content requests.
This complements 1d0966c6924876655c52725e779a7aa24866ff60
Not all service providers support arbitrary offsets when requesting
place content. The offset attribute has been removed, instead service
providers can supply a previous and next content request query in the
form of a QPlaceContentRequest.
Change-Id: I6239b42c31bed5dcd6645d86d5a48d7e6a667f46
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
Diffstat (limited to 'src/plugins/geoservices/nokia/placesv2/jsonparserhelpers.cpp')
-rw-r--r-- | src/plugins/geoservices/nokia/placesv2/jsonparserhelpers.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/plugins/geoservices/nokia/placesv2/jsonparserhelpers.cpp b/src/plugins/geoservices/nokia/placesv2/jsonparserhelpers.cpp index 1a18d15d..ac294d6e 100644 --- a/src/plugins/geoservices/nokia/placesv2/jsonparserhelpers.cpp +++ b/src/plugins/geoservices/nokia/placesv2/jsonparserhelpers.cpp @@ -200,6 +200,7 @@ QPlaceEditorial parseEditorial(const QJsonObject &editorialObject, void parseCollection(QPlaceContent::Type type, const QJsonObject &object, QPlaceContent::Collection *collection, int *totalCount, + QPlaceContentRequest *previous, QPlaceContentRequest *next, const QPlaceManagerEngineNokiaV2 *engine) { Q_ASSERT(engine); @@ -211,6 +212,16 @@ void parseCollection(QPlaceContent::Type type, const QJsonObject &object, if (object.contains(QLatin1String("offset"))) offset = object.value(QLatin1String("offset")).toDouble(); + if (previous && object.contains(QStringLiteral("previous"))) { + previous->setContentType(type); + previous->setContentContext(QUrl(object.value(QStringLiteral("previous")).toString())); + } + + if (next && object.contains(QStringLiteral("next"))) { + next->setContentType(type); + next->setContentContext(QUrl(object.value(QStringLiteral("next")).toString())); + } + if (collection) { QJsonArray items = object.value(QLatin1String("items")).toArray(); for (int i = 0; i < items.count(); ++i) { |