summaryrefslogtreecommitdiff
path: root/tests/auto/geotestplugin
diff options
context:
space:
mode:
authorabcd <qt-info@nokia.com>2011-07-08 14:18:39 +1000
committerabcd <qt_abcd1@ovi.com>2011-07-11 08:12:22 +0200
commit18c805cfd418a74cb2656d0c4a0fd7676786fb44 (patch)
treeec5e2cbcf70a352a2eeae3a976bcf0d6a43f738f /tests/auto/geotestplugin
parentea02345aeeff589cc342e1afd170a07d110180d8 (diff)
downloadqtlocation-18c805cfd418a74cb2656d0c4a0fd7676786fb44.tar.gz
Refactoring to use QGeoLocation
This refactoring is comprised of 2 main tasks. 1) Use QGeoLocation instead of QPlaceLocation, which came from the qt4-prerelease. 2) Use QGeoLocation instead of QGeoPlace from mobility. QGeoPlace in mobility encapsulated an address + coordinate, QGeoLocation in qt5 now fulfills that role(with some extra data fields) Mostly the searchreply and searchmanagers have been refactored to use qgeolocation instead of qgeoplace. This change addresses the library, plugins and tests but only some of the qml. Note the geosearchmanager in future will need to be refactored into a geocodingmanager, and there is still work needed on the qml side of things. Aside: the namings of mobility were used over the namings of the qt4 preprelease eg QPlaceLocation::displayPosition->QGeoLocation::coordinate QPlaceLocatoin::mapView->QGeoLocation::viewport. Change-Id: I312cddcb835ff52e94256c1fa97c6a9027eb9312 Reviewed-on: http://codereview.qt.nokia.com/1339 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: abcd <qt_abcd1@ovi.com>
Diffstat (limited to 'tests/auto/geotestplugin')
-rw-r--r--tests/auto/geotestplugin/qgeosearchmanagerengine_test.h36
1 files changed, 18 insertions, 18 deletions
diff --git a/tests/auto/geotestplugin/qgeosearchmanagerengine_test.h b/tests/auto/geotestplugin/qgeosearchmanagerengine_test.h
index a9705b1c..e5b21757 100644
--- a/tests/auto/geotestplugin/qgeosearchmanagerengine_test.h
+++ b/tests/auto/geotestplugin/qgeosearchmanagerengine_test.h
@@ -47,7 +47,7 @@
#include <QLocale>
#include <qlandmarkmanager.h>
#include <qgeoaddress.h>
-#include <qgeoplace.h>
+#include <qgeolocation.h>
#include <qgeosearchreply.h>
#include <QTimer>
@@ -62,12 +62,12 @@ class SearchReplyTest :public QGeoSearchReply
public:
SearchReplyTest(QObject *parent=0):QGeoSearchReply (parent) {}
- void callAddPlace ( const QGeoPlace & place ) {addPlace(place);}
+ void callAddLocation ( const QGeoLocation & location ) {addLocation(location);}
void callSetError ( Error error, const QString & errorString ) {setError(error, errorString);}
void callSetFinished ( bool finished ) {setFinished(finished);}
void callSetLimit ( int limit ) {setLimit(limit);}
void callSetOffset ( int offset ) {setOffset(offset);}
- void callSetPlaces ( const QList<QGeoPlace> & places ) {setPlaces(places);}
+ void callSetLocations ( const QList<QGeoLocation> & locations ) {setLocations(locations);}
void callSetViewport ( QGeoBoundingArea * viewport ) {setViewport(viewport);}
void abort() {
emit aborted();
@@ -127,8 +127,8 @@ public:
}
}
- // 2. Set the places into the reply
- setPlaces(searchReply_, address);
+ // 2. Set the locations into the reply
+ setLocations(searchReply_, address);
// 3. Finish the request
if (finishRequestImmediately_) {
@@ -158,34 +158,34 @@ public Q_SLOTS:
}
public:
- void setPlaces(SearchReplyTest* reply, const QString searchString, int limit )
+ void setLocations(SearchReplyTest* reply, const QString searchString, int limit )
{
for (int i = 0; i < limit; ++i) {
- QGeoPlace place;
+ QGeoLocation location;
QGeoAddress address;
address.setStreet(searchString);
- place.setAddress(address);
- reply->callAddPlace(place);
+ location.setAddress(address);
+ reply->callAddLocation(location);
}
}
- void setPlaces(SearchReplyTest* reply, const QGeoAddress& address)
+ void setLocations(SearchReplyTest* reply, const QGeoAddress& address)
{
int count = address.county().toInt();
for (int i = 0; i < count; ++i) {
- QGeoPlace place;
- place.setAddress(address);
- reply->callAddPlace(place);
+ QGeoLocation location;
+ location.setAddress(address);
+ reply->callAddLocation(location);
}
}
- void setPlaces(SearchReplyTest* reply, const QGeoCoordinate & coordinate)
+ void setLocations(SearchReplyTest* reply, const QGeoCoordinate & coordinate)
{
for (int i = 0; i < coordinate.longitude(); ++i) {
- QGeoPlace place;
- place.setCoordinate(coordinate);
- reply->callAddPlace(place);
+ QGeoLocation location;
+ location.setCoordinate(coordinate);
+ reply->callAddLocation(location);
}
}
@@ -194,7 +194,7 @@ public:
searchReply_ = new SearchReplyTest();
connect(searchReply_, SIGNAL(aborted()), this, SLOT(requestAborted()));
- setPlaces(searchReply_, coordinate);
+ setLocations(searchReply_, coordinate);
searchReply_->callSetViewport(bounds);
if (coordinate.latitude() > 70) {