diff options
Diffstat (limited to 'src/imports/location')
-rw-r--r-- | src/imports/location/declarativeplaces/qdeclarativeplace.cpp | 2 | ||||
-rw-r--r-- | src/imports/location/declarativeplaces/qdeclarativeplaceicon.cpp | 2 | ||||
-rw-r--r-- | src/imports/location/error_messages.cpp | 43 | ||||
-rw-r--r-- | src/imports/location/error_messages.h | 31 | ||||
-rw-r--r-- | src/imports/location/location.cpp | 15 | ||||
-rw-r--r-- | src/imports/location/qdeclarativegeocodemodel.cpp | 17 | ||||
-rw-r--r-- | src/imports/location/qdeclarativegeomap.cpp | 6 | ||||
-rw-r--r-- | src/imports/location/qdeclarativegeoroutemodel.cpp | 30 | ||||
-rw-r--r-- | src/imports/location/qdeclarativepolygonmapitem.cpp | 4 | ||||
-rw-r--r-- | src/imports/location/qdeclarativepolylinemapitem.cpp | 4 |
10 files changed, 53 insertions, 101 deletions
diff --git a/src/imports/location/declarativeplaces/qdeclarativeplace.cpp b/src/imports/location/declarativeplaces/qdeclarativeplace.cpp index 985de8db..ce57d335 100644 --- a/src/imports/location/declarativeplaces/qdeclarativeplace.cpp +++ b/src/imports/location/declarativeplaces/qdeclarativeplace.cpp @@ -1187,7 +1187,7 @@ QPlaceManager *QDeclarativePlace::manager() } if (!m_plugin) { - qmlInfo(this) << QCoreApplication::translate(CONTEXT_NAME, PLUGIN_NOT_ASSIGNED_TO_PLACE); + qmlInfo(this) << QStringLiteral("Plugin is not assigned to place."); return 0; } diff --git a/src/imports/location/declarativeplaces/qdeclarativeplaceicon.cpp b/src/imports/location/declarativeplaces/qdeclarativeplaceicon.cpp index a2906916..ae42b626 100644 --- a/src/imports/location/declarativeplaces/qdeclarativeplaceicon.cpp +++ b/src/imports/location/declarativeplaces/qdeclarativeplaceicon.cpp @@ -221,7 +221,7 @@ void QDeclarativePlaceIcon::pluginReady() QPlaceManager *QDeclarativePlaceIcon::manager() const { if (!m_plugin) { - qmlInfo(this) << QCoreApplication::translate(CONTEXT_NAME, PLUGIN_NOT_ASSIGNED_TO_PLACE_ICON); + qmlInfo(this) << QStringLiteral("Plugin is not assigned to place."); return 0; } diff --git a/src/imports/location/error_messages.cpp b/src/imports/location/error_messages.cpp index 208a1d32..7a400fff 100644 --- a/src/imports/location/error_messages.cpp +++ b/src/imports/location/error_messages.cpp @@ -44,47 +44,18 @@ QT_BEGIN_NAMESPACE const char CONTEXT_NAME[] = "QtLocationQML"; -const char PLUGIN_DOESNOT_SUPPORT_ROUTING[] = QT_TRANSLATE_NOOP("QtLocationQML", "Error: Plugin does not support routing.\nError message: %1"); -const char PLUGIN_DOESNOT_SUPPORT_MAPPING[] = QT_TRANSLATE_NOOP("QtLocationQML", "Error: Plugin does not support mapping.\nError message: %1"); -const char PLUGIN_DOESNOT_SUPPORT_GEOCODING[] = QT_TRANSLATE_NOOP("QtLocationQML", "Error: Plugin does not support (reverse) geocoding.\nError message: %1"); +//to-be-translated error string -const char NOT_SUPPORTED_BY[] = QT_TRANSLATE_NOOP("QtLocationQML", "%1 not supported by %2 plugin."); const char PLUGIN_PROPERTY_NOT_SET[] = QT_TRANSLATE_NOOP("QtLocationQML", "Plugin property is not set."); const char PLUGIN_ERROR[] = QT_TRANSLATE_NOOP("QtLocationQML", "Plugin Error (%1): %2"); -const char PLUGIN_PROVIDER_ERROR[] = QT_TRANSLATE_NOOP("QtLocationQML", "Plugin Error (%1): Could not instantiate provider %1"); +const char PLUGIN_PROVIDER_ERROR[] = QT_TRANSLATE_NOOP("QtLocationQML", "Plugin Error (%1): Could not instantiate provider"); const char PLUGIN_NOT_VALID[] = QT_TRANSLATE_NOOP("QtLocationQML", "Plugin is not valid"); -const char PLUGIN_NOT_ASSIGNED_TO_PLACE[] = QT_TRANSLATE_NOOP("QtLocationQML", "Plugin is not assigned to place."); -const char PLUGIN_NOT_ASSIGNED_TO_PLACE_ICON[] = QT_TRANSLATE_NOOP("QtLocationQML", "Plugin is not assigned to place icon."); const char CATEGORIES_NOT_INITIALIZED[] = QT_TRANSLATE_NOOP("QtLocationQML", "Unable to initialize categories"); -const char NOT_INSTANTIABLE_BY_DEVELOPER[] = QT_TRANSLATE_NOOP("QtLocationQML", "%1 is not intended instantiable by developer."); - -const char UNSUPPORTED_BOUND_TYPE[] = QT_TRANSLATE_NOOP("QtLocationQML", "Unsupported bound type (Box and Circle supported)"); -const char UNSUPPORTED_QUERY_TYPE[] = QT_TRANSLATE_NOOP("QtLocationQML", "Unsupported query type for geocode model (coordinate, string and Address supported)."); -const char PLUGIN_SET_ONCE[] = QT_TRANSLATE_NOOP("QtLocationQML", "Plugin is a write-once property, and cannot be set again."); - -const char PINCH_ROTATE_GESTURE_ACTIVATED[] = QT_TRANSLATE_NOOP("QtLocationQML", "Pinchrotation gesture activated. Note that it is experimental feature."); -const char PINCH_TILT_GESTURE_ACTIVATED[] = QT_TRANSLATE_NOOP("QtLocationQML", "Pinchtilt gesture activated. Note that it is experimental feature."); - -const char INDEX_INVALID[] = QT_TRANSLATE_NOOP("QtLocationQML", "Error, invalid index for get(): %1"); -const char INDEX_OUT_OF_RANGE[] = QT_TRANSLATE_NOOP("QtLocationQML", "Error, too big or small index in get(): %1"); - -const char MODEL_INDEX_INVALID[] = QT_TRANSLATE_NOOP("QtLocationQML", "Error in indexing route model's data (invalid index)."); -const char MODEL_INDEX_OUT_OF_RANGE[] = QT_TRANSLATE_NOOP("QtLocationQML", "Fatal error in indexing route model's data (index overflow)."); - -const char GEOCODE_PLUGIN_NOT_SET[] = QT_TRANSLATE_NOOP("QtLocationQML", "Cannot geocode, plugin not set."); -const char GEOCODE_MGR_NOT_SET[] = QT_TRANSLATE_NOOP("QtLocationQML", "Cannot geocode, geocode manager not set."); -const char GEOCODE_QUERY_NOT_SET[] = QT_TRANSLATE_NOOP("QtLocationQML", "Cannot geocode, valid query not set."); - -const char ROUTE_PLUGIN_NOT_SET[] = QT_TRANSLATE_NOOP("QtLocationQML", "Cannot route, plugin not set."); -const char ROUTE_MGR_NOT_SET[] = QT_TRANSLATE_NOOP("QtLocationQML", "Cannot route, route manager not set."); -const char ROUTE_QUERY_NOT_SET[] = QT_TRANSLATE_NOOP("QtLocationQML", "Cannot route, valid query not set."); -const char ROUTE_WAYPOINTS_NOT_SET[] = QT_TRANSLATE_NOOP("QtLocationQML", "Not enough waypoints for routing."); - -const char CANNOT_REMOVE_AREA[] = QT_TRANSLATE_NOOP("QtLocationQML", "Cannot remove nonexistent area."); -const char CANNOT_ADD_INVALID_WAYPOINT[] = QT_TRANSLATE_NOOP("QtLocationQML", "Not adding invalid waypoint."); -const char CANNOT_REMOVE_WAYPOINT[] = QT_TRANSLATE_NOOP("QtLocationQML", "Cannot remove nonexistent waypoint."); -const char COORD_NOT_BELONG_TO[] = QT_TRANSLATE_NOOP("QtLocationQML", "Coordinate does not belong to %1"); -const char MISSED_NMEA_FILE[] = QT_TRANSLATE_NOOP("QtLocationQML", "Nmea file not found."); const char UNABLE_TO_MAKE_REQUEST[]= QT_TRANSLATE_NOOP("QtLocationQML", "Unable to create request"); +//often used but only visible to developer -> no translation required +const char ROUTE_PLUGIN_NOT_SET[] = "Cannot route, plugin not set."; +const char ROUTE_MGR_NOT_SET[] = "Cannot route, route manager not set."; +const char COORD_NOT_BELONG_TO[] = "Coordinate does not belong to %1"; + QT_END_NAMESPACE diff --git a/src/imports/location/error_messages.h b/src/imports/location/error_messages.h index 07da92e9..62a71442 100644 --- a/src/imports/location/error_messages.h +++ b/src/imports/location/error_messages.h @@ -1,4 +1,3 @@ - /**************************************************************************** ** ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). @@ -48,45 +47,17 @@ QT_BEGIN_NAMESPACE extern const char CONTEXT_NAME[]; -extern const char PLUGIN_DOESNOT_SUPPORT_MAPPING[]; -extern const char PLUGIN_DOESNOT_SUPPORT_ROUTING[]; -extern const char PLUGIN_DOESNOT_SUPPORT_GEOCODING[]; - extern const char PLUGIN_PROPERTY_NOT_SET[]; extern const char PLUGIN_ERROR[]; extern const char PLUGIN_PROVIDER_ERROR[]; extern const char PLUGIN_NOT_VALID[]; -extern const char PLUGIN_NOT_ASSIGNED_TO_PLACE[]; -extern const char PLUGIN_NOT_ASSIGNED_TO_PLACE_ICON[]; -extern const char CATEGORIES_NOT_INITIALIZED[]; -extern const char NOT_INSTANTIABLE_BY_DEVELOPER[]; - -extern const char UNSUPPORTED_BOUND_TYPE[]; -extern const char UNSUPPORTED_QUERY_TYPE[]; -extern const char PLUGIN_SET_ONCE[]; -extern const char PINCH_ROTATE_GESTURE_ACTIVATED[]; -extern const char PINCH_TILT_GESTURE_ACTIVATED[]; - -extern const char INDEX_INVALID[]; -extern const char INDEX_OUT_OF_RANGE[]; -extern const char MODEL_INDEX_INVALID[]; -extern const char MODEL_INDEX_OUT_OF_RANGE[]; - -extern const char GEOCODE_PLUGIN_NOT_SET[]; -extern const char GEOCODE_MGR_NOT_SET[]; -extern const char GEOCODE_QUERY_NOT_SET[]; +extern const char CATEGORIES_NOT_INITIALIZED[]; extern const char ROUTE_PLUGIN_NOT_SET[]; extern const char ROUTE_MGR_NOT_SET[]; -extern const char ROUTE_QUERY_NOT_SET[]; -extern const char ROUTE_WAYPOINTS_NOT_SET[]; -extern const char CANNOT_REMOVE_AREA[]; -extern const char CANNOT_ADD_INVALID_WAYPOINT[]; -extern const char CANNOT_REMOVE_WAYPOINT[]; extern const char COORD_NOT_BELONG_TO[]; -extern const char MISSED_NMEA_FILE[]; extern const char UNABLE_TO_MAKE_REQUEST[]; QT_END_NAMESPACE diff --git a/src/imports/location/location.cpp b/src/imports/location/location.cpp index 9f68178e..7308c4eb 100644 --- a/src/imports/location/location.cpp +++ b/src/imports/location/location.cpp @@ -101,10 +101,12 @@ public: qmlRegisterType<QDeclarativeGeoServiceProvider>(uri, 5, 0, "Plugin"); qmlRegisterType<QDeclarativeGeoServiceProviderParameter>(uri, 5, 0, "PluginParameter"); - qmlRegisterUncreatableType<QDeclarativeGeoServiceProviderRequirements>(uri, 5, 0, "PluginRequirements", QCoreApplication::translate(CONTEXT_NAME, NOT_INSTANTIABLE_BY_DEVELOPER).arg("PluginRequirements")); + qmlRegisterUncreatableType<QDeclarativeGeoServiceProviderRequirements>(uri, 5, 0, "PluginRequirements", + QStringLiteral("PluginRequirements is not intended instantiable by developer.")); qmlRegisterType<QDeclarativeGeoMap>(uri, 5, 0, "Map"); - qmlRegisterUncreatableType<QDeclarativeGeoMapItemBase>(uri, 5, 0, "GeoMapItemBase", QCoreApplication::translate(CONTEXT_NAME, NOT_INSTANTIABLE_BY_DEVELOPER).arg("GeoMapItemBase")); + qmlRegisterUncreatableType<QDeclarativeGeoMapItemBase>(uri, 5, 0, "GeoMapItemBase", + QStringLiteral("HeoMapItemBase is not intended instantiable by developer.")); qmlRegisterType<QDeclarativeGeoMapQuickItem>(uri, 5, 0, "MapQuickItem"); qmlRegisterType<QDeclarativeGeoMapItemView>(uri, 5, 0, "MapItemView"); @@ -114,9 +116,12 @@ public: qmlRegisterType<QDeclarativeGeoRoute>(uri, 5, 0, "Route"); // data type qmlRegisterType<QDeclarativeGeoRouteSegment>(uri, 5, 0, "RouteSegment"); qmlRegisterType<QDeclarativeGeoManeuver>(uri, 5, 0, "RouteManeuver"); - qmlRegisterUncreatableType<QDeclarativeGeoMapPinchEvent>(uri, 5, 0, "MapPinchEvent", QCoreApplication::translate(CONTEXT_NAME, NOT_INSTANTIABLE_BY_DEVELOPER).arg("(Map)PinchEvent")); - qmlRegisterUncreatableType<QDeclarativeGeoMapGestureArea>(uri, 5, 0, "MapGestureArea", QCoreApplication::translate(CONTEXT_NAME, NOT_INSTANTIABLE_BY_DEVELOPER).arg("(Map)GestureArea")); - qmlRegisterUncreatableType<QDeclarativeGeoMapType>(uri, 5, 0, "MapType", QCoreApplication::translate(CONTEXT_NAME, NOT_INSTANTIABLE_BY_DEVELOPER).arg("MapType")); + qmlRegisterUncreatableType<QDeclarativeGeoMapPinchEvent>(uri, 5, 0, "MapPinchEvent", + QStringLiteral("(Map)PinchEvent is not intended instantiable by developer.")); + qmlRegisterUncreatableType<QDeclarativeGeoMapGestureArea>(uri, 5, 0, "MapGestureArea", + QStringLiteral("(Map)HestureArea is not intended instantiable by developer.")); + qmlRegisterUncreatableType<QDeclarativeGeoMapType>(uri, 5, 0, "MapType", + QStringLiteral("MapType is not intended instantiable by developer.")); qmlRegisterType<QDeclarativeCategory>(uri, 5, 0, "Category"); qmlRegisterType<QDeclarativePlaceEditorialModel>(uri, 5, 0, "EditorialModel"); qmlRegisterType<QDeclarativePlaceImageModel>(uri, 5, 0, "ImageModel"); diff --git a/src/imports/location/qdeclarativegeocodemodel.cpp b/src/imports/location/qdeclarativegeocodemodel.cpp index 2159e70a..a4cec374 100644 --- a/src/imports/location/qdeclarativegeocodemodel.cpp +++ b/src/imports/location/qdeclarativegeocodemodel.cpp @@ -146,7 +146,7 @@ void QDeclarativeGeocodeModel::update() return; if (!plugin_) { - qmlInfo(this) << QCoreApplication::translate(CONTEXT_NAME, GEOCODE_PLUGIN_NOT_SET); + qmlInfo(this) << QStringLiteral("Cannot geocode, plugin not set."); return; } @@ -156,12 +156,12 @@ void QDeclarativeGeocodeModel::update() QGeoCodingManager *geocodingManager = serviceProvider->geocodingManager(); if (!geocodingManager) { - qmlInfo(this) << QCoreApplication::translate(CONTEXT_NAME, GEOCODE_MGR_NOT_SET); + qmlInfo(this) << QStringLiteral("Cannot geocode, geocode manager not set."); return; } if (!coordinate_.isValid() && (!address_ || address_->address().isEmpty()) && (searchString_.isEmpty())) { - qmlInfo(this) << QCoreApplication::translate(CONTEXT_NAME, GEOCODE_QUERY_NOT_SET); + qmlInfo(this) << QStringLiteral("Cannot geocode, valid query not set."); return; } abortRequest(); // abort possible previous requests @@ -288,7 +288,8 @@ void QDeclarativeGeocodeModel::pluginReady() QGeoServiceProvider *serviceProvider = plugin_->sharedGeoServiceProvider(); QGeoCodingManager *geocodingManager = serviceProvider->geocodingManager(); if (!geocodingManager || serviceProvider->error() != QGeoServiceProvider::NoError) { - qmlInfo(this) << QCoreApplication::translate(CONTEXT_NAME, PLUGIN_DOESNOT_SUPPORT_GEOCODING).arg(serviceProvider->errorString()); + qmlInfo(this) << QStringLiteral("Error: Plugin does not support (reverse) geocoding.\nError message:") + << serviceProvider->errorString(); return; } connect(geocodingManager, SIGNAL(finished(QGeoCodeReply*)), @@ -510,7 +511,7 @@ int QDeclarativeGeocodeModel::count() const QDeclarativeGeoLocation *QDeclarativeGeocodeModel::get(int index) { if (index < 0 || index >= declarativeLocations_.count()) { - qmlInfo(this) << QCoreApplication::translate(CONTEXT_NAME, INDEX_OUT_OF_RANGE).arg(index); + qmlInfo(this) << QStringLiteral("Index '%1' out of range").arg(index); return 0; } return declarativeLocations_.at(index); @@ -662,11 +663,13 @@ void QDeclarativeGeocodeModel::setQuery(const QVariant &query) connect(address_, SIGNAL(streetChanged()), this, SLOT(queryContentChanged())); connect(address_, SIGNAL(postalCodeChanged()), this, SLOT(queryContentChanged())); } else { - qmlInfo(this) << QCoreApplication::translate(CONTEXT_NAME, UNSUPPORTED_QUERY_TYPE); + qmlInfo(this) << QStringLiteral("Unsupported query type for geocode model ") + << QStringLiteral("(coordinate, string and Address supported)."); return; } } else { - qmlInfo(this) << QCoreApplication::translate(CONTEXT_NAME, UNSUPPORTED_QUERY_TYPE); + qmlInfo(this) << QStringLiteral("Unsupported query type for geocode model ") + << QStringLiteral("(coordinate, string and Address supported)."); return; } diff --git a/src/imports/location/qdeclarativegeomap.cpp b/src/imports/location/qdeclarativegeomap.cpp index a4d86b84..4e12e422 100644 --- a/src/imports/location/qdeclarativegeomap.cpp +++ b/src/imports/location/qdeclarativegeomap.cpp @@ -278,8 +278,8 @@ void QDeclarativeGeoMap::pluginReady() mappingManager_ = serviceProvider_->mappingManager(); if (!mappingManager_ || serviceProvider_->error() != QGeoServiceProvider::NoError) { - QString msg = QCoreApplication::translate(CONTEXT_NAME, PLUGIN_DOESNOT_SUPPORT_MAPPING).arg(serviceProvider_->errorString()); - qmlInfo(this) << msg; + qmlInfo(this) << QStringLiteral("Error: Plugin does not support mapping.\nError message:") + << serviceProvider_->errorString(); return; } @@ -445,7 +445,7 @@ QSGNode *QDeclarativeGeoMap::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeDa void QDeclarativeGeoMap::setPlugin(QDeclarativeGeoServiceProvider *plugin) { if (plugin_) { - qmlInfo(this) << QCoreApplication::translate(CONTEXT_NAME, PLUGIN_SET_ONCE); + qmlInfo(this) << QStringLiteral("Plugin is a write-once property, and cannot be set again."); return; } plugin_ = plugin; diff --git a/src/imports/location/qdeclarativegeoroutemodel.cpp b/src/imports/location/qdeclarativegeoroutemodel.cpp index 829398cf..5db8b9ec 100644 --- a/src/imports/location/qdeclarativegeoroutemodel.cpp +++ b/src/imports/location/qdeclarativegeoroutemodel.cpp @@ -222,7 +222,8 @@ void QDeclarativeGeoRouteModel::abortRequest() QDeclarativeGeoRoute *QDeclarativeGeoRouteModel::get(int index) { if (index < 0 || index >= routes_.count()) { - qmlInfo(this) << QCoreApplication::translate(CONTEXT_NAME, INDEX_INVALID).arg(index); + qmlInfo(this) << QStringLiteral("Error, invalid index for get():") + << index; return 0; } return routes_.at(index); @@ -254,12 +255,12 @@ int QDeclarativeGeoRouteModel::rowCount(const QModelIndex &parent) const QVariant QDeclarativeGeoRouteModel::data(const QModelIndex &index, int role) const { if (!index.isValid()) { - qmlInfo(this) << QCoreApplication::translate(CONTEXT_NAME, MODEL_INDEX_INVALID); + qmlInfo(this) << QStringLiteral("Error in indexing route model's data (invalid index)."); return QVariant(); } if (index.row() >= routes_.count()) { - qmlInfo(this) << QCoreApplication::translate(CONTEXT_NAME, MODEL_INDEX_OUT_OF_RANGE); + qmlInfo(this) << QStringLiteral("Fatal error in indexing route model's data (index overflow)."); return QVariant(); } @@ -316,7 +317,8 @@ void QDeclarativeGeoRouteModel::pluginReady() QGeoServiceProvider *serviceProvider = plugin_->sharedGeoServiceProvider(); QGeoRoutingManager *routingManager = serviceProvider->routingManager(); if (!routingManager || serviceProvider->error() != QGeoServiceProvider::NoError) { - qmlInfo(this) << QCoreApplication::translate(CONTEXT_NAME, PLUGIN_DOESNOT_SUPPORT_ROUTING).arg(serviceProvider->errorString()); + qmlInfo(this) << QStringLiteral("Error: Plugin does not support routing.\nError message:") + << serviceProvider->errorString(); return; } connect(routingManager, SIGNAL(finished(QGeoRouteReply*)), @@ -427,7 +429,7 @@ bool QDeclarativeGeoRouteModel::autoUpdate() const void QDeclarativeGeoRouteModel::setMeasurementSystem(QLocale::MeasurementSystem ms) { if (!plugin_) { - qmlInfo(this) << QCoreApplication::translate(CONTEXT_NAME, ROUTE_PLUGIN_NOT_SET); + qmlInfo(this) << ROUTE_PLUGIN_NOT_SET; return; } @@ -437,7 +439,7 @@ void QDeclarativeGeoRouteModel::setMeasurementSystem(QLocale::MeasurementSystem QGeoRoutingManager *routingManager = serviceProvider->routingManager(); if (!routingManager) { - qmlInfo(this) << QCoreApplication::translate(CONTEXT_NAME, ROUTE_MGR_NOT_SET); + qmlInfo(this) << ROUTE_MGR_NOT_SET; return; } @@ -463,7 +465,7 @@ QLocale::MeasurementSystem QDeclarativeGeoRouteModel::measurementSystem() const QGeoRoutingManager *routingManager = serviceProvider->routingManager(); if (!routingManager) { - qmlInfo(this) << QCoreApplication::translate(CONTEXT_NAME, ROUTE_MGR_NOT_SET); + qmlInfo(this) << ROUTE_MGR_NOT_SET; if (plugin_->locales().isEmpty()) return QLocale().measurementSystem(); @@ -575,7 +577,7 @@ void QDeclarativeGeoRouteModel::update() return; if (!plugin_) { - qmlInfo(this) << QCoreApplication::translate(CONTEXT_NAME, ROUTE_PLUGIN_NOT_SET); + qmlInfo(this) << ROUTE_PLUGIN_NOT_SET; return; } @@ -585,17 +587,17 @@ void QDeclarativeGeoRouteModel::update() QGeoRoutingManager *routingManager = serviceProvider->routingManager(); if (!routingManager) { - qmlInfo(this) << QCoreApplication::translate(CONTEXT_NAME, ROUTE_MGR_NOT_SET); + qmlInfo(this) << ROUTE_MGR_NOT_SET; return; } if (!routeQuery_) { - qmlInfo(this) << QCoreApplication::translate(CONTEXT_NAME, ROUTE_QUERY_NOT_SET); + qmlInfo(this) << QStringLiteral("Cannot route, valid query not set."); return; } abortRequest(); // Clear previus requests QGeoRouteRequest request = routeQuery_->routeRequest(); if (request.waypoints().count() < 2) { - qmlInfo(this) << QCoreApplication::translate(CONTEXT_NAME, ROUTE_WAYPOINTS_NOT_SET); + qmlInfo(this) << QStringLiteral("Not enough waypoints for routing."); return; } @@ -952,7 +954,7 @@ void QDeclarativeGeoRouteQuery::removeExcludedArea(const QGeoRectangle &area) int index = excludedAreas.lastIndexOf(area); if (index == -1) { - qmlInfo(this) << QCoreApplication::translate(CONTEXT_NAME, CANNOT_REMOVE_AREA); + qmlInfo(this) << QStringLiteral("Cannot remove nonexistent area."); return; } excludedAreas.removeAt(index); @@ -992,7 +994,7 @@ void QDeclarativeGeoRouteQuery::clearExcludedAreas() void QDeclarativeGeoRouteQuery::addWaypoint(const QGeoCoordinate &waypoint) { if (!waypoint.isValid()) { - qmlInfo(this) << QCoreApplication::translate(CONTEXT_NAME, CANNOT_ADD_INVALID_WAYPOINT); + qmlInfo(this) << QStringLiteral("Not adding invalid waypoint."); return; } @@ -1021,7 +1023,7 @@ void QDeclarativeGeoRouteQuery::removeWaypoint(const QGeoCoordinate &waypoint) int index = waypoints.lastIndexOf(waypoint); if (index == -1) { - qmlInfo(this) << QCoreApplication::translate(CONTEXT_NAME, CANNOT_REMOVE_WAYPOINT); + qmlInfo(this) << QStringLiteral("Cannot remove nonexistent waypoint."); return; } diff --git a/src/imports/location/qdeclarativepolygonmapitem.cpp b/src/imports/location/qdeclarativepolygonmapitem.cpp index 55261ed1..1bd7fd10 100644 --- a/src/imports/location/qdeclarativepolygonmapitem.cpp +++ b/src/imports/location/qdeclarativepolygonmapitem.cpp @@ -469,12 +469,12 @@ void QDeclarativePolygonMapItem::removeCoordinate(const QGeoCoordinate &coordina int index = path_.lastIndexOf(coordinate); if (index == -1) { - qmlInfo(this) << QCoreApplication::translate(CONTEXT_NAME, COORD_NOT_BELONG_TO).arg("PolygonMapItem"); + qmlInfo(this) << COORD_NOT_BELONG_TO << QStringLiteral("PolygonMapItem"); return; } if (path_.count() < index + 1) { - qmlInfo(this) << QCoreApplication::translate(CONTEXT_NAME, COORD_NOT_BELONG_TO).arg("PolygonMapItem"); + qmlInfo(this) << COORD_NOT_BELONG_TO << QStringLiteral("PolygonMapItem"); return; } path_.removeAt(index); diff --git a/src/imports/location/qdeclarativepolylinemapitem.cpp b/src/imports/location/qdeclarativepolylinemapitem.cpp index 65b61da1..83ed76b5 100644 --- a/src/imports/location/qdeclarativepolylinemapitem.cpp +++ b/src/imports/location/qdeclarativepolylinemapitem.cpp @@ -574,12 +574,12 @@ void QDeclarativePolylineMapItem::removeCoordinate(const QGeoCoordinate &coordin int index = path_.lastIndexOf(coordinate); if (index == -1) { - qmlInfo(this) << QCoreApplication::translate(CONTEXT_NAME, COORD_NOT_BELONG_TO).arg("PolylineMapItem"); + qmlInfo(this) << COORD_NOT_BELONG_TO << QStringLiteral("PolylineMapItem"); return; } if (path_.count() < index + 1) { - qmlInfo(this) << QCoreApplication::translate(CONTEXT_NAME, COORD_NOT_BELONG_TO).arg("PolylineMapItem"); + qmlInfo(this) << COORD_NOT_BELONG_TO << QStringLiteral("PolylineMapItem"); return; } path_.removeAt(index); |