summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCristian Adam <cristian.adam@nokia.com>2012-05-07 12:37:11 +0200
committerQt by Nokia <qt-info@nokia.com>2012-05-08 01:03:53 +0200
commit88b6015918d6b113a45ea514bbd8083873609486 (patch)
tree520c18125e4265377c25704a257d6a869413bc08
parentb7e24e32a602fa1e580562159976dcb3910245d9 (diff)
downloadqtlocation-88b6015918d6b113a45ea514bbd8083873609486.tar.gz
Do not completely ignore plugin error messages
If a plugin decides not to create a manager (mapping, geo, places etc) its error message is at least displayed in the debugger output window. Task-number: QTBUG-25672 Change-Id: Ic56544ff06188a701959a88f604f56c9a0ec65dc Reviewed-by: Alex Wilson <alex.wilson@nokia.com>
-rw-r--r--src/imports/location/declarativeplaces/qdeclarativeplace.cpp3
-rw-r--r--src/imports/location/declarativeplaces/qdeclarativeplaceicon.cpp3
-rw-r--r--src/imports/location/qdeclarativegeocodemodel.cpp3
-rw-r--r--src/imports/location/qdeclarativegeomap.cpp3
-rw-r--r--src/imports/location/qdeclarativegeoroutemodel.cpp3
-rw-r--r--src/location/maps/qgeoserviceprovider.cpp2
6 files changed, 11 insertions, 6 deletions
diff --git a/src/imports/location/declarativeplaces/qdeclarativeplace.cpp b/src/imports/location/declarativeplaces/qdeclarativeplace.cpp
index 69ed041a..da47650e 100644
--- a/src/imports/location/declarativeplaces/qdeclarativeplace.cpp
+++ b/src/imports/location/declarativeplaces/qdeclarativeplace.cpp
@@ -247,7 +247,8 @@ void QDeclarativePlace::pluginReady()
QGeoServiceProvider *serviceProvider = m_plugin->sharedGeoServiceProvider();
QPlaceManager *placeManager = serviceProvider->placeManager();
if (!placeManager || serviceProvider->error() != QGeoServiceProvider::NoError) {
- qmlInfo(this) << tr("Warning: Plugin does not support places.");
+ qmlInfo(this) << tr("Warning: Plugin does not support places. Error message: %1")
+ .arg(serviceProvider->errorString());
return;
}
}
diff --git a/src/imports/location/declarativeplaces/qdeclarativeplaceicon.cpp b/src/imports/location/declarativeplaces/qdeclarativeplaceicon.cpp
index 5ddcd3fa..fecacf45 100644
--- a/src/imports/location/declarativeplaces/qdeclarativeplaceicon.cpp
+++ b/src/imports/location/declarativeplaces/qdeclarativeplaceicon.cpp
@@ -205,7 +205,8 @@ void QDeclarativePlaceIcon::pluginReady()
QGeoServiceProvider *serviceProvider = m_plugin->sharedGeoServiceProvider();
QPlaceManager *placeManager = serviceProvider->placeManager();
if (!placeManager || serviceProvider->error() != QGeoServiceProvider::NoError) {
- qmlInfo(this) << tr("Warning: Plugin does not support places.");
+ qmlInfo(this) << tr("Warning: Plugin does not support places. Error message: %1")
+ .arg(serviceProvider->errorString());
return;
}
}
diff --git a/src/imports/location/qdeclarativegeocodemodel.cpp b/src/imports/location/qdeclarativegeocodemodel.cpp
index b89feab1..f5d5809f 100644
--- a/src/imports/location/qdeclarativegeocodemodel.cpp
+++ b/src/imports/location/qdeclarativegeocodemodel.cpp
@@ -306,7 +306,8 @@ void QDeclarativeGeocodeModel::pluginReady()
QGeoServiceProvider *serviceProvider = plugin_->sharedGeoServiceProvider();
QGeocodingManager *geocodingManager = serviceProvider->geocodingManager();
if (!geocodingManager || serviceProvider->error() != QGeoServiceProvider::NoError) {
- qmlInfo(this) << tr("Warning: Plugin does not support (reverse) geocoding.");
+ qmlInfo(this) << tr("Warning: Plugin does not support (reverse) geocoding. Error message: %1")
+ .arg(serviceProvider->errorString());
return;
}
connect(geocodingManager, SIGNAL(finished(QGeocodeReply*)),
diff --git a/src/imports/location/qdeclarativegeomap.cpp b/src/imports/location/qdeclarativegeomap.cpp
index ff5cc0b3..891e2c2c 100644
--- a/src/imports/location/qdeclarativegeomap.cpp
+++ b/src/imports/location/qdeclarativegeomap.cpp
@@ -282,7 +282,8 @@ void QDeclarativeGeoMap::pluginReady()
mappingManager_ = serviceProvider_->mappingManager();
if (!mappingManager_ || serviceProvider_->error() != QGeoServiceProvider::NoError) {
- qmlInfo(this) << tr("Warning: Plugin does not support mapping.");
+ qmlInfo(this) << tr("Warning: Plugin does not support mapping. Error message: %1")
+ .arg(serviceProvider_->errorString());
return;
}
diff --git a/src/imports/location/qdeclarativegeoroutemodel.cpp b/src/imports/location/qdeclarativegeoroutemodel.cpp
index fbc5bbd3..d3d0d0db 100644
--- a/src/imports/location/qdeclarativegeoroutemodel.cpp
+++ b/src/imports/location/qdeclarativegeoroutemodel.cpp
@@ -296,7 +296,8 @@ void QDeclarativeGeoRouteModel::pluginReady()
QGeoServiceProvider *serviceProvider = plugin_->sharedGeoServiceProvider();
QGeoRoutingManager *routingManager = serviceProvider->routingManager();
if (!routingManager || serviceProvider->error() != QGeoServiceProvider::NoError) {
- qmlInfo(this) << tr("Warning: Plugin does not support routing.");
+ qmlInfo(this) << tr("Warning: Plugin does not support routing. Error message: %1")
+ .arg(serviceProvider->errorString());
return;
}
connect(routingManager, SIGNAL(finished(QGeoRouteReply*)),
diff --git a/src/location/maps/qgeoserviceprovider.cpp b/src/location/maps/qgeoserviceprovider.cpp
index d03b3510..0a2833ee 100644
--- a/src/location/maps/qgeoserviceprovider.cpp
+++ b/src/location/maps/qgeoserviceprovider.cpp
@@ -263,7 +263,7 @@ Manager *QGeoServiceProviderPrivate::manager(QGeoServiceProvider::Error *_error,
engine->setManagerVersion(
int(this->metaData.value(QStringLiteral("Version")).toDouble()));
manager = new Manager(engine);
- } else {
+ } else if (error == QGeoServiceProvider::NoError) {
error = QGeoServiceProvider::NotSupportedError;
errorString = QLatin1String("The service provider does not support the ");
errorString.append(QLatin1String(Manager::staticMetaObject.className()));