summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorabcd <amos.choy@nokia.com>2011-11-14 18:05:22 +1000
committerQt by Nokia <qt-info@nokia.com>2011-11-16 05:37:21 +0100
commit7c12c5ea6eecde65b35ef0b004c2e347f06ec1ad (patch)
tree7ca832c9c19d9c416243a369a975da3dccc46e52
parent4beb6dfa7f818ced9aff296728519d4a6590eb5c (diff)
downloadqtlocation-7c12c5ea6eecde65b35ef0b004c2e347f06ec1ad.tar.gz
Rename textPrediction to searchSuggestion
A suggestion is a more appropriate term since 'prediction' implies that the search term just is auto-completed. Suggestions may be given that do not derive directly from the entered partial search term. Also rename TextPredictionModel to PlaceSearchSuggestionModel. Change-Id: Ib7100e0c52c21196ecc70c8c25a94abfaecc9125 Reviewed-by: Aaron McCarthy <aaron.mccarthy@nokia.com>
-rw-r--r--doc/src/places.qdoc12
-rw-r--r--doc/src/plugins/jsondb.qdoc2
-rw-r--r--doc/src/plugins/nokia.qdoc6
-rw-r--r--doc/src/plugins/places-backend.qdoc2
-rw-r--r--doc/src/snippets/declarative/places.qml12
-rw-r--r--doc/src/snippets/places/requesthandler.h32
-rw-r--r--examples/declarative/qmlplaces/qmlplaces.qml8
-rw-r--r--src/imports/location/declarativeplaces/declarativeplaces.pri4
-rw-r--r--src/imports/location/declarativeplaces/qdeclarativesearchsuggestionmodel.cpp (renamed from src/imports/location/declarativeplaces/qdeclarativetextpredictionmodel.cpp)105
-rw-r--r--src/imports/location/declarativeplaces/qdeclarativesearchsuggestionmodel_p.h (renamed from src/imports/location/declarativeplaces/qdeclarativetextpredictionmodel_p.h)22
-rw-r--r--src/imports/location/location.cpp4
-rw-r--r--src/imports/location/qdeclarativegeoserviceprovider_p.h2
-rw-r--r--src/location/places/places.pri4
-rw-r--r--src/location/places/qplacemanager.cpp14
-rw-r--r--src/location/places/qplacemanager.h8
-rw-r--r--src/location/places/qplacemanagerengine.cpp4
-rw-r--r--src/location/places/qplacemanagerengine.h2
-rw-r--r--src/location/places/qplacereply.cpp5
-rw-r--r--src/location/places/qplacereply.h2
-rw-r--r--src/location/places/qplacesearchrequest.cpp4
-rw-r--r--src/location/places/qplacesearchsuggestionreply.cpp (renamed from src/location/places/qplacetextpredictionreply.cpp)44
-rw-r--r--src/location/places/qplacesearchsuggestionreply.h (renamed from src/location/places/qplacetextpredictionreply.h)22
-rw-r--r--src/plugins/geoservices/nokia/places/qplacetextpredictionreplyimpl.cpp4
-rw-r--r--src/plugins/geoservices/nokia/places/qplacetextpredictionreplyimpl.h4
-rw-r--r--src/plugins/geoservices/nokia/qplacemanagerengine_nokia.cpp4
-rw-r--r--src/plugins/geoservices/nokia/qplacemanagerengine_nokia.h2
-rw-r--r--src/plugins/geoservices/nokia_places_jsondb/qplacemanagerengine_jsondb.cpp8
-rw-r--r--src/plugins/geoservices/nokia_places_jsondb/qplacemanagerengine_jsondb.h4
-rw-r--r--src/plugins/geoservices/nokia_places_jsondb/unsupportedreplies.h10
-rw-r--r--tests/auto/declarative/tst_plugin.qml4
-rw-r--r--tests/auto/geotestplugin/qplacemanagerengine_test.h4
-rw-r--r--tests/auto/qplacemanager_jsondb/tst_qplacemanager_jsondb.cpp12
32 files changed, 187 insertions, 189 deletions
diff --git a/doc/src/places.qdoc b/doc/src/places.qdoc
index 1acdbd8a..942ed216 100644
--- a/doc/src/places.qdoc
+++ b/doc/src/places.qdoc
@@ -108,18 +108,18 @@
The usage of the QPlaceContent::Collection and the conversion between content and its subtypes means
that code for handling the mechanics of paging reviews, images and editorials can be easily shared.
- \section2 Text Predictions
- The retrieval of text predictions is very similar to performing a place search. A QPlaceSearchRequest
+ \section2 Search Suggestions
+ The retrieval of search term suggestions is very similar to performing a place search. A QPlaceSearchRequest
is used just like a place search, the only difference being that the search term is set to a
partially completed string.
- \snippet snippets/places/requesthandler.h Prediction request
- And when the request is done, we can use the reply to show the predictions.
- \snippet snippets/places/requesthandler.h Prediction handler
+ \snippet snippets/places/requesthandler.h Suggestion request
+ And when the request is done, we can use the reply to show the suggestions.
+ \snippet snippets/places/requesthandler.h Suggestion handler
\section2 Recommendations
Recommendations are suggestions for places that are similar to a specified place.
- The retrieval of recommendations is very similar to retrieving text predictions or
+ The retrieval of recommendations is very similar to retrieving search term suggestions or
performing a place search.
\snippet snippets/places/requesthandler.h Recommendation
diff --git a/doc/src/plugins/jsondb.qdoc b/doc/src/plugins/jsondb.qdoc
index 72fc0abb..2fd7d222 100644
--- a/doc/src/plugins/jsondb.qdoc
+++ b/doc/src/plugins/jsondb.qdoc
@@ -58,7 +58,7 @@ capabiliies are outlined below:
\o Icon url type(see \l {Icon internals} {QPlaceIcon})
\o full url
\row
- \o Text Prediction
+ \o Search term suggestions
\o no
\row
\o Recommendations
diff --git a/doc/src/plugins/nokia.qdoc b/doc/src/plugins/nokia.qdoc
index 099d76c0..69fdea3d 100644
--- a/doc/src/plugins/nokia.qdoc
+++ b/doc/src/plugins/nokia.qdoc
@@ -123,7 +123,7 @@ and behaviours are outlined below:
\o Icon url type(see \l {Icon internals} {QPlaceIcon})
\o not supported
\row
- \o Text Prediction
+ \o Search term suggestions
\o yes
\row
\o Recommendations
@@ -189,8 +189,8 @@ via QPlaceManager::getDetails()
\o extended attributes
\endlist
-\section3 Text prediction
-Only a search term and search center is supported for text prediction
+\section3 Search term suggestions.
+Only a partial search term and search center is supported when retrieving suggestions.
\section3 Recommendation
Only a given place is supported as a parameter for a recommendation. No other parameters are used.
diff --git a/doc/src/plugins/places-backend.qdoc b/doc/src/plugins/places-backend.qdoc
index 7402f5ee..09a58425 100644
--- a/doc/src/plugins/places-backend.qdoc
+++ b/doc/src/plugins/places-backend.qdoc
@@ -69,7 +69,7 @@ emitted from a slot which is in turn is invoked by a QNetworkReply::finished() s
Sometimes however, we may want to emit the QPlaceReply::finished() signal without
depending upon an underlying asynchronous notification mechanism. This
is a common case when a portion of functionality is not supported. For example,
-a backend may not support text predictions, so we need a way to trigger the finished
+a backend may not support search term suggestions, so we need a way to trigger the finished
signal, but there's no underlying asynchronous mechanism to do so. In this case,
the typical approach is to use QMetaObject::invokeMethod() with a Qt::QueuedConnection,
so that the QPlaceReply::finished(), QPlaceReply::error(), QPlaceManagerEngine::finished()
diff --git a/doc/src/snippets/declarative/places.qml b/doc/src/snippets/declarative/places.qml
index a3d8451c..df8f2ad8 100644
--- a/doc/src/snippets/declarative/places.qml
+++ b/doc/src/snippets/declarative/places.qml
@@ -150,9 +150,9 @@ Item {
}
//! [RecommendationModel]
- //! [TextPredictionModel]
- TextPredictionModel {
- id: textPredictionModel
+ //! [SearchSuggestionModel]
+ PlaceSearchSuggestionModel {
+ id: suggestionModel
searchArea: BoundingCircle {
center: Coordinate {
// Brisbane
@@ -165,10 +165,10 @@ Item {
}
ListView {
- model: textPredictionModel
- delegate: Text { text: textPrediction }
+ model: suggestionModel
+ delegate: Text { text: suggestion }
}
- //! [TextPredictionModel]
+ //! [SearchSuggestionModel]
//! [Rating]
Text {
diff --git a/doc/src/snippets/places/requesthandler.h b/doc/src/snippets/places/requesthandler.h
index 9808266b..9459f922 100644
--- a/doc/src/snippets/places/requesthandler.h
+++ b/doc/src/snippets/places/requesthandler.h
@@ -146,15 +146,15 @@ public:
}
- void textPrediction()
+ void suggestion()
{
- //! [Prediction request]
+ //! [Suggestion request]
QPlaceSearchRequest request;
request.setSearchTerm("piz");
request.setSearchArea(new QGeoBoundingCircle(QGeoCoordinate(12.34, 56.78)));
- /* QPlaceTextPredictionReply * */predictionReply = manager->textPredictions(request);
- connect(predictionReply, SIGNAL(finished()), this, SLOT(handlePredictionReply()));
- //! [Prediction request]
+ /* QPlaceSearchSuggestion * */suggestionReply = manager->searchSuggestions(request);
+ connect(suggestionReply, SIGNAL(finished()), this, SLOT(handleSuggestionReply()));
+ //! [Suggestion request]
}
void recommendation()
@@ -388,18 +388,18 @@ public slots:
}
//! [Image handler]
- //! [Prediction handler]
- void handlePredictionReply() {
- if (predictionReply->error() == QPlaceReply::NoError) {
- foreach (const QString &prediction, predictionReply->textPredictions())
- qDebug() << prediction;
+ //! [Suggestion handler]
+ void handleSuggestionReply() {
+ if (suggestionReply->error() == QPlaceReply::NoError) {
+ foreach (const QString &suggestion, suggestionReply->suggestions())
+ qDebug() << suggestion;
}
- predictionReply->deleteLater(); //discard reply
- predictionReply = 0;
+ suggestionReply->deleteLater(); //discard reply
+ suggestionReply = 0;
}
- //! [Prediction handler]
+ //! [Suggestion handler]
//! [Recommendation handler]
void handleRecommendationReply() {
@@ -516,7 +516,7 @@ QPlaceSearchReply *recommendationReply;
QPlaceManager *manager;
QPlaceDetailsReply *detailsReply;
QPlaceContentReply *contentReply;
-QPlaceTextPredictionReply *predictionReply;
+QPlaceSearchSuggestionReply *suggestionReply;
QPlaceIdReply *savePlaceReply;
QPlaceIdReply *removePlaceReply;
QPlaceIdReply *saveCategoryReply;
@@ -549,7 +549,7 @@ public:
};
//! [Implement reply pt2]
-class TextPredictionReply : public QPlaceTextPredictionReply
+class SearchSuggestionReply : public QPlaceSearchSuggestionReply
{
public:
void triggerDone(QPlaceReply::Error error = QPlaceReply::NoError,
@@ -560,7 +560,7 @@ public:
};
//! [Trigger done]
-void TextPredictionReply::triggerDone(QPlaceReply::Error error,
+void SearchSuggestionReply::triggerDone(QPlaceReply::Error error,
const QString &errorString)
{
if (error != QPlaceReply::NoError) {
diff --git a/examples/declarative/qmlplaces/qmlplaces.qml b/examples/declarative/qmlplaces/qmlplaces.qml
index b3e321ff..9537e4e7 100644
--- a/examples/declarative/qmlplaces/qmlplaces.qml
+++ b/examples/declarative/qmlplaces/qmlplaces.qml
@@ -164,7 +164,7 @@ Rectangle {
anchors.left: searchTermRect.left
anchors.right: searchTermRect.right
anchors.top: searchTermRect.bottom
- height: Math.min(4, resultSuggestion.textPredictions.length) * 19
+ height: Math.min(4, resultSuggestion.suggestions.length) * 19
visible: false
color: "#f0f0f0"
clip: true
@@ -175,13 +175,13 @@ Rectangle {
delegate: Component {
Text {
width: parent.width
- text: textPrediction
+ text: suggestion
font.pixelSize: 16
MouseArea {
anchors.fill: parent
onClicked: {
- search_term.text = textPrediction;
+ search_term.text = suggestion;
searchTerm(search_term.text);
}
}
@@ -234,7 +234,7 @@ Rectangle {
suggestions.visible = false;
}
- TextPredictionModel {
+ PlaceSearchSuggestionModel {
id: resultSuggestion
plugin: geoServices
diff --git a/src/imports/location/declarativeplaces/declarativeplaces.pri b/src/imports/location/declarativeplaces/declarativeplaces.pri
index f27a3ed2..d2ec73eb 100644
--- a/src/imports/location/declarativeplaces/declarativeplaces.pri
+++ b/src/imports/location/declarativeplaces/declarativeplaces.pri
@@ -4,7 +4,7 @@ SOURCES += \
declarativeplaces/qdeclarativeplacecontentmodel.cpp \
declarativeplaces/qdeclarativerecommendationmodel.cpp \
declarativeplaces/qdeclarativesupportedcategoriesmodel.cpp \
- declarativeplaces/qdeclarativetextpredictionmodel.cpp \
+ declarativeplaces/qdeclarativesearchsuggestionmodel.cpp \
declarativeplaces/qdeclarativesearchresultmodel.cpp \
declarativeplaces/qdeclarativereviewmodel.cpp \
declarativeplaces/qdeclarativeplaceimagemodel.cpp \
@@ -25,7 +25,7 @@ HEADERS += \
declarativeplaces/qdeclarativeplacecontentmodel.h \
declarativeplaces/qdeclarativerecommendationmodel_p.h \
declarativeplaces/qdeclarativesupportedcategoriesmodel_p.h \
- declarativeplaces/qdeclarativetextpredictionmodel_p.h \
+ declarativeplaces/qdeclarativesearchsuggestionmodel_p.h \
declarativeplaces/qdeclarativesearchresultmodel_p.h \
declarativeplaces/qdeclarativereviewmodel_p.h \
declarativeplaces/qdeclarativeplaceimagemodel_p.h \
diff --git a/src/imports/location/declarativeplaces/qdeclarativetextpredictionmodel.cpp b/src/imports/location/declarativeplaces/qdeclarativesearchsuggestionmodel.cpp
index 11e92cb9..f83c80ac 100644
--- a/src/imports/location/declarativeplaces/qdeclarativetextpredictionmodel.cpp
+++ b/src/imports/location/declarativeplaces/qdeclarativesearchsuggestionmodel.cpp
@@ -39,7 +39,7 @@
**
****************************************************************************/
-#include "qdeclarativetextpredictionmodel_p.h"
+#include "qdeclarativesearchsuggestionmodel_p.h"
#include "qdeclarativegeoserviceprovider_p.h"
#include <QtDeclarative/QDeclarativeInfo>
@@ -51,25 +51,26 @@
QT_USE_NAMESPACE
/*!
- \qmlclass TextPredictionModel QDeclarativeTextPredictionModel
+ \qmlclass PlaceSearchSuggestionModel QDeclarativeSearchSuggestionModel
\inqmlmodule QtLocation 5
\ingroup qml-QtLocation5-places
\since QtLocation 5.0
- \brief The TextPredictionModel element provides access to text predictions.
+ \brief The PlaceSearchSuggestionModel element provides access to search term suggestions.
- The TextPredictionModel can be used to provide search term predictions as the user enters their
- search term. The properties of this model should match that of the \l PlaceSearchModel which
- will be used to perform the actual search query to ensure that the text prediction results are
+ The PlaceSearchSuggestionModel can be used to provide search term suggestions as the user enters their
+ search term. The properties of this model should match that of the \l PlaceSearchModel, which
+ will be used to perform the actual search query, to ensure that the search suggestion results are
relevant.
There are two ways of accessing the data provided by this model, either through the
- \l textPredictions property or through views and delegates. The latter is the preferred
+ \l suggestions property or through views and delegates. The latter is the preferred
method.
- The \l offset and \l limit properties can be used to access paged search results. When the
- \l offset and \l limit properties are set the search results between \l offset and
- (\l offset + \l limit - 1) will be returned.
+ The \l offset and \l limit properties can be used to access paged suggestions. When the
+ \l offset and \l limit properties are set the suggestions between \l offset and
+ (\l offset + \l limit - 1) will be returned. Support for paging may vary
+ from plugin to plugin.
The model returns data for the following roles:
@@ -79,33 +80,33 @@ QT_USE_NAMESPACE
\o Type
\o Description
\row
- \o textPrediction
+ \o suggestion
\o string
\o Suggested search term.
\endtable
- The following example shows how to use the TextPredictionModel to get suggested search queries
- for a partial search term. The \l searchArea is set to match what would be used to perform the
+ The following example shows how to use the PlaceSearchSuggestionModel to get suggested search terms
+ from a partial search term. The \l searchArea is set to match what would be used to perform the
actual place search with \l PlaceSearchModel.
\snippet snippets/declarative/places.qml QtQuick import
\snippet snippets/declarative/places.qml QtLocation import
\codeline
- \snippet snippets/declarative/places.qml TextPredictionModel
+ \snippet snippets/declarative/places.qml SearchSuggestionModel
\sa PlaceSearchModel, {QPlaceManager}
*/
/*!
- \qmlproperty Plugin TextPredictionModel::plugin
+ \qmlproperty Plugin PlaceSearchSuggestionModel::plugin
This property holds the provider \l Plugin which will be used to perform the search.
*/
/*!
- \qmlproperty BoundingArea TextPredictionModel::searchArea
+ \qmlproperty BoundingArea PlaceSearchSuggestionModel::searchArea
- This property holds the search area. Text prediction results returned by the model will be
+ This property holds the search area. Search suggestion results returned by the model will be
relevant to the given search area.
If this property is set to a \l BoundingCircle its \l {BoundingCircle::radius}{radius} property
@@ -114,15 +115,15 @@ QT_USE_NAMESPACE
*/
/*!
- \qmlproperty int TextPredictionModel::offset
+ \qmlproperty int PlaceSearchSuggestionModel::offset
- This property holds the index of the first search result in the model.
+ This property holds the index of the first item in the model.
\sa limit
*/
/*!
- \qmlproperty int TextPredictionModel::limit
+ \qmlproperty int PlaceSearchSuggestionModel::limit
This property holds the limit of the number of items that will be returned.
@@ -130,64 +131,64 @@ QT_USE_NAMESPACE
*/
/*!
- \qmlproperty enum TextPredictionModel::status
+ \qmlproperty enum PlaceSearchSuggestionModel::status
This property holds the status of the model. It can be one of:
\table
\row
- \o TextPredictionModel.Ready
+ \o SearchSuggestionModel.Ready
\o The search query has completed and the result are available.
\row
- \o TextPredictionModel.Executing
+ \o SearchSuggestionModel.Executing
\o A search query is currently being executed.
\row
- \o TextPredictionModel.Error
+ \o SearchSuggestionModel.Error
\o An error occurred when executing the previous search query.
\endtable
*/
/*!
- \qmlmethod TextPredictionModel::execute()
+ \qmlmethod PlaceSearchSuggestionModel::execute()
- Executes a text prediction query for the partial \l searchTerm and \l searchArea. Once the
- query completes the model items are updated with the text prediction results.
+ Executes a search suggestion query for the partial \l searchTerm and \l searchArea. Once the
+ query completes the model items are updated with the suggestions.
\sa cancel(), status
*/
/*!
- \qmlmethod TextPredictionModel::cancel()
+ \qmlmethod PlaceSearchSuggestionModel::cancel()
- Cancels an ongoing text prediction query.
+ Cancels an ongoing search suggestion operation.
\sa execute(), status
*/
-QDeclarativeTextPredictionModel::QDeclarativeTextPredictionModel(QObject *parent)
+QDeclarativeSearchSuggestionModel::QDeclarativeSearchSuggestionModel(QObject *parent)
: QDeclarativeSearchModelBase(parent)
{
QHash<int, QByteArray> roleNames;
roleNames = QAbstractItemModel::roleNames();
- roleNames.insert(TextPredictionRole, "textPrediction");
+ roleNames.insert(SearchSuggestionRole, "suggestion");
setRoleNames(roleNames);
}
-QDeclarativeTextPredictionModel::~QDeclarativeTextPredictionModel()
+QDeclarativeSearchSuggestionModel::~QDeclarativeSearchSuggestionModel()
{
}
/*!
- \qmlproperty string TextPredictionModel::searchTerm
+ \qmlproperty string PlaceSearchSuggestionModel::searchTerm
This property holds the partial search term used in query.
*/
-QString QDeclarativeTextPredictionModel::searchTerm() const
+QString QDeclarativeSearchSuggestionModel::searchTerm() const
{
return m_request.searchTerm();
}
-void QDeclarativeTextPredictionModel::setSearchTerm(const QString &searchTerm)
+void QDeclarativeSearchSuggestionModel::setSearchTerm(const QString &searchTerm)
{
if (m_request.searchTerm() == searchTerm)
return;
@@ -197,40 +198,40 @@ void QDeclarativeTextPredictionModel::setSearchTerm(const QString &searchTerm)
}
/*!
- \qmlproperty QStringList TextPredictionModel::textPredictions
+ \qmlproperty QStringList PlaceSearchSuggestionModel::suggestions
This property holds the list of predicted search terms that the model currently has.
*/
-QStringList QDeclarativeTextPredictionModel::textPredictions() const
+QStringList QDeclarativeSearchSuggestionModel::suggestions() const
{
- return m_predictions;
+ return m_suggestions;
}
-void QDeclarativeTextPredictionModel::clearData()
+void QDeclarativeSearchSuggestionModel::clearData()
{
- m_predictions.clear();
+ m_suggestions.clear();
}
-void QDeclarativeTextPredictionModel::updateSearchRequest()
+void QDeclarativeSearchSuggestionModel::updateSearchRequest()
{
QDeclarativeSearchModelBase::updateSearchRequest();
}
-void QDeclarativeTextPredictionModel::processReply(QPlaceReply *reply)
+void QDeclarativeSearchSuggestionModel::processReply(QPlaceReply *reply)
{
- QPlaceTextPredictionReply *predictionReply = qobject_cast<QPlaceTextPredictionReply *>(reply);
- m_predictions = predictionReply->textPredictions();
- emit textPredictionsChanged();
+ QPlaceSearchSuggestionReply *suggestionReply = qobject_cast<QPlaceSearchSuggestionReply *>(reply);
+ m_suggestions = suggestionReply->suggestions();
+ emit suggestionsChanged();
}
-int QDeclarativeTextPredictionModel::rowCount(const QModelIndex& parent) const
+int QDeclarativeSearchSuggestionModel::rowCount(const QModelIndex& parent) const
{
Q_UNUSED(parent)
- return m_predictions.count();
+ return m_suggestions.count();
}
-QVariant QDeclarativeTextPredictionModel::data(const QModelIndex& index, int role) const
+QVariant QDeclarativeSearchSuggestionModel::data(const QModelIndex& index, int role) const
{
if (!index.isValid())
return QVariant();
@@ -240,15 +241,15 @@ QVariant QDeclarativeTextPredictionModel::data(const QModelIndex& index, int rol
switch (role) {
case Qt::DisplayRole:
- case TextPredictionRole:
- return m_predictions.at(index.row());
+ case SearchSuggestionRole:
+ return m_suggestions.at(index.row());
}
return QVariant();
}
-QPlaceReply *QDeclarativeTextPredictionModel::sendQuery(QPlaceManager *manager,
+QPlaceReply *QDeclarativeSearchSuggestionModel::sendQuery(QPlaceManager *manager,
const QPlaceSearchRequest &request)
{
- return manager->textPredictions(request);
+ return manager->searchSuggestions(request);
}
diff --git a/src/imports/location/declarativeplaces/qdeclarativetextpredictionmodel_p.h b/src/imports/location/declarativeplaces/qdeclarativesearchsuggestionmodel_p.h
index 6028bc2a..e96daf68 100644
--- a/src/imports/location/declarativeplaces/qdeclarativetextpredictionmodel_p.h
+++ b/src/imports/location/declarativeplaces/qdeclarativesearchsuggestionmodel_p.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QDECLARATIVETEXTPREDICTIONMODEL_P_H
-#define QDECLARATIVETEXTPREDICTIONMODEL_P_H
+#ifndef QDECLARATIVESEARCHSUGGESTIONMODEL_P_H
+#define QDECLARATIVESEARCHSUGGESTIONMODEL_P_H
#include "qdeclarativesearchmodelbase.h"
@@ -51,21 +51,21 @@ QT_BEGIN_NAMESPACE
class QDeclarativeGeoServiceProvider;
class QGeoServiceProvider;
-class QDeclarativeTextPredictionModel : public QDeclarativeSearchModelBase
+class QDeclarativeSearchSuggestionModel : public QDeclarativeSearchModelBase
{
Q_OBJECT
Q_PROPERTY(QString searchTerm READ searchTerm WRITE setSearchTerm NOTIFY searchTermChanged)
- Q_PROPERTY(QStringList textPredictions READ textPredictions NOTIFY textPredictionsChanged)
+ Q_PROPERTY(QStringList suggestions READ suggestions NOTIFY suggestionsChanged)
public:
- explicit QDeclarativeTextPredictionModel(QObject *parent = 0);
- ~QDeclarativeTextPredictionModel();
+ explicit QDeclarativeSearchSuggestionModel(QObject *parent = 0);
+ ~QDeclarativeSearchSuggestionModel();
QString searchTerm() const;
void setSearchTerm(const QString &searchTerm);
- QStringList textPredictions() const;
+ QStringList suggestions() const;
void clearData();
void updateSearchRequest();
@@ -75,20 +75,20 @@ public:
int rowCount(const QModelIndex &parent) const;
QVariant data(const QModelIndex &index, int role) const;
enum Roles {
- TextPredictionRole = Qt::UserRole
+ SearchSuggestionRole = Qt::UserRole
};
signals:
void searchTermChanged();
- void textPredictionsChanged();
+ void suggestionsChanged();
protected:
QPlaceReply *sendQuery(QPlaceManager *manager, const QPlaceSearchRequest &request);
private:
- QStringList m_predictions;
+ QStringList m_suggestions;
};
QT_END_NAMESPACE
-#endif // QDECLARATIVETEXTPREDICTIONMODEL_P_H
+#endif
diff --git a/src/imports/location/location.cpp b/src/imports/location/location.cpp
index a113a99e..3777e537 100644
--- a/src/imports/location/location.cpp
+++ b/src/imports/location/location.cpp
@@ -78,7 +78,7 @@
#include "qdeclarativerecommendationmodel_p.h"
#include "qdeclarativesupportedcategoriesmodel_p.h"
#include "qdeclarativesearchresultmodel_p.h"
-#include "qdeclarativetextpredictionmodel_p.h"
+#include "qdeclarativesearchsuggestionmodel_p.h"
#include <QtDeclarative/qdeclarativeextensionplugin.h>
#include <QtDeclarative/qdeclarative.h>
@@ -142,7 +142,7 @@ public:
qmlRegisterType<QDeclarativeRecommendationModel>(uri, 5, 0, "RecommendationModel");
qmlRegisterType<QDeclarativeSupportedCategoriesModel>(uri, 5, 0, "CategoryModel");
qmlRegisterType<QDeclarativeSearchResultModel>(uri, 5, 0, "PlaceSearchModel");
- qmlRegisterType<QDeclarativeTextPredictionModel>(uri, 5, 0, "TextPredictionModel");
+ qmlRegisterType<QDeclarativeSearchSuggestionModel>(uri, 5, 0, "PlaceSearchSuggestionModel");
qmlRegisterType<QDeclarativePropertyMap>(uri, 5,0,"ExtendedAttributes");
qmlRegisterType<QDeclarativePlaceAttribute>(uri, 5,0, "PlaceAttribute");
qmlRegisterType<QDeclarativeContactDetail>(uri, 5, 0, "ContactDetail");
diff --git a/src/imports/location/qdeclarativegeoserviceprovider_p.h b/src/imports/location/qdeclarativegeoserviceprovider_p.h
index 0629484c..f732e993 100644
--- a/src/imports/location/qdeclarativegeoserviceprovider_p.h
+++ b/src/imports/location/qdeclarativegeoserviceprovider_p.h
@@ -109,7 +109,7 @@ public:
SaveCategoryFeature = QPlaceManager:: SaveCategoryFeature,
RemoveCategoryFeature = QPlaceManager::RemoveCategoryFeature,
RecommendationsFeature = QPlaceManager::RecommendationsFeature,
- TextPredictionsFeature = QPlaceManager::TextPredictionsFeature,
+ SearchSuggestionsFeature = QPlaceManager::SearchSuggestionsFeature,
CorrectionsFeature = QPlaceManager::CorrectionsFeature,
LocaleFeature = QPlaceManager::LocaleFeature
};
diff --git a/src/location/places/places.pri b/src/location/places/places.pri
index c13c77ac..2960a44c 100644
--- a/src/location/places/places.pri
+++ b/src/location/places/places.pri
@@ -25,7 +25,7 @@ PUBLIC_HEADERS += \
places/qplacedetailsreply.h \
places/qplaceidreply.h \
places/qplacesearchreply.h \
- places/qplacetextpredictionreply.h \
+ places/qplacesearchsuggestionreply.h \
#manager and engine
places/qplacemanager.h \
places/qplacemanagerengine.h
@@ -72,7 +72,7 @@ SOURCES += \
places/qplacereply.cpp \
places/qplacedetailsreply.cpp \
places/qplacesearchreply.cpp \
- places/qplacetextpredictionreply.cpp \
+ places/qplacesearchsuggestionreply.cpp \
#manager and engine
places/qplacemanager.cpp \
places/qplacemanagerengine.cpp
diff --git a/src/location/places/qplacemanager.cpp b/src/location/places/qplacemanager.cpp
index bc3ed271..28d181a6 100644
--- a/src/location/places/qplacemanager.cpp
+++ b/src/location/places/qplacemanager.cpp
@@ -70,8 +70,8 @@ QT_BEGIN_NAMESPACE
\o Places can be classified as belonging to different categories. The
manager supports access to these categories.
\row
- \o Text predictions
- \o Given a partially complete search term, a list of potential complete
+ \o Search term suggestions
+ \o Given a partially complete search term, a list of potential
search terms can be given.
\row
\o Recommendations
@@ -139,7 +139,7 @@ QT_BEGIN_NAMESPACE
\value SaveCategoryFeature The manager can be used to save categories.
\value RemoveCategoryFeature The manager can be used to remove categories.
\value RecommendationsFeature The manager can be used to provide recommendations.
- \value TextPredictionsFeature The manager can be used to provide text predictions
+ \value SearchSuggestionsFeature The manager can be used to provide search term suggestions.
\value CorrectionsFeature The manager can be used to provide search term corrections
\value LocaleFeature The manager can be used to provide place data localized
according to locale
@@ -252,15 +252,15 @@ QPlaceSearchReply *QPlaceManager::recommendations(const QPlace &place, const QPl
}
/*!
- Requests a set of text predictions according to the parameters specified in \a request.
+ Requests a set of search term suggestions according to the parameters specified in \a request.
The \a request can hold the incomplete search term, along with other data such
as a search area to narrow down relevant results.
- See \l {Text Predictions} for an example of usage.
+ See \l {Search Suggestions} for an example of usage.
*/
-QPlaceTextPredictionReply *QPlaceManager::textPredictions(const QPlaceSearchRequest &request) const
+QPlaceSearchSuggestionReply *QPlaceManager::searchSuggestions(const QPlaceSearchRequest &request) const
{
- return d->textPredictions(request);
+ return d->searchSuggestions(request);
}
/*!
diff --git a/src/location/places/qplacemanager.h b/src/location/places/qplacemanager.h
index 128f1b85..96a42065 100644
--- a/src/location/places/qplacemanager.h
+++ b/src/location/places/qplacemanager.h
@@ -47,7 +47,7 @@
#include "qplaceidreply.h"
#include "qplacereply.h"
#include "qplacedetailsreply.h"
-#include "qplacetextpredictionreply.h"
+#include "qplacesearchsuggestionreply.h"
#include <QLocale>
#include <QVector>
@@ -60,8 +60,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-
-
class QPlaceManagerEngine;
class QPlaceSearchRequest;
class QPlaceSearchReply;
@@ -77,7 +75,7 @@ public:
SaveCategoryFeature = 0x4,
RemoveCategoryFeature = 0x8,
RecommendationsFeature = 0x10,
- TextPredictionsFeature = 0x20,
+ SearchSuggestionsFeature = 0x20,
CorrectionsFeature = 0x40,
LocaleFeature = 0x80,
NotificationsFeature = 0x100
@@ -99,7 +97,7 @@ public:
QPlaceSearchReply *recommendations(const QPlace &place, const QPlaceSearchRequest &request) const;
- QPlaceTextPredictionReply *textPredictions(const QPlaceSearchRequest &request) const;
+ QPlaceSearchSuggestionReply *searchSuggestions(const QPlaceSearchRequest &request) const;
QPlaceIdReply *savePlace(const QPlace &place);
QPlaceIdReply *removePlace(const QString &placeId);
diff --git a/src/location/places/qplacemanagerengine.cpp b/src/location/places/qplacemanagerengine.cpp
index 4864857e..76ce08df 100644
--- a/src/location/places/qplacemanagerengine.cpp
+++ b/src/location/places/qplacemanagerengine.cpp
@@ -175,9 +175,9 @@ QPlaceManagerEnginePrivate::~QPlaceManagerEnginePrivate()
*/
/*!
- \fn QPlaceTextPredictionReply *QPlaceManagerEngine::textPredictions(const QPlaceSearchRequest &request)
+ \fn QPlaceSearchSuggestionReply *QPlaceManagerEngine::searchSuggestions(const QPlaceSearchRequest &request)
- Requests a set of text predictions according to the parameters specified in \a request.
+ Requests a set of search term suggestions according to the parameters specified in \a request.
*/
/*!
diff --git a/src/location/places/qplacemanagerengine.h b/src/location/places/qplacemanagerengine.h
index 11cd0029..cc868971 100644
--- a/src/location/places/qplacemanagerengine.h
+++ b/src/location/places/qplacemanagerengine.h
@@ -70,7 +70,7 @@ public:
virtual QPlaceSearchReply *search(const QPlaceSearchRequest &request) = 0;
virtual QPlaceSearchReply *recommendations(const QPlace &place, const QPlaceSearchRequest &request) = 0;
- virtual QPlaceTextPredictionReply *textPredictions(const QPlaceSearchRequest &request) = 0;
+ virtual QPlaceSearchSuggestionReply *searchSuggestions(const QPlaceSearchRequest &request) = 0;
virtual QPlaceIdReply *savePlace(const QPlace &place) = 0;
virtual QPlaceIdReply *removePlace(const QString &placeId) = 0;
diff --git a/src/location/places/qplacereply.cpp b/src/location/places/qplacereply.cpp
index 2005cf2e..4354c128 100644
--- a/src/location/places/qplacereply.cpp
+++ b/src/location/places/qplacereply.cpp
@@ -106,9 +106,8 @@ QT_USE_NAMESPACE
This is a reply for the retrieval of place details
\value SearchReply
This is a reply for the place search operation.
-
- \value TextPredictionReply
- This is a reply for a text prediction operation.
+ \value SearchSuggestionReply
+ This is a reply for a search suggestion operation.
\value ContentReply
This is a reply for content associated with a place.
\value IdReply
diff --git a/src/location/places/qplacereply.h b/src/location/places/qplacereply.h
index a764fd57..ce5fa78e 100644
--- a/src/location/places/qplacereply.h
+++ b/src/location/places/qplacereply.h
@@ -75,7 +75,7 @@ public:
Reply,
DetailsReply,
SearchReply,
- TextPredictionReply,
+ SearchSuggestionReply,
ContentReply,
IdReply
};
diff --git a/src/location/places/qplacesearchrequest.cpp b/src/location/places/qplacesearchrequest.cpp
index 6ac5a7b7..548c20b9 100644
--- a/src/location/places/qplacesearchrequest.cpp
+++ b/src/location/places/qplacesearchrequest.cpp
@@ -175,9 +175,9 @@ void QPlaceSearchRequestPrivate::clear()
The QPlaceSearchRequest is primarily used with the QPlaceManager to
\l {QPlaceManager::search()} {search for places}, however it is also
- used to provide parameters for \l {QPlaceManager::textPredictions()}{generating text predictions}
+ used to provide parameters for \l {QPlaceManager::searchSuggestions()}{generating search term suggestions}
and \l {QPlaceManager::recommendations()} {retreiving recommendations}. Note that depending on usage,
- some parameters may not be relevant, e.g. the relevance hint is not important for text predictions. However
+ some parameters may not be relevant, e.g. the relevance hint is not important for search term suggestions. However
in general, most of the parameters are useful for each of these operations, eg for a recommendation, a search area
and categories can be useful in narrowing down recommendation candidates.
diff --git a/src/location/places/qplacetextpredictionreply.cpp b/src/location/places/qplacesearchsuggestionreply.cpp
index a7a54a96..b9c711ac 100644
--- a/src/location/places/qplacetextpredictionreply.cpp
+++ b/src/location/places/qplacesearchsuggestionreply.cpp
@@ -39,16 +39,16 @@
**
****************************************************************************/
-#include "qplacetextpredictionreply.h"
+#include "qplacesearchsuggestionreply.h"
#include "qplacereply_p.h"
QT_BEGIN_NAMESPACE
-class QPlaceTextPredictionReplyPrivate : public QPlaceReplyPrivate
+class QPlaceSearchSuggestionReplyPrivate : public QPlaceReplyPrivate
{
public:
- QPlaceTextPredictionReplyPrivate(){}
- QStringList textPredictions;
+ QPlaceSearchSuggestionReplyPrivate(){}
+ QStringList suggestions;
};
QT_END_NAMESPACE
@@ -56,57 +56,59 @@ QT_END_NAMESPACE
QT_USE_NAMESPACE
/*!
- \class QPlaceTextPredictionReply
+ \class QPlaceSearchSuggestionReply
\inmodule QtLocation
\ingroup QtLocation-places
\ingroup QtLocation-places-replies
\since QtLocation 5.0
- \brief The QPlaceTextPredictionReply class manages a text prediction operation started by an
+ \brief The QPlaceSearchSuggestionReply class manages a search suggestion operation started by an
instance of QPlaceManager.
- See \l {Text Predictions} for an example on how to use a text prediction reply.
+ On successful completion of the operation, the reply will contain a list of search term
+ suggestions.
+ See \l {Search Suggestions} for an example on how to use a search suggestion reply.
\sa QPlaceManager
*/
/*!
- Constructs a text prediction reply with a given \a parent.
+ Constructs a search suggestion reply with a given \a parent.
*/
-QPlaceTextPredictionReply::QPlaceTextPredictionReply(QObject *parent)
- : QPlaceReply(new QPlaceTextPredictionReplyPrivate, parent)
+QPlaceSearchSuggestionReply::QPlaceSearchSuggestionReply(QObject *parent)
+ : QPlaceReply(new QPlaceSearchSuggestionReplyPrivate, parent)
{
}
/*!
Destroys the reply.
*/
-QPlaceTextPredictionReply::~QPlaceTextPredictionReply()
+QPlaceSearchSuggestionReply::~QPlaceSearchSuggestionReply()
{
}
/*!
- Returns the text predictions.
+ Returns the search term suggestions.
*/
-QStringList QPlaceTextPredictionReply::textPredictions() const
+QStringList QPlaceSearchSuggestionReply::suggestions() const
{
- Q_D(const QPlaceTextPredictionReply);
- return d->textPredictions;
+ Q_D(const QPlaceSearchSuggestionReply);
+ return d->suggestions;
}
/*!
Returns type of reply.
*/
-QPlaceReply::Type QPlaceTextPredictionReply::type() const
+QPlaceReply::Type QPlaceSearchSuggestionReply::type() const
{
- return QPlaceReply::TextPredictionReply;
+ return QPlaceReply::SearchSuggestionReply;
}
/*!
- Sets the text \a predictions.
+ Sets the search term \a suggestions.
*/
-void QPlaceTextPredictionReply::setTextPredictions(const QStringList &predictions)
+void QPlaceSearchSuggestionReply::setSuggestions(const QStringList &suggestions)
{
- Q_D(QPlaceTextPredictionReply);
- d->textPredictions = predictions;
+ Q_D(QPlaceSearchSuggestionReply);
+ d->suggestions = suggestions;
}
diff --git a/src/location/places/qplacetextpredictionreply.h b/src/location/places/qplacesearchsuggestionreply.h
index 88338e56..3614715e 100644
--- a/src/location/places/qplacetextpredictionreply.h
+++ b/src/location/places/qplacesearchsuggestionreply.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QPLACETEXTPREDICTIONREPLY_H
-#define QPLACETEXTPREDICTIONREPLY_H
+#ifndef QPLACESEARCHSUGGESTIONREPLY_H
+#define QPLACESEARCHSUGGESTIONREPLY_H
#include "qplacereply.h"
@@ -50,26 +50,24 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
+class QPlaceSearchSuggestionReplyPrivate;
-
-class QPlaceTextPredictionReplyPrivate;
-
-class Q_LOCATION_EXPORT QPlaceTextPredictionReply : public QPlaceReply
+class Q_LOCATION_EXPORT QPlaceSearchSuggestionReply : public QPlaceReply
{
Q_OBJECT
public:
- explicit QPlaceTextPredictionReply(QObject *parent = 0);
- ~QPlaceTextPredictionReply();
+ explicit QPlaceSearchSuggestionReply(QObject *parent = 0);
+ ~QPlaceSearchSuggestionReply();
- QStringList textPredictions() const;
+ QStringList suggestions() const;
Type type() const;
protected:
- void setTextPredictions(const QStringList &predictions);
+ void setSuggestions(const QStringList &suggestions);
private:
- Q_DISABLE_COPY(QPlaceTextPredictionReply)
- Q_DECLARE_PRIVATE(QPlaceTextPredictionReply)
+ Q_DISABLE_COPY(QPlaceSearchSuggestionReply)
+ Q_DECLARE_PRIVATE(QPlaceSearchSuggestionReply)
};
QT_END_NAMESPACE
diff --git a/src/plugins/geoservices/nokia/places/qplacetextpredictionreplyimpl.cpp b/src/plugins/geoservices/nokia/places/qplacetextpredictionreplyimpl.cpp
index 63a95644..175284e6 100644
--- a/src/plugins/geoservices/nokia/places/qplacetextpredictionreplyimpl.cpp
+++ b/src/plugins/geoservices/nokia/places/qplacetextpredictionreplyimpl.cpp
@@ -60,7 +60,7 @@ QT_USE_NAMESPACE
Constructor.
*/
QPlaceTextPredictionReplyImpl::QPlaceTextPredictionReplyImpl(QPlaceRestReply *reply, QObject *parent) :
- QPlaceTextPredictionReply(parent),
+ QPlaceSearchSuggestionReply(parent),
restReply(reply)
{
parser = new QPlaceJSonTextPredictionParser(this);
@@ -107,7 +107,7 @@ void QPlaceTextPredictionReplyImpl::resultReady(const QPlaceJSonParser::Error &e
const QString &errorMessage)
{
if (errorId == QPlaceJSonParser::NoError) {
- setTextPredictions(parser->predictions());
+ setSuggestions(parser->predictions());
} else if (errorId == QPlaceJSonParser::ParsingError) {
setError(ParseError, errorMessage);
emit error(this->error(), this->errorString());
diff --git a/src/plugins/geoservices/nokia/places/qplacetextpredictionreplyimpl.h b/src/plugins/geoservices/nokia/places/qplacetextpredictionreplyimpl.h
index 81e3f5fa..3d7af51b 100644
--- a/src/plugins/geoservices/nokia/places/qplacetextpredictionreplyimpl.h
+++ b/src/plugins/geoservices/nokia/places/qplacetextpredictionreplyimpl.h
@@ -52,13 +52,13 @@
#include <QObject>
#include <QHash>
-#include <qplacetextpredictionreply.h>
+#include <qplacesearchsuggestionreply.h>
#include "qplacerestreply.h"
#include "qplacejsontextpredictionparser.h"
QT_BEGIN_NAMESPACE
-class QPlaceTextPredictionReplyImpl : public QPlaceTextPredictionReply
+class QPlaceTextPredictionReplyImpl : public QPlaceSearchSuggestionReply
{
Q_OBJECT
public:
diff --git a/src/plugins/geoservices/nokia/qplacemanagerengine_nokia.cpp b/src/plugins/geoservices/nokia/qplacemanagerengine_nokia.cpp
index 7a3715cc..559f82cb 100644
--- a/src/plugins/geoservices/nokia/qplacemanagerengine_nokia.cpp
+++ b/src/plugins/geoservices/nokia/qplacemanagerengine_nokia.cpp
@@ -217,7 +217,7 @@ QPlaceSearchReply *QPlaceManagerEngineNokia::recommendations(const QPlace &place
return reply;
}
-QPlaceTextPredictionReply *QPlaceManagerEngineNokia::textPredictions(const QPlaceSearchRequest &query)
+QPlaceSearchSuggestionReply *QPlaceManagerEngineNokia::searchSuggestions(const QPlaceSearchRequest &query)
{
QPlaceTextPredictionReplyImpl *reply = NULL;
QPlaceRestReply *restReply = QPlaceRestManager::instance()->sendSuggestionRequest(query);
@@ -325,7 +325,7 @@ QUrl QPlaceManagerEngineNokia::constructIconUrl(const QPlaceIcon &icon, const QS
QPlaceManager::ManagerFeatures QPlaceManagerEngineNokia::supportedFeatures() const
{
return QPlaceManager::RecommendationsFeature
- | QPlaceManager::TextPredictionsFeature
+ | QPlaceManager::SearchSuggestionsFeature
| QPlaceManager::CorrectionsFeature
| QPlaceManager::LocaleFeature;
}
diff --git a/src/plugins/geoservices/nokia/qplacemanagerengine_nokia.h b/src/plugins/geoservices/nokia/qplacemanagerengine_nokia.h
index edd29bf0..ac181da1 100644
--- a/src/plugins/geoservices/nokia/qplacemanagerengine_nokia.h
+++ b/src/plugins/geoservices/nokia/qplacemanagerengine_nokia.h
@@ -73,7 +73,7 @@ public:
QPlaceSearchReply *search(const QPlaceSearchRequest &query);
QPlaceSearchReply *recommendations(const QPlace &place, const QPlaceSearchRequest &query);
- QPlaceTextPredictionReply *textPredictions(const QPlaceSearchRequest &query);
+ QPlaceSearchSuggestionReply *searchSuggestions(const QPlaceSearchRequest &query);
QPlaceIdReply *savePlace(const QPlace &place);
QPlaceIdReply *removePlace(const QString &placeId);
diff --git a/src/plugins/geoservices/nokia_places_jsondb/qplacemanagerengine_jsondb.cpp b/src/plugins/geoservices/nokia_places_jsondb/qplacemanagerengine_jsondb.cpp
index aaad79a8..8063bcc5 100644
--- a/src/plugins/geoservices/nokia_places_jsondb/qplacemanagerengine_jsondb.cpp
+++ b/src/plugins/geoservices/nokia_places_jsondb/qplacemanagerengine_jsondb.cpp
@@ -148,11 +148,11 @@ QPlaceSearchReply *QPlaceManagerEngineJsonDb::recommendations(const QPlace &plac
return searchReply;
}
-QPlaceTextPredictionReply *QPlaceManagerEngineJsonDb::textPredictions(const QPlaceSearchRequest &request)
+QPlaceSearchSuggestionReply *QPlaceManagerEngineJsonDb::searchSuggestions(const QPlaceSearchRequest &request)
{
- TextPredictionReply *textPredictionReply = new TextPredictionReply(this);
- textPredictionReply->triggerDone(QPlaceReply::UnsupportedError, tr("Text prediction is unsupported"));
- return textPredictionReply;
+ SearchSuggestionReply *searchSuggestionReply = new SearchSuggestionReply(this);
+ searchSuggestionReply->triggerDone(QPlaceReply::UnsupportedError, tr("Search suggestions is unsupported"));
+ return searchSuggestionReply;
}
QPlaceIdReply *QPlaceManagerEngineJsonDb::savePlace(const QPlace &place)
diff --git a/src/plugins/geoservices/nokia_places_jsondb/qplacemanagerengine_jsondb.h b/src/plugins/geoservices/nokia_places_jsondb/qplacemanagerengine_jsondb.h
index f5e33e02..489b26ce 100644
--- a/src/plugins/geoservices/nokia_places_jsondb/qplacemanagerengine_jsondb.h
+++ b/src/plugins/geoservices/nokia_places_jsondb/qplacemanagerengine_jsondb.h
@@ -65,7 +65,7 @@ public:
QPlaceSearchReply *search(const QPlaceSearchRequest &request);
QPlaceSearchReply *recommendations(const QPlace &place, const QPlaceSearchRequest &request);
- QPlaceTextPredictionReply *textPredictions(const QPlaceSearchRequest &request);
+ QPlaceSearchSuggestionReply *searchSuggestions(const QPlaceSearchRequest &request);
QPlaceIdReply *savePlace(const QPlace &place);
QPlaceIdReply *removePlace(const QString &placeId);
@@ -97,7 +97,7 @@ private:
friend class SaveReply;
friend class MediaReply;
friend class RemoveReply;
- friend class TextPredictionReply;
+ friend class SearchSuggestionReply;
friend class ReviewReply;
friend class Reply;
friend class SearchReply;
diff --git a/src/plugins/geoservices/nokia_places_jsondb/unsupportedreplies.h b/src/plugins/geoservices/nokia_places_jsondb/unsupportedreplies.h
index 854ce720..82112295 100644
--- a/src/plugins/geoservices/nokia_places_jsondb/unsupportedreplies.h
+++ b/src/plugins/geoservices/nokia_places_jsondb/unsupportedreplies.h
@@ -43,7 +43,7 @@
#define UNSUPPORTED_REPLIES_H
#include <qplacecontentreply.h>
-#include <qplacetextpredictionreply.h>
+#include <qplacesearchsuggestionreply.h>
#include "macro.h"
#include "qplacemanagerengine_jsondb.h"
@@ -66,14 +66,14 @@ private:
};
-class TextPredictionReply : public QPlaceTextPredictionReply
+class SearchSuggestionReply : public QPlaceSearchSuggestionReply
{
Q_OBJECT
public:
- TextPredictionReply(QPlaceManagerEngineJsonDb *engine)
- : QPlaceTextPredictionReply(engine), m_engine(engine)
+ SearchSuggestionReply(QPlaceManagerEngineJsonDb *engine)
+ : QPlaceSearchSuggestionReply(engine), m_engine(engine)
{}
- virtual ~TextPredictionReply() {}
+ virtual ~SearchSuggestionReply() {}
DECLARE_TRIGGER_DONE_FN
diff --git a/tests/auto/declarative/tst_plugin.qml b/tests/auto/declarative/tst_plugin.qml
index e3f6609c..c357b9fb 100644
--- a/tests/auto/declarative/tst_plugin.qml
+++ b/tests/auto/declarative/tst_plugin.qml
@@ -117,7 +117,7 @@ Item {
function test_placesFeatures() {
verify((testPlugin.supportedPlacesFeatures & Plugin.SavePlaceFeature) === Plugin.SavePlaceFeature);
verify((testPlugin.supportedPlacesFeatures & Plugin.SaveCategoryFeature) === Plugin.SaveCategoryFeature);
- verify((testPlugin.supportedPlacesFeatures & Plugin.TextPredictionsFeature) === Plugin.TextPredictionsFeature);
+ verify((testPlugin.supportedPlacesFeatures & Plugin.SearchSuggestionsFeature) === Plugin.SearchSuggestionsFeature);
verify((testPlugin.supportedPlacesFeatures & Plugin.CorrectionsFeature) === 0);
verify((testPlugin.supportedPlacesFeatures & Plugin.RemovePlaceFeature) === 0);
@@ -126,7 +126,7 @@ Item {
verify((nokiaPlugin.supportedPlacesFeatures & Plugin.SaveCategoryFeature) === 0);
verify((nokiaPlugin.supportedPlacesFeatures & Plugin.RemoveCategoryFeature) === 0);
verify((nokiaPlugin.supportedPlacesFeatures & Plugin.RecommendationsFeature) === Plugin.RecommendationsFeature);
- verify((nokiaPlugin.supportedPlacesFeatures & Plugin.TextPredictionsFeature) === Plugin.TextPredictionsFeature);
+ verify((nokiaPlugin.supportedPlacesFeatures & Plugin.SearchSuggestionsFeature) === Plugin.SearchSuggestionsFeature);
verify((nokiaPlugin.supportedPlacesFeatures & Plugin.CorrectionsFeature) === Plugin.CorrectionsFeature);
verify((nokiaPlugin.supportedPlacesFeatures & Plugin.LocaleFeature) === Plugin.LocaleFeature);
diff --git a/tests/auto/geotestplugin/qplacemanagerengine_test.h b/tests/auto/geotestplugin/qplacemanagerengine_test.h
index 809879ca..8ad245bb 100644
--- a/tests/auto/geotestplugin/qplacemanagerengine_test.h
+++ b/tests/auto/geotestplugin/qplacemanagerengine_test.h
@@ -159,7 +159,7 @@ public:
return 0;
}
- QPlaceTextPredictionReply *textPredictions(const QPlaceSearchRequest &query)
+ QPlaceSearchSuggestionReply *searchSuggestions(const QPlaceSearchRequest &query)
{
Q_UNUSED(query)
@@ -269,7 +269,7 @@ public:
QPlaceManager::ManagerFeatures supportedFeatures() const {
return QPlaceManager::SavePlaceFeature
| QPlaceManager::SaveCategoryFeature
- | QPlaceManager::TextPredictionsFeature;
+ | QPlaceManager::SearchSuggestionsFeature;
}
private:
diff --git a/tests/auto/qplacemanager_jsondb/tst_qplacemanager_jsondb.cpp b/tests/auto/qplacemanager_jsondb/tst_qplacemanager_jsondb.cpp
index 029c0e86..88610296 100644
--- a/tests/auto/qplacemanager_jsondb/tst_qplacemanager_jsondb.cpp
+++ b/tests/auto/qplacemanager_jsondb/tst_qplacemanager_jsondb.cpp
@@ -49,7 +49,7 @@
#include <qplacemanager.h>
#include <qplacecategory.h>
#include <qplacecontentreply.h>
-#include <qplacetextpredictionreply.h>
+#include <qplacesearchsuggestionreply.h>
#include <qplacesearchrequest.h>
#include <qplacesearchresult.h>
#include <qplacesearchreply.h>
@@ -1032,10 +1032,10 @@ void tst_QPlaceManagerJsonDb::unsupportedFunctions()
QCOMPARE(contentReply->error(), QPlaceReply::UnsupportedError);
QPlaceSearchRequest searchRequest;
- QPlaceTextPredictionReply *textPredictionReply = placeManager->textPredictions(searchRequest);
- QSignalSpy textPredictionSpy(textPredictionReply, SIGNAL(finished()));
- QTRY_VERIFY(textPredictionSpy.count() == 1 );
- QCOMPARE(textPredictionReply->error(), QPlaceReply::UnsupportedError);
+ QPlaceSearchSuggestionReply *searchSuggestionReply = placeManager->searchSuggestions(searchRequest);
+ QSignalSpy searchSuggestionSpy(searchSuggestionReply, SIGNAL(finished()));
+ QTRY_VERIFY(searchSuggestionSpy.count() == 1 );
+ QCOMPARE(searchSuggestionReply->error(), QPlaceReply::UnsupportedError);
}
void tst_QPlaceManagerJsonDb::supportedFeatures()
@@ -1050,7 +1050,7 @@ void tst_QPlaceManagerJsonDb::supportedFeatures()
QPlaceManager::RemoveCategoryFeature);
QVERIFY((placeManager->supportedFeatures() & QPlaceManager::RecommendationsFeature) == 0);
- QVERIFY((placeManager->supportedFeatures() & QPlaceManager::TextPredictionsFeature) == 0);
+ QVERIFY((placeManager->supportedFeatures() & QPlaceManager::SearchSuggestionsFeature) == 0);
QVERIFY((placeManager->supportedFeatures() & QPlaceManager::CorrectionsFeature) == 0);
QVERIFY((placeManager->supportedFeatures() & QPlaceManager::LocaleFeature) == 0);
}