summaryrefslogtreecommitdiff
path: root/tests/auto/placesplugin_unsupported
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/placesplugin_unsupported
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/placesplugin_unsupported')
-rw-r--r--tests/auto/placesplugin_unsupported/placesplugin.json8
-rw-r--r--tests/auto/placesplugin_unsupported/placesplugin_unsupported.pro3
-rw-r--r--tests/auto/placesplugin_unsupported/qgeoserviceproviderplugin_test.cpp17
-rw-r--r--tests/auto/placesplugin_unsupported/qgeoserviceproviderplugin_test.h8
4 files changed, 14 insertions, 22 deletions
diff --git a/tests/auto/placesplugin_unsupported/placesplugin.json b/tests/auto/placesplugin_unsupported/placesplugin.json
new file mode 100644
index 00000000..6749962a
--- /dev/null
+++ b/tests/auto/placesplugin_unsupported/placesplugin.json
@@ -0,0 +1,8 @@
+{
+ "Keys": ["test.places.unsupported"],
+ "Provider": "test.places.unsupported",
+ "Version": 1,
+ "Experimental": true,
+ "Features": [
+ ]
+}
diff --git a/tests/auto/placesplugin_unsupported/placesplugin_unsupported.pro b/tests/auto/placesplugin_unsupported/placesplugin_unsupported.pro
index 126e673e..5bbf6bc7 100644
--- a/tests/auto/placesplugin_unsupported/placesplugin_unsupported.pro
+++ b/tests/auto/placesplugin_unsupported/placesplugin_unsupported.pro
@@ -11,3 +11,6 @@ SOURCES += qgeoserviceproviderplugin_test.cpp
target.path += $$[QT_INSTALL_PLUGINS]/geoservices
INSTALLS += target
+
+OTHER_FILES += \
+ placesplugin.json
diff --git a/tests/auto/placesplugin_unsupported/qgeoserviceproviderplugin_test.cpp b/tests/auto/placesplugin_unsupported/qgeoserviceproviderplugin_test.cpp
index be33c6e9..ba4b6832 100644
--- a/tests/auto/placesplugin_unsupported/qgeoserviceproviderplugin_test.cpp
+++ b/tests/auto/placesplugin_unsupported/qgeoserviceproviderplugin_test.cpp
@@ -52,21 +52,6 @@ QGeoServiceProviderFactoryTest::~QGeoServiceProviderFactoryTest()
{
}
-QString QGeoServiceProviderFactoryTest::providerName() const
-{
- return "test.places.unsupported";
-}
-
-QStringList QGeoServiceProviderFactoryTest::keys() const
-{
- return QStringList() << QLatin1String("test.places.unsupported");
-}
-
-int QGeoServiceProviderFactoryTest::providerVersion() const
-{
- return 1;
-}
-
QPlaceManagerEngine *QGeoServiceProviderFactoryTest::createPlaceManagerEngine(
const QMap<QString, QVariant> &parameters,
QGeoServiceProvider::Error *error, QString *errorString) const
@@ -76,5 +61,3 @@ QPlaceManagerEngine *QGeoServiceProviderFactoryTest::createPlaceManagerEngine(
return new QPlaceManagerEngine(parameters);
}
-
-Q_EXPORT_PLUGIN2(qtgeoservices_placesplugin_unsupported, QGeoServiceProviderFactoryTest)
diff --git a/tests/auto/placesplugin_unsupported/qgeoserviceproviderplugin_test.h b/tests/auto/placesplugin_unsupported/qgeoserviceproviderplugin_test.h
index fb90fed5..6e7b0962 100644
--- a/tests/auto/placesplugin_unsupported/qgeoserviceproviderplugin_test.h
+++ b/tests/auto/placesplugin_unsupported/qgeoserviceproviderplugin_test.h
@@ -49,16 +49,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 "placesplugin.json")
public:
QGeoServiceProviderFactoryTest();
~QGeoServiceProviderFactoryTest();
- QString providerName() const;
- int providerVersion() const;
- QStringList keys() const;
-
QPlaceManagerEngine *createPlaceManagerEngine(const QMap<QString, QVariant> &parameters,
QGeoServiceProvider::Error *error,
QString *errorString) const;