summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorabcd <qt-info@nokia.com>2011-09-01 19:50:34 +1000
committerabcd <qt_abcd1@ovi.com>2011-09-02 08:22:39 +0200
commit8d19e5e93a848deeda722b846c8dd1811018b9de (patch)
treef9899b45bbe36712bb6f8dda6e31e1a9d9481c3c
parentf7067ee52733c8561d0b13707d816aea307f6f94 (diff)
downloadqtlocation-8d19e5e93a848deeda722b846c8dd1811018b9de.tar.gz
Rename PlaceSaveReply to PlaceIdReply
The id reply is meant for operation in which we return an id such as saving a place, removing a category etc. The id reply has an operationType() property which tells us what the operation was. We don't use the QPlaceReply::type() to hold the operation type because the reply type should indicate the contents of the reply, eg the content reply holds place content, the search reply holds search results therefore the id reply holds an id. Change-Id: I3aa0b45c648186ee78297620896420966e42afa3 Reviewed-on: http://codereview.qt.nokia.com/4061 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Aaron McCarthy <aaron.mccarthy@nokia.com> Reviewed-by: abcd <qt_abcd1@ovi.com>
-rw-r--r--src/imports/location/declarativeplaces/qdeclarativeplace.cpp8
-rw-r--r--src/location/places/places.pri4
-rw-r--r--src/location/places/qplaceidreply.cpp (renamed from src/location/places/qplacesavereply.cpp)73
-rw-r--r--src/location/places/qplaceidreply.h (renamed from src/location/places/qplacesavereply.h)36
-rw-r--r--src/location/places/qplacemanager.cpp2
-rw-r--r--src/location/places/qplacemanager.h4
-rw-r--r--src/location/places/qplacemanagerengine.h2
-rw-r--r--src/location/places/qplacereply.h2
-rw-r--r--src/plugins/geoservices/nokia/qplacemanagerengine_nokia.cpp2
-rw-r--r--src/plugins/geoservices/nokia/qplacemanagerengine_nokia.h2
-rw-r--r--src/plugins/geoservices/nokia_places_jsondb/idreply.cpp (renamed from src/plugins/geoservices/nokia_places_jsondb/savereply.cpp)13
-rw-r--r--src/plugins/geoservices/nokia_places_jsondb/idreply.h (renamed from src/plugins/geoservices/nokia_places_jsondb/savereply.h)14
-rw-r--r--src/plugins/geoservices/nokia_places_jsondb/jsondbhandler.cpp7
-rw-r--r--src/plugins/geoservices/nokia_places_jsondb/nokia_places_jsondb.pro9
-rw-r--r--src/plugins/geoservices/nokia_places_jsondb/qplacemanagerengine_jsondb.cpp27
-rw-r--r--src/plugins/geoservices/nokia_places_jsondb/qplacemanagerengine_jsondb.h2
-rw-r--r--tests/auto/geotestplugin/qplacemanagerengine_test.h2
-rw-r--r--tests/auto/qplacemanager_jsondb/tst_qplacemanager_jsondb.cpp10
18 files changed, 122 insertions, 97 deletions
diff --git a/src/imports/location/declarativeplaces/qdeclarativeplace.cpp b/src/imports/location/declarativeplaces/qdeclarativeplace.cpp
index 5ee08d6c..22b129ee 100644
--- a/src/imports/location/declarativeplaces/qdeclarativeplace.cpp
+++ b/src/imports/location/declarativeplaces/qdeclarativeplace.cpp
@@ -48,7 +48,7 @@
#include <QtLocation/QPlaceManager>
#include <QtLocation/QPlaceDetailsReply>
#include <QtLocation/QPlaceReply>
-#include <QtLocation/QPlaceSaveReply>
+#include <QtLocation/QPlaceIdReply>
QT_USE_NAMESPACE
@@ -417,9 +417,9 @@ void QDeclarativePlace::finished()
if (m_reply->error() == QPlaceReply::NoError) {
switch (m_reply->type()) {
- case (QPlaceReply::SaveReply) : {
- QPlaceSaveReply *saveReply = qobject_cast<QPlaceSaveReply *>(m_reply);
- setPlaceId(saveReply->placeId());
+ case (QPlaceReply::IdReply) : {
+ QPlaceIdReply *saveReply = qobject_cast<QPlaceIdReply *>(m_reply);
+ setPlaceId(saveReply->id());
break;
}
case (QPlaceReply::PlaceDetailsReply): {
diff --git a/src/location/places/places.pri b/src/location/places/places.pri
index 8a585c2c..54cf1fe5 100644
--- a/src/location/places/places.pri
+++ b/src/location/places/places.pri
@@ -22,7 +22,7 @@ PUBLIC_HEADERS += \
#reply classes
places/qplacereply.h \
places/qplacedetailsreply.h \
- places/qplacesavereply.h \
+ places/qplaceidreply.h \
places/qplacesearchreply.h \
places/qplacetextpredictionreply.h \
#manager and engine
@@ -58,7 +58,7 @@ SOURCES += \
places/qplaceimage.cpp \
places/qplacerating.cpp \
places/qplacereview.cpp \
- places/qplacesavereply.cpp \
+ places/qplaceidreply.cpp \
places/qplacesupplier.cpp \
#result
places/qplacesearchresult.cpp \
diff --git a/src/location/places/qplacesavereply.cpp b/src/location/places/qplaceidreply.cpp
index 294a0306..f4972fb2 100644
--- a/src/location/places/qplacesavereply.cpp
+++ b/src/location/places/qplaceidreply.cpp
@@ -1,10 +1,10 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the Qt Mobility Components.
+** This file is part of the QtLocation module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** GNU Lesser General Public License Usage
@@ -39,16 +39,17 @@
**
****************************************************************************/
-#include "qplacesavereply.h"
+#include "qplaceidreply.h"
#include "qplacereply_p.h"
QT_BEGIN_NAMESPACE
-class QPlaceSaveReplyPrivate : public QPlaceReplyPrivate
+class QPlaceIdReplyPrivate : public QPlaceReplyPrivate
{
public:
- QPlaceSaveReplyPrivate() {}
- ~QPlaceSaveReplyPrivate() {}
- QString placeId;
+ QPlaceIdReplyPrivate() {}
+ ~QPlaceIdReplyPrivate() {}
+ QString id;
+ QPlaceIdReply::OperationType operationType;
};
QT_END_NAMESPACE
@@ -56,55 +57,67 @@ QT_END_NAMESPACE
QT_USE_NAMESPACE
/*!
- \class QPlaceSaveReply
+ \class QPlaceIdReply
- \brief The QPlaceSaveReply class manages a place save operation started by an
- instance of QPlaceManager.
+ \brief The QPlaceIdReply class manages operations which return an id such as
+ saving and removal operations of places and categories.
- \inmodule QtPlaces
+ \inmodule QtLocation
\ingroup places-main
*/
/*!
- Constructs a save reply with a given \a parent.
+ Constructs an id reply with a given \a operationType and \a parent.
*/
-QPlaceSaveReply::QPlaceSaveReply(QObject *parent)
- : QPlaceReply(new QPlaceSaveReplyPrivate, parent)
+QPlaceIdReply::QPlaceIdReply(QPlaceIdReply::OperationType operationType, QObject *parent)
+ : QPlaceReply(new QPlaceIdReplyPrivate, parent)
{
+ Q_D(QPlaceIdReply);
+ d->operationType = operationType;
}
/*!
- Destroys the save reply.
+ Destroys the reply.
*/
-QPlaceSaveReply::~QPlaceSaveReply()
+QPlaceIdReply::~QPlaceIdReply()
{
}
/*!
- Returns the type of reply.
+ Returns the type of reply. This is an indication of the content
+ of the reply.
*/
-QPlaceReply::Type QPlaceSaveReply::type() const
+QPlaceReply::Type QPlaceIdReply::type() const
{
- return QPlaceReply::SaveReply;
+ return QPlaceReply::IdReply;
}
- /*!
- Returns the id of the saved place. One should ensure that the reply
- is finished before calling this function, otherwise an
- empty string is returned.
+/*!
+ Returns the operation type of the reply.
+*/
+QPlaceIdReply::OperationType QPlaceIdReply::operationType() const
+{
+ Q_D(const QPlaceIdReply);
+ return d->operationType;
+}
+
+/*!
+ Returns the relevant id for the opeation. Eg for a save place operation,
+ the id is that of the saved place. For a category removal operation,
+ it is the category id.
*/
-QString QPlaceSaveReply::placeId() const
+QString QPlaceIdReply::id() const
{
- Q_D(const QPlaceSaveReply);
- return d->placeId;
+ Q_D(const QPlaceIdReply);
+ return d->id;
}
/*!
- Sets the saved \a placeId
+ Sets the \a id of the reply.
*/
-void QPlaceSaveReply::setPlaceId(const QString &placeId)
+void QPlaceIdReply::setId(const QString &id)
{
- Q_D(QPlaceSaveReply);
- d->placeId = placeId;
+ Q_D(QPlaceIdReply);
+ d->id = id;
}
diff --git a/src/location/places/qplacesavereply.h b/src/location/places/qplaceidreply.h
index 746ec2c6..7c8fe549 100644
--- a/src/location/places/qplacesavereply.h
+++ b/src/location/places/qplaceidreply.h
@@ -1,10 +1,10 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the Qt Mobility Components.
+** This file is part of the QtLocation module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** GNU Lesser General Public License Usage
@@ -39,33 +39,43 @@
**
****************************************************************************/
-#ifndef QPLACESAVEREPLY_H
-#define QPLACESAVEREPLY_H
+#ifndef QPLACEIDREPLY_H
+#define QPLACEIDREPLY_H
#include "qplacereply.h"
#include "qgeoplace.h"
QT_BEGIN_NAMESPACE
-class QPlaceSaveReplyPrivate;
-class Q_LOCATION_EXPORT QPlaceSaveReply : public QPlaceReply
+class QPlaceIdReplyPrivate;
+class Q_LOCATION_EXPORT QPlaceIdReply : public QPlaceReply
{
Q_OBJECT
public:
- QPlaceSaveReply(QObject *parent =0);
- virtual ~QPlaceSaveReply();
+ enum OperationType
+ {
+ SavePlace,
+ SaveCategory,
+ RemovePlace,
+ RemoveCategory
+ };
+
+ QPlaceIdReply(OperationType operationType,
+ QObject *parent =0);
+ virtual ~QPlaceIdReply();
QPlaceReply::Type type() const;
+ OperationType operationType() const;
- QString placeId() const;
+ QString id() const;
protected:
- void setPlaceId(const QString &placeId);
+ void setId(const QString &id);
private:
- Q_DISABLE_COPY(QPlaceSaveReply)
- Q_DECLARE_PRIVATE(QPlaceSaveReply)
+ Q_DISABLE_COPY(QPlaceIdReply)
+ Q_DECLARE_PRIVATE(QPlaceIdReply)
};
QT_END_NAMESPACE
-#endif // QPLACEDETAILSREPLY_H
+#endif
diff --git a/src/location/places/qplacemanager.cpp b/src/location/places/qplacemanager.cpp
index e258265b..b66cd111 100644
--- a/src/location/places/qplacemanager.cpp
+++ b/src/location/places/qplacemanager.cpp
@@ -203,7 +203,7 @@ QPlaceManager::ConnectivityModes QPlaceManager::supportedConnectivityModes() con
/*!
Saves a \a place at the given \a scope.
*/
-QPlaceSaveReply *QPlaceManager::savePlace(const QGeoPlace &place, VisibilityScope scope)
+QPlaceIdReply *QPlaceManager::savePlace(const QGeoPlace &place, VisibilityScope scope)
{
return d->engine->savePlace(place, scope);
}
diff --git a/src/location/places/qplacemanager.h b/src/location/places/qplacemanager.h
index 388f6cda..e3881d70 100644
--- a/src/location/places/qplacemanager.h
+++ b/src/location/places/qplacemanager.h
@@ -46,7 +46,7 @@
#include "qplacecontentreply.h"
#include "qplacecontentrequest.h"
#include "qplacerequest.h"
-#include "qplacesavereply.h"
+#include "qplaceidreply.h"
#include "qplacereply.h"
#include "qplacedetailsreply.h"
#include "qplacetextpredictionreply.h"
@@ -122,7 +122,7 @@ public:
void setConnectivityMode(ConnectivityModes connectivityMode);
ConnectivityModes supportedConnectivityModes() const;
- QPlaceSaveReply *savePlace(const QGeoPlace &place, VisibilityScope scope = QPlaceManager::NoScope);
+ QPlaceIdReply *savePlace(const QGeoPlace &place, VisibilityScope scope = QPlaceManager::NoScope);
VisibilityScopes supportedSaveVisibilityScopes();
QPlaceReply *removePlace(const QGeoPlace &place);
diff --git a/src/location/places/qplacemanagerengine.h b/src/location/places/qplacemanagerengine.h
index 7e21ad8f..82312368 100644
--- a/src/location/places/qplacemanagerengine.h
+++ b/src/location/places/qplacemanagerengine.h
@@ -74,7 +74,7 @@ public:
virtual void setConnectivityMode(QPlaceManager::ConnectivityModes mode) = 0;
virtual QPlaceManager::ConnectivityModes supportedConnectivityModes() const = 0;
- virtual QPlaceSaveReply *savePlace(const QGeoPlace &place, QPlaceManager::VisibilityScope scope) = 0;
+ virtual QPlaceIdReply *savePlace(const QGeoPlace &place, QPlaceManager::VisibilityScope scope) = 0;
virtual QPlaceManager::VisibilityScopes supportedSaveVisibilityScopes() const = 0;
virtual QPlaceReply *removePlace(const QGeoPlace &place) = 0;
diff --git a/src/location/places/qplacereply.h b/src/location/places/qplacereply.h
index 6cdc9b64..6dcc785d 100644
--- a/src/location/places/qplacereply.h
+++ b/src/location/places/qplacereply.h
@@ -73,7 +73,7 @@ public:
TextPredictionReply,
ReviewReply,
ContentReply,
- SaveReply
+ IdReply
};
QPlaceReply(QObject *parent);
diff --git a/src/plugins/geoservices/nokia/qplacemanagerengine_nokia.cpp b/src/plugins/geoservices/nokia/qplacemanagerengine_nokia.cpp
index ad29c4e9..a736b6cc 100644
--- a/src/plugins/geoservices/nokia/qplacemanagerengine_nokia.cpp
+++ b/src/plugins/geoservices/nokia/qplacemanagerengine_nokia.cpp
@@ -246,7 +246,7 @@ QPlaceManager::ConnectivityModes QPlaceManagerEngineNokia::supportedConnectivity
return QPlaceManager::OnlineMode;
}
-QPlaceSaveReply *QPlaceManagerEngineNokia::savePlace(const QGeoPlace &place,
+QPlaceIdReply *QPlaceManagerEngineNokia::savePlace(const QGeoPlace &place,
QPlaceManager::VisibilityScope scope)
{
Q_UNUSED(place)
diff --git a/src/plugins/geoservices/nokia/qplacemanagerengine_nokia.h b/src/plugins/geoservices/nokia/qplacemanagerengine_nokia.h
index 44c6f30b..400baaad 100644
--- a/src/plugins/geoservices/nokia/qplacemanagerengine_nokia.h
+++ b/src/plugins/geoservices/nokia/qplacemanagerengine_nokia.h
@@ -81,7 +81,7 @@ public:
void setConnectivityMode(QPlaceManager::ConnectivityModes connectivityMode);
QPlaceManager::ConnectivityModes supportedConnectivityModes() const;
- QPlaceSaveReply *savePlace(const QGeoPlace &place, QPlaceManager::VisibilityScope scope);
+ QPlaceIdReply *savePlace(const QGeoPlace &place, QPlaceManager::VisibilityScope scope);
QPlaceManager::VisibilityScopes supportedSaveVisibilityScopes() const;
QPlaceReply *removePlace(const QGeoPlace &place);
diff --git a/src/plugins/geoservices/nokia_places_jsondb/savereply.cpp b/src/plugins/geoservices/nokia_places_jsondb/idreply.cpp
index cd31abf1..cd204791 100644
--- a/src/plugins/geoservices/nokia_places_jsondb/savereply.cpp
+++ b/src/plugins/geoservices/nokia_places_jsondb/idreply.cpp
@@ -39,18 +39,19 @@
**
****************************************************************************/
-#include "savereply.h"
+#include "idreply.h"
-SaveReply::SaveReply(QPlaceManagerEngineJsonDb *engine)
- : QPlaceSaveReply(engine),m_engine(engine)
+IdReply::IdReply(QPlaceIdReply::OperationType operationType,
+ QPlaceManagerEngineJsonDb *engine)
+ : QPlaceIdReply(operationType, engine),m_engine(engine)
{
}
-SaveReply::~SaveReply()
+IdReply::~IdReply()
{
}
-void SaveReply::setPlaceId(const QString &placeId)
+void IdReply::setId(const QString &id)
{
- QPlaceSaveReply::setPlaceId(placeId);
+ QPlaceIdReply::setId(id);
}
diff --git a/src/plugins/geoservices/nokia_places_jsondb/savereply.h b/src/plugins/geoservices/nokia_places_jsondb/idreply.h
index 615eb139..1a9b38a1 100644
--- a/src/plugins/geoservices/nokia_places_jsondb/savereply.h
+++ b/src/plugins/geoservices/nokia_places_jsondb/idreply.h
@@ -38,23 +38,23 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-#ifndef SAVEREPLY_H
-#define SAVEREPLY_H
+#ifndef IDREPLY_H
+#define IDREPLY_H
-#include <qplacesavereply.h>
+#include <qplaceidreply.h>
#include "macro.h"
#include "qplacemanagerengine_jsondb.h"
QT_USE_NAMESPACE
-class SaveReply : public QPlaceSaveReply
+class IdReply : public QPlaceIdReply
{
Q_OBJECT
public:
- SaveReply(QPlaceManagerEngineJsonDb *engine);
- virtual ~SaveReply();
- void setPlaceId(const QString &placeId);
+ IdReply(QPlaceIdReply::OperationType operationType, QPlaceManagerEngineJsonDb *engine);
+ virtual ~IdReply();
+ void setId(const QString &id);
DECLARE_TRIGGER_DONE_FN
private:
diff --git a/src/plugins/geoservices/nokia_places_jsondb/jsondbhandler.cpp b/src/plugins/geoservices/nokia_places_jsondb/jsondbhandler.cpp
index aa540262..71eb7a10 100644
--- a/src/plugins/geoservices/nokia_places_jsondb/jsondbhandler.cpp
+++ b/src/plugins/geoservices/nokia_places_jsondb/jsondbhandler.cpp
@@ -42,12 +42,9 @@
#include "jsondbhandler.h"
#include "qgeoboundingcircle.h"
#include "qplacemanagerengine_jsondb.h"
-#include "reply.h"
-#include "savereply.h"
-#include "searchreply.h"
-#include "detailsreply.h"
-#include <qplacesearchrequest.h>
+#include <QtLocation/QPlaceSearchRequest>
+
#include <jsondb-client.h>
#include <QDebug>
diff --git a/src/plugins/geoservices/nokia_places_jsondb/nokia_places_jsondb.pro b/src/plugins/geoservices/nokia_places_jsondb/nokia_places_jsondb.pro
index 3fe1fd57..369335b9 100644
--- a/src/plugins/geoservices/nokia_places_jsondb/nokia_places_jsondb.pro
+++ b/src/plugins/geoservices/nokia_places_jsondb/nokia_places_jsondb.pro
@@ -13,21 +13,21 @@ HEADERS += \
qgeoserviceproviderplugin_jsondb.h \
qplacemanagerengine_jsondb.h \
jsondbhandler.h \
- savereply.h \
searchreply.h \
detailsreply.h \
reply.h \
unsupportedreplies.h \
- macro.h
+ macro.h \
+ idreply.h
SOURCES += \
qgeoserviceproviderplugin_jsondb.cpp \
qplacemanagerengine_jsondb.cpp \
jsondbhandler.cpp \
- savereply.cpp \
searchreply.cpp \
detailsreply.cpp \
- reply.cpp
+ reply.cpp \
+ idreply.cpp
INCLUDEPATH += $$QT.location.includes
@@ -47,4 +47,3 @@ symbian {
target.path += $$[QT_INSTALL_PLUGINS]/geoservices
INSTALLS += target
-
diff --git a/src/plugins/geoservices/nokia_places_jsondb/qplacemanagerengine_jsondb.cpp b/src/plugins/geoservices/nokia_places_jsondb/qplacemanagerengine_jsondb.cpp
index be5c3723..495b6b15 100644
--- a/src/plugins/geoservices/nokia_places_jsondb/qplacemanagerengine_jsondb.cpp
+++ b/src/plugins/geoservices/nokia_places_jsondb/qplacemanagerengine_jsondb.cpp
@@ -47,13 +47,14 @@
#include "detailsreply.h"
#include "reply.h"
-#include "savereply.h"
+#include "idreply.h"
#include "searchreply.h"
#include "unsupportedreplies.h"
QT_USE_NAMESPACE
Q_DECLARE_METATYPE(QPlaceReply::Error)
+Q_DECLARE_METATYPE(QPlaceReply *)
QPlaceManagerEngineJsonDb::QPlaceManagerEngineJsonDb(const QMap<QString, QVariant> &parameters,
QGeoServiceProvider::Error *error,
@@ -66,6 +67,7 @@ QPlaceManagerEngineJsonDb::QPlaceManagerEngineJsonDb(const QMap<QString, QVarian
Q_UNUSED(errorString)
qRegisterMetaType<QPlaceReply::Error>();
+ qRegisterMetaType<QPlaceReply *>();
connect(&m_jsonDbHandler, SIGNAL(jsonDbResponse(int,QVariant)),
this, SLOT(processJsonDbResponse(int,QVariant)));
@@ -169,10 +171,9 @@ QPlaceManager::ConnectivityModes QPlaceManagerEngineJsonDb::supportedConnectivit
return QPlaceManager::OfflineMode;
}
-QPlaceSaveReply *QPlaceManagerEngineJsonDb::savePlace(const QGeoPlace &place, QPlaceManager::VisibilityScope scope)
+QPlaceIdReply *QPlaceManagerEngineJsonDb::savePlace(const QGeoPlace &place, QPlaceManager::VisibilityScope scope)
{
-
- SaveReply *saveReply = new SaveReply(this);
+ IdReply *saveReply = new IdReply(QPlaceIdReply::SavePlace, this);
if (!m_jsonDbHandler.isConnected()) {
saveReply->triggerDone(QPlaceReply::CommunicationError, "No connection to jsondb database");
return saveReply;
@@ -240,7 +241,7 @@ void QPlaceManagerEngineJsonDb::processJsonDbResponse(int id, const QVariant &da
QPlaceReply *reply = m_idReplyMap.value(id,0);
if (reply) {
switch (reply->type()) {
- case QPlaceReply::SaveReply: {
+ case QPlaceReply::IdReply: {
/*
Expected data format
@@ -249,9 +250,9 @@ void QPlaceManagerEngineJsonDb::processJsonDbResponse(int id, const QVariant &da
"_version": <version>
}
*/
- SaveReply *saveReply = qobject_cast<SaveReply *>(reply);
- saveReply->setPlaceId(data.toMap().value(UUID).toString());
- saveReply->triggerDone();
+ IdReply *idReply = qobject_cast<IdReply *>(reply);
+ idReply->setId(data.toMap().value(UUID).toString());
+ idReply->triggerDone();
break;
}
case QPlaceReply::PlaceSearchReply: {
@@ -346,17 +347,21 @@ void QPlaceManagerEngineJsonDb::processJsonDbError(int id, int code, const QStri
QPlaceReply *placeReply = m_idReplyMap.value(id,0);
if (placeReply) {
switch (placeReply->type()) {
- case QPlaceReply::SaveReply: {
- SaveReply *saveReply = qobject_cast<SaveReply *>(placeReply);
+ case QPlaceReply::IdReply: {
+ IdReply *idReply = qobject_cast<IdReply *>(placeReply);
+ switch (idReply->operationType()) {
+ case (QPlaceIdReply::SavePlace):
switch (code) {
case JsonDbError::MissingObject:
error = QPlaceReply::PlaceDoesNotExistError;
errorString = tr("Trying to update place which does not exist");
break;
}
- saveReply->triggerDone(error, errorString);
+ idReply->triggerDone(error, errorString);
break;
}
+ break;
+ }
case QPlaceReply::PlaceSearchReply: {
SearchReply *searchReply = qobject_cast<SearchReply*>(placeReply);
searchReply->triggerDone(error, errorString);
diff --git a/src/plugins/geoservices/nokia_places_jsondb/qplacemanagerengine_jsondb.h b/src/plugins/geoservices/nokia_places_jsondb/qplacemanagerengine_jsondb.h
index 94f21c61..0003c8ce 100644
--- a/src/plugins/geoservices/nokia_places_jsondb/qplacemanagerengine_jsondb.h
+++ b/src/plugins/geoservices/nokia_places_jsondb/qplacemanagerengine_jsondb.h
@@ -73,7 +73,7 @@ public:
void setConnectivityMode(QPlaceManager::ConnectivityModes connectivityMode);
QPlaceManager::ConnectivityModes supportedConnectivityModes() const;
- QPlaceSaveReply *savePlace(const QGeoPlace &place, QPlaceManager::VisibilityScope scope);
+ QPlaceIdReply *savePlace(const QGeoPlace &place, QPlaceManager::VisibilityScope scope);
QPlaceManager::VisibilityScopes supportedSaveVisibilityScopes() const;
QPlaceReply *removePlace(const QGeoPlace &place);
diff --git a/tests/auto/geotestplugin/qplacemanagerengine_test.h b/tests/auto/geotestplugin/qplacemanagerengine_test.h
index 8e971e9a..120d85c3 100644
--- a/tests/auto/geotestplugin/qplacemanagerengine_test.h
+++ b/tests/auto/geotestplugin/qplacemanagerengine_test.h
@@ -130,7 +130,7 @@ public:
return QPlaceManager::OnlineMode;
}
- QPlaceSaveReply *savePlace(const QGeoPlace &place, QPlaceManager::VisibilityScope scope)
+ QPlaceIdReply *savePlace(const QGeoPlace &place, QPlaceManager::VisibilityScope scope)
{
Q_UNUSED(place)
Q_UNUSED(scope)
diff --git a/tests/auto/qplacemanager_jsondb/tst_qplacemanager_jsondb.cpp b/tests/auto/qplacemanager_jsondb/tst_qplacemanager_jsondb.cpp
index 1f2358a0..db05e061 100644
--- a/tests/auto/qplacemanager_jsondb/tst_qplacemanager_jsondb.cpp
+++ b/tests/auto/qplacemanager_jsondb/tst_qplacemanager_jsondb.cpp
@@ -45,7 +45,7 @@
Q_DECLARE_METATYPE(QPlaceReply::Error);
Q_DECLARE_METATYPE(QPlaceReply *);
-Q_DECLARE_METATYPE(QPlaceSaveReply *);
+Q_DECLARE_METATYPE(QPlaceIdReply *);
QT_USE_NAMESPACE
@@ -110,7 +110,7 @@ void tst_QPlaceManagerJsonDb::initTestCase()
{
qRegisterMetaType<QPlaceReply::Error>();
qRegisterMetaType<QPlaceReply *>();
- qRegisterMetaType<QPlaceSaveReply *>();
+ qRegisterMetaType<QPlaceIdReply *>();
QStringList providers = QGeoServiceProvider::availableServiceProviders();
providers.contains("nokia_places_jsondb");
@@ -649,17 +649,17 @@ bool tst_QPlaceManagerJsonDb::doSavePlace(const QGeoPlace &place,
QString *placeId,
QPlaceManager::VisibilityScope scope)
{
- QPlaceSaveReply *saveReply = placeManager->savePlace(place,scope);
+ QPlaceIdReply *saveReply = placeManager->savePlace(place,scope);
bool isSuccessful = false;
isSuccessful = checkSignals(saveReply, expectedError);
if (placeId != 0)
- *placeId = saveReply->placeId();
+ *placeId = saveReply->id();
return isSuccessful;
}
void tst_QPlaceManagerJsonDb::doSavePlaces(QList<QGeoPlace> &places)
{
- QPlaceSaveReply *saveReply;
+ QPlaceIdReply *saveReply;
foreach (QGeoPlace place, places) {
saveReply = placeManager->savePlace(place);