summaryrefslogtreecommitdiff
path: root/tests/auto/qgeoroutingmanagerplugins
diff options
context:
space:
mode:
authorAlex Wilson <alex.wilson@nokia.com>2012-02-28 13:05:02 +1000
committerQt by Nokia <qt-info@nokia.com>2012-03-05 04:22:24 +0100
commit0287bfee05840511c12100f06f9142e3e2b8f7d5 (patch)
treef5386e27a4b012877d37ab0b99dfc1d5a08705c5 /tests/auto/qgeoroutingmanagerplugins
parentc1d56bdae90f79d466769aa7a357d78a4f2ca6c7 (diff)
downloadqtlocation-0287bfee05840511c12100f06f9142e3e2b8f7d5.tar.gz
New plugin API changes, centralized geoservice feature detection
This change adapts geoservice plugins to use the new Qt5 plugin API, performing boolean feature detection all through the JSON blobs rather than methods on factories or managers. As a result of this centralisation, it was also necessary to rework the QML API for the Plugin element a little. Some additional changes were made to the declarative places plugin to prevent it crashing due to plugins becoming available later than they did previously. Task-number: QTBUG-24331 Change-Id: I26149987344b67091480449103ab1712c869b2a5 Reviewed-by: Aaron McCarthy <aaron.mccarthy@nokia.com>
Diffstat (limited to 'tests/auto/qgeoroutingmanagerplugins')
-rw-r--r--tests/auto/qgeoroutingmanagerplugins/qgeoroutingmanagerengine_test.h3
-rw-r--r--tests/auto/qgeoroutingmanagerplugins/qgeoroutingmanagerplugins.pro3
-rw-r--r--tests/auto/qgeoroutingmanagerplugins/qgeoserviceproviderplugin_test.cpp17
-rw-r--r--tests/auto/qgeoroutingmanagerplugins/qgeoserviceproviderplugin_test.h9
-rw-r--r--tests/auto/qgeoroutingmanagerplugins/routing_plugin.json12
5 files changed, 19 insertions, 25 deletions
diff --git a/tests/auto/qgeoroutingmanagerplugins/qgeoroutingmanagerengine_test.h b/tests/auto/qgeoroutingmanagerplugins/qgeoroutingmanagerengine_test.h
index 0736e3d1..6fd61132 100644
--- a/tests/auto/qgeoroutingmanagerplugins/qgeoroutingmanagerengine_test.h
+++ b/tests/auto/qgeoroutingmanagerplugins/qgeoroutingmanagerengine_test.h
@@ -61,9 +61,6 @@ public:
{
Q_UNUSED(error)
Q_UNUSED(errorString)
- setSupportsRouteUpdates(true);
- setSupportsAlternativeRoutes(true);
- setSupportsExcludeAreas(true);
setSupportedTravelModes(QGeoRouteRequest::PedestrianTravel);
setSupportedFeatureTypes(QGeoRouteRequest::TollFeature);
setSupportedFeatureWeights(QGeoRouteRequest::PreferFeatureWeight);
diff --git a/tests/auto/qgeoroutingmanagerplugins/qgeoroutingmanagerplugins.pro b/tests/auto/qgeoroutingmanagerplugins/qgeoroutingmanagerplugins.pro
index c5a39d3e..e2a3f6c4 100644
--- a/tests/auto/qgeoroutingmanagerplugins/qgeoroutingmanagerplugins.pro
+++ b/tests/auto/qgeoroutingmanagerplugins/qgeoroutingmanagerplugins.pro
@@ -12,3 +12,6 @@ SOURCES += qgeoserviceproviderplugin_test.cpp
target.path += $$[QT_INSTALL_PLUGINS]/geoservices
INSTALLS += target
+
+OTHER_FILES += \
+ routing_plugin.json
diff --git a/tests/auto/qgeoroutingmanagerplugins/qgeoserviceproviderplugin_test.cpp b/tests/auto/qgeoroutingmanagerplugins/qgeoserviceproviderplugin_test.cpp
index 01549e30..177a4e5d 100644
--- a/tests/auto/qgeoroutingmanagerplugins/qgeoserviceproviderplugin_test.cpp
+++ b/tests/auto/qgeoroutingmanagerplugins/qgeoserviceproviderplugin_test.cpp
@@ -52,25 +52,8 @@ QGeoServiceProviderFactoryTest::~QGeoServiceProviderFactoryTest()
{
}
-QString QGeoServiceProviderFactoryTest::providerName() const
-{
- return "static.georoute.test.plugin";
-}
-
-QStringList QGeoServiceProviderFactoryTest::keys() const
-{
- return QStringList() << QLatin1String("static.georoute.test.plugin");
-}
-
-int QGeoServiceProviderFactoryTest::providerVersion() const
-{
- return 2;
-}
-
QGeoRoutingManagerEngine* QGeoServiceProviderFactoryTest::createRoutingManagerEngine(const QMap<
QString, QVariant> &parameters, QGeoServiceProvider::Error *error, QString *errorString) const
{
return new QGeoRoutingManagerEngineTest(parameters, error, errorString);
}
-
-Q_EXPORT_PLUGIN2(qtgeoservices_staticroutingplugin, QGeoServiceProviderFactoryTest)
diff --git a/tests/auto/qgeoroutingmanagerplugins/qgeoserviceproviderplugin_test.h b/tests/auto/qgeoroutingmanagerplugins/qgeoserviceproviderplugin_test.h
index 611ff702..e1c100ad 100644
--- a/tests/auto/qgeoroutingmanagerplugins/qgeoserviceproviderplugin_test.h
+++ b/tests/auto/qgeoroutingmanagerplugins/qgeoserviceproviderplugin_test.h
@@ -50,15 +50,14 @@ QT_USE_NAMESPACE
class QGeoServiceProviderFactoryTest: public QObject, public QGeoServiceProviderFactory
{
Q_OBJECT
- Q_INTERFACES(QGeoServiceProviderFactory:QFactoryInterface)
+ Q_INTERFACES(QGeoServiceProviderFactory)
+ Q_PLUGIN_METADATA(IID "org.qt-project.qt.geoservice.serviceproviderfactory/5.0"
+ FILE "routing_plugin.json")
+
public:
QGeoServiceProviderFactoryTest();
~QGeoServiceProviderFactoryTest();
- QString providerName() const;
- int providerVersion() const;
- QStringList keys() const;
-
QGeoRoutingManagerEngine* createRoutingManagerEngine(const QMap<QString, QVariant> &parameters,
QGeoServiceProvider::Error *error, QString *errorString) const;
diff --git a/tests/auto/qgeoroutingmanagerplugins/routing_plugin.json b/tests/auto/qgeoroutingmanagerplugins/routing_plugin.json
new file mode 100644
index 00000000..25905f60
--- /dev/null
+++ b/tests/auto/qgeoroutingmanagerplugins/routing_plugin.json
@@ -0,0 +1,12 @@
+{
+ "Keys": ["georoute.test.plugin"],
+ "Provider": "georoute.test.plugin",
+ "Version": 100,
+ "Experimental": true,
+ "Features": [
+ "OfflineRoutingFeature",
+ "RouteUpdatesFeature",
+ "AlternativeRoutesFeature",
+ "ExcludeAreasRoutingFeature"
+ ]
+}