summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Blasche <alexander.blasche@digia.com>2014-02-14 14:56:37 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-02-26 08:31:17 +0100
commit6b3defc1ebd54e87efeea7e0fb545c62b26bb85d (patch)
tree7f85eb9662e41476bdb446c54688fca7ebb44f4d
parente656c31890dc382fafe03c4b9abf55565d2a3073 (diff)
downloadqtlocation-6b3defc1ebd54e87efeea7e0fb545c62b26bb85d.tar.gz
Fix translatable strings and cleanup unnecessary strings
1.) Reduces the amount of translatable strings as console/qmlInfo() output is not translated. 2.) Unused error messages have been removed 3.) Additional translation hints have been added. Change-Id: I59ef36bd75ab1f6d4878657212884e1251b8a04e Reviewed-by: Aaron McCarthy <mccarthy.aaron@gmail.com>
-rw-r--r--src/imports/location/declarativeplaces/qdeclarativeplace.cpp2
-rw-r--r--src/imports/location/declarativeplaces/qdeclarativeplaceicon.cpp2
-rw-r--r--src/imports/location/error_messages.cpp43
-rw-r--r--src/imports/location/error_messages.h31
-rw-r--r--src/imports/location/location.cpp15
-rw-r--r--src/imports/location/qdeclarativegeocodemodel.cpp17
-rw-r--r--src/imports/location/qdeclarativegeomap.cpp6
-rw-r--r--src/imports/location/qdeclarativegeoroutemodel.cpp30
-rw-r--r--src/imports/location/qdeclarativepolygonmapitem.cpp4
-rw-r--r--src/imports/location/qdeclarativepolylinemapitem.cpp4
-rw-r--r--src/imports/positioning/error_messages.cpp48
-rw-r--r--src/imports/positioning/error_messages.h54
-rw-r--r--src/imports/positioning/positioning.pro2
-rw-r--r--src/imports/positioning/qdeclarativepositionsource.cpp3
-rw-r--r--src/plugins/geoservices/nokia/qgeotiledmappingmanagerengine_nokia.cpp4
-rw-r--r--src/plugins/geoservices/osm/qgeotiledmappingmanagerengineosm.cpp4
16 files changed, 58 insertions, 211 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);
diff --git a/src/imports/positioning/error_messages.cpp b/src/imports/positioning/error_messages.cpp
deleted file mode 100644
index 45b85e0a..00000000
--- a/src/imports/positioning/error_messages.cpp
+++ /dev/null
@@ -1,48 +0,0 @@
-/***************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtPositioning module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "error_messages.h"
-
-QT_BEGIN_NAMESPACE
-
-const char CONTEXT_NAME[] = "QtPositioningQML";
-const char MISSED_NMEA_FILE[] = QT_TRANSLATE_NOOP("QtPositioningQML", "Nmea file not found.");
-
-QT_END_NAMESPACE
diff --git a/src/imports/positioning/error_messages.h b/src/imports/positioning/error_messages.h
deleted file mode 100644
index 3c888dff..00000000
--- a/src/imports/positioning/error_messages.h
+++ /dev/null
@@ -1,54 +0,0 @@
-
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtPositioning module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#ifndef ERROR_MESSAGES_H
-#define ERROR_MESSAGES_H
-
-#include <QString>
-
-QT_BEGIN_NAMESPACE
-
-extern const char CONTEXT_NAME[];
-extern const char MISSED_NMEA_FILE[];
-
-QT_END_NAMESPACE
-
-#endif // ERROR_MESSAGES_H
diff --git a/src/imports/positioning/positioning.pro b/src/imports/positioning/positioning.pro
index 6af459d8..d07dbce9 100644
--- a/src/imports/positioning/positioning.pro
+++ b/src/imports/positioning/positioning.pro
@@ -11,7 +11,6 @@ HEADERS += qdeclarativeposition_p.h \
qdeclarativegeocircle.h \
locationvaluetypeprovider.h \
locationsingleton.h \
- error_messages.h \
qdeclarativegeocoordinateanimation_p.h
SOURCES += qdeclarativeposition.cpp \
@@ -23,7 +22,6 @@ SOURCES += qdeclarativeposition.cpp \
qdeclarativegeocircle.cpp \
locationvaluetypeprovider.cpp \
locationsingleton.cpp \
- error_messages.cpp \
qdeclarativegeocoordinateanimation.cpp
load(qml_plugin)
diff --git a/src/imports/positioning/qdeclarativepositionsource.cpp b/src/imports/positioning/qdeclarativepositionsource.cpp
index fe2a3e56..f8239aa0 100644
--- a/src/imports/positioning/qdeclarativepositionsource.cpp
+++ b/src/imports/positioning/qdeclarativepositionsource.cpp
@@ -41,7 +41,6 @@
#include "qdeclarativepositionsource_p.h"
#include "qdeclarativeposition_p.h"
-#include "error_messages.h"
#include <QtCore/QCoreApplication>
#include <QtQml/qqmlinfo.h>
@@ -290,7 +289,7 @@ void QDeclarativePositionSource::setNmeaSource(const QUrl &nmeaSource)
QTimer::singleShot(0, this, SLOT(start()));
}
} else {
- qmlInfo(this) << QCoreApplication::translate(CONTEXT_NAME, MISSED_NMEA_FILE) << localFileName;
+ qmlInfo(this) << QStringLiteral("Nmea file not found") << localFileName;
#ifdef QDECLARATIVE_POSITION_DEBUG
qDebug() << "QDeclarativePositionSource NMEA File was not found: " << localFileName;
#endif
diff --git a/src/plugins/geoservices/nokia/qgeotiledmappingmanagerengine_nokia.cpp b/src/plugins/geoservices/nokia/qgeotiledmappingmanagerengine_nokia.cpp
index e7f1fec7..4342d337 100644
--- a/src/plugins/geoservices/nokia/qgeotiledmappingmanagerengine_nokia.cpp
+++ b/src/plugins/geoservices/nokia/qgeotiledmappingmanagerengine_nokia.cpp
@@ -88,12 +88,12 @@ QGeoTiledMappingManagerEngineNokia::QGeoTiledMappingManagerEngineNokia(
types << QGeoMapType(QGeoMapType::TerrainMap, tr("Terrain Map"), tr("Terrain map view in daylight mode"), false, 3);
types << QGeoMapType(QGeoMapType::HybridMap, tr("Hybrid Map"), tr("Satellite map view with streets in daylight mode"), false, 4);
types << QGeoMapType(QGeoMapType::TransitMap, tr("Transit Map"), tr("Color-reduced map view with public transport scheme in daylight mode"), false, 5);
- types << QGeoMapType(QGeoMapType::GrayStreetMap, tr("Gray Street Map"), tr("Color-reduced map view in daylight mode (especially used for background maps)"), false, 6);
+ types << QGeoMapType(QGeoMapType::GrayStreetMap, tr("Gray Street Map"), tr("Color-reduced map view in daylight mode"), false, 6);
types << QGeoMapType(QGeoMapType::StreetMap, tr("Mobile Street Map"), tr("Mobile normal map view in daylight mode"), true, 7);
types << QGeoMapType(QGeoMapType::TerrainMap, tr("Mobile Terrain Map"), tr("Mobile terrain map view in daylight mode"), true, 8);
types << QGeoMapType(QGeoMapType::HybridMap, tr("Mobile Hybrid Map"), tr("Mobile satellite map view with streets in daylight mode"), true, 9);
types << QGeoMapType(QGeoMapType::TransitMap, tr("Mobile Transit Map"), tr("Mobile color-reduced map view with public transport scheme in daylight mode"), true, 10);
- types << QGeoMapType(QGeoMapType::GrayStreetMap, tr("Mobile Gray Street Map"), tr("Mobile color-reduced map view in daylight mode (especially used for background maps)"), true, 11);
+ types << QGeoMapType(QGeoMapType::GrayStreetMap, tr("Mobile Gray Street Map"), tr("Mobile color-reduced map view in daylight mode"), true, 11);
types << QGeoMapType(QGeoMapType::StreetMap, tr("Custom Street Map"), tr("Normal map view in daylight mode"), false, 12);
types << QGeoMapType(QGeoMapType::StreetMap, tr("Night Street Map"), tr("Normal map view in night mode"), false, 13);
types << QGeoMapType(QGeoMapType::StreetMap, tr("Mobile Night Street Map"), tr("Mobile normal map view in night mode"), true, 14);
diff --git a/src/plugins/geoservices/osm/qgeotiledmappingmanagerengineosm.cpp b/src/plugins/geoservices/osm/qgeotiledmappingmanagerengineosm.cpp
index a141c239..f419fec1 100644
--- a/src/plugins/geoservices/osm/qgeotiledmappingmanagerengineosm.cpp
+++ b/src/plugins/geoservices/osm/qgeotiledmappingmanagerengineosm.cpp
@@ -59,8 +59,8 @@ QGeoTiledMappingManagerEngineOsm::QGeoTiledMappingManagerEngineOsm(const QVarian
setTileSize(QSize(256, 256));
QList<QGeoMapType> mapTypes;
- mapTypes << QGeoMapType(QGeoMapType::StreetMap, tr("Street Map"), tr("Open street map street map"), false, 1);
- mapTypes << QGeoMapType(QGeoMapType::SatelliteMapDay, tr("Satellite Map"), tr("Open street map satellite map"), false, 2);
+ mapTypes << QGeoMapType(QGeoMapType::StreetMap, tr("Street Map"), tr("OpenStreetMap street map"), false, 1);
+ mapTypes << QGeoMapType(QGeoMapType::SatelliteMapDay, tr("Satellite Map"), tr("OpenStreetMap satellite map"), false, 2);
setSupportedMapTypes(mapTypes);
QGeoTileFetcherOsm *tileFetcher = new QGeoTileFetcherOsm(this);