diff options
author | Alex Wilson <alex.wilson@nokia.com> | 2012-01-06 10:56:51 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-01-06 05:58:49 +0100 |
commit | b99ec9856b176ad0e944ba756ec7a23594505c3f (patch) | |
tree | 3b6ef996b3f541b7ca9291cd72b83c759210f515 /src/imports/location/qdeclarativegeocodemodel.cpp | |
parent | 8582e0312a5fbe9c926bf8c4b7dfdf4c3b3d7808 (diff) |
Change Plugin{} element API to use enums for features
Notably, this change also sets up Map{} elements to delay probing their
set plugin until the plugin is complete, so that requiredFeatures
can function correctly without support for changing plugins
dynamically.
Please note: the necessary docs for these new methods and updates
to the already extant docs related to this will be in a separate
commit.
Change-Id: I36ae230ecdc07e3499331dddb251a331637405cd
Reviewed-by: David Laing <david.laing@nokia.com>
Diffstat (limited to 'src/imports/location/qdeclarativegeocodemodel.cpp')
-rw-r--r-- | src/imports/location/qdeclarativegeocodemodel.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/imports/location/qdeclarativegeocodemodel.cpp b/src/imports/location/qdeclarativegeocodemodel.cpp index 2166f2eb..ca8c60ca 100644 --- a/src/imports/location/qdeclarativegeocodemodel.cpp +++ b/src/imports/location/qdeclarativegeocodemodel.cpp @@ -223,6 +223,16 @@ void QDeclarativeGeocodeModel::setPlugin(QDeclarativeGeoServiceProvider *plugin) if (!plugin) return; + if (plugin_->ready()) { + pluginReady(); + } else { + connect(plugin_, SIGNAL(supportedFeaturesChanged(PluginFeatures)), + this, SLOT(pluginReady())); + } +} + +void QDeclarativeGeocodeModel::pluginReady() +{ QGeoServiceProvider *serviceProvider = plugin_->sharedGeoServiceProvider(); QGeocodingManager *geocodingManager = serviceProvider->geocodingManager(); if (!geocodingManager || serviceProvider->error() != QGeoServiceProvider::NoError) { |