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 /examples | |
parent | 8582e0312a5fbe9c926bf8c4b7dfdf4c3b3d7808 (diff) | |
download | qtlocation-b99ec9856b176ad0e944ba756ec7a23594505c3f.tar.gz |
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 'examples')
-rw-r--r-- | examples/declarative/mapviewer/mapviewer.qml | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/examples/declarative/mapviewer/mapviewer.qml b/examples/declarative/mapviewer/mapviewer.qml index 67c53b08..9fbbf266 100644 --- a/examples/declarative/mapviewer/mapviewer.qml +++ b/examples/declarative/mapviewer/mapviewer.qml @@ -526,7 +526,8 @@ Item { plugin = Qt.createQmlObject ('import QtLocation 5.0; Plugin{ name:"' + provider + '"; parameters: page.parameters}', page) else plugin = Qt.createQmlObject ('import QtLocation 5.0; Plugin{ name:"' + provider + '"}', page) - if (plugin.supportsMapping && plugin.supportsGeocoding && plugin.supportsReverseGeocoding && plugin.supportsRouting ){ + var wanted = (Plugin.MappingFeature | Plugin.GeocodingFeature | Plugin.ReverseGeocodingFeature | Plugin.RoutingFeature) + if ((plugin.supported & wanted) == wanted) { if (map) map.destroy() map = Qt.createQmlObject ('import QtLocation 5.0;\ import "content/map";\ @@ -574,12 +575,14 @@ Item { function getPlugins(){ var plugin = Qt.createQmlObject ('import QtLocation 5.0; Plugin {}', page) var tempPlugin + var wanted = (Plugin.MappingFeature | Plugin.GeocodingFeature | Plugin.ReverseGeocodingFeature | Plugin.RoutingFeature) var myArray = new Array() for (var i = 0; i<plugin.availableServiceProviders.length; i++){ tempPlugin = Qt.createQmlObject ('import QtLocation 5.0; Plugin {name: "' + plugin.availableServiceProviders[i]+ '"}', page) //note this will allocate all the plugin managers and resources - if (tempPlugin.supportsMapping && tempPlugin.supportsGeocoding && tempPlugin.supportsReverseGeocoding && tempPlugin.supportsRouting ) + if ((tempPlugin.supported & wanted) == wanted) { myArray.push(tempPlugin.name) + } } return myArray |