summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2022-09-10 11:14:03 +0200
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2022-09-14 17:17:48 +0200
commitbff36a2e34d8ffc4d14d9eb07d81259d848f7122 (patch)
tree6e9fb2ecf206094a538be169e7bb28c99fd61853
parent9e6de375a51151a6efbff0692a77da8d53a5fe63 (diff)
Cleanup: use nullptr instead of 0
Change-Id: I2f713a9a88023c5e2b3d779ebe73c821c72dd0e3 Reviewed-by: Alex Blasche <alexander.blasche@qt.io> (cherry picked from commit a3204868017d1c7638412bf94257f754151e42e7) Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
-rw-r--r--src/location/declarativemaps/qdeclarativegeocodemodel.cpp2
-rw-r--r--src/location/declarativemaps/qdeclarativegeomap.cpp2
-rw-r--r--src/location/declarativemaps/qdeclarativegeomapcopyrightsnotice.cpp2
-rw-r--r--src/location/declarativemaps/qdeclarativegeomapitembase.cpp6
-rw-r--r--src/location/declarativemaps/qdeclarativegeoroutemodel.cpp2
-rw-r--r--src/location/declarativeplaces/qdeclarativecategory.cpp14
-rw-r--r--src/location/declarativeplaces/qdeclarativeplace.cpp14
-rw-r--r--src/location/declarativeplaces/qdeclarativeplacecontentmodel.cpp4
-rw-r--r--src/location/declarativeplaces/qdeclarativesearchmodelbase.cpp2
-rw-r--r--src/location/declarativeplaces/qdeclarativesearchresultmodel.cpp5
-rw-r--r--src/location/declarativeplaces/qdeclarativesearchsuggestionmodel.cpp2
-rw-r--r--src/location/declarativeplaces/qdeclarativesupportedcategoriesmodel.cpp4
-rw-r--r--src/location/doc/snippets/places/requesthandler.h22
-rw-r--r--src/location/doc/src/qtlocation-geoservices.qdoc2
-rw-r--r--src/location/labs/qsg/qqsgmapobject.cpp2
-rw-r--r--src/location/maps/qgeocodereply.cpp2
-rw-r--r--src/location/maps/qgeoserviceprovider.cpp30
-rw-r--r--src/location/maps/qgeoserviceproviderfactory.cpp4
-rw-r--r--src/location/maps/qgeotiledmap.cpp4
-rw-r--r--src/location/maps/qgeotiledmapscene.cpp2
-rw-r--r--src/plugins/geoservices/esri/geoserviceproviderfactory_esri.cpp2
-rw-r--r--src/plugins/geoservices/itemsoverlay/qgeoserviceproviderpluginitemsoverlay.cpp6
-rw-r--r--src/plugins/geoservices/mapbox/qgeoserviceproviderpluginmapbox.cpp8
-rw-r--r--src/plugins/geoservices/mapboxgl/qgeomapmapboxgl.cpp4
-rw-r--r--src/plugins/geoservices/mapboxgl/qgeoserviceproviderpluginmapboxgl.cpp6
-rw-r--r--src/plugins/geoservices/nokia/qgeoserviceproviderplugin_nokia.cpp2
-rw-r--r--src/plugins/geoservices/nokia/qgeotilefetcher_nokia.cpp2
-rw-r--r--src/plugins/geoservices/nokia/qplacemanagerengine_nokiav2.cpp4
-rw-r--r--tests/auto/nokia_services/routing/tst_routing.cpp16
-rw-r--r--tests/auto/qplacemanager/tst_qplacemanager.cpp2
-rw-r--r--tests/auto/qplacemanager_unsupported/tst_qplacemanager_unsupported.cpp4
31 files changed, 91 insertions, 92 deletions
diff --git a/src/location/declarativemaps/qdeclarativegeocodemodel.cpp b/src/location/declarativemaps/qdeclarativegeocodemodel.cpp
index fb177a06..e44d6aaa 100644
--- a/src/location/declarativemaps/qdeclarativegeocodemodel.cpp
+++ b/src/location/declarativemaps/qdeclarativegeocodemodel.cpp
@@ -540,7 +540,7 @@ QDeclarativeGeoLocation *QDeclarativeGeocodeModel::get(int index)
{
if (index < 0 || index >= declarativeLocations_.count()) {
qmlWarning(this) << QStringLiteral("Index '%1' out of range").arg(index);
- return 0;
+ return nullptr;
}
return declarativeLocations_.at(index);
}
diff --git a/src/location/declarativemaps/qdeclarativegeomap.cpp b/src/location/declarativemaps/qdeclarativegeomap.cpp
index df89ee90..a26209e1 100644
--- a/src/location/declarativemaps/qdeclarativegeomap.cpp
+++ b/src/location/declarativemaps/qdeclarativegeomap.cpp
@@ -483,7 +483,7 @@ QSGNode *QDeclarativeGeoMap::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeDa
{
if (!m_map) {
delete oldNode;
- return 0;
+ return nullptr;
}
QSGRectangleNode *root = static_cast<QSGRectangleNode *>(oldNode);
diff --git a/src/location/declarativemaps/qdeclarativegeomapcopyrightsnotice.cpp b/src/location/declarativemaps/qdeclarativegeomapcopyrightsnotice.cpp
index 72de153e..59e2218e 100644
--- a/src/location/declarativemaps/qdeclarativegeomapcopyrightsnotice.cpp
+++ b/src/location/declarativemaps/qdeclarativegeomapcopyrightsnotice.cpp
@@ -312,7 +312,7 @@ void QDeclarativeGeoMapCopyrightNotice::copyrightsImageChanged(const QImage &cop
{
Q_D(QDeclarativeGeoMapCopyrightNotice);
delete m_copyrightsHtml;
- m_copyrightsHtml = 0;
+ m_copyrightsHtml = nullptr;
m_copyrightsImage = copyrightsImage;
diff --git a/src/location/declarativemaps/qdeclarativegeomapitembase.cpp b/src/location/declarativemaps/qdeclarativegeomapitembase.cpp
index 85478d0e..3767351c 100644
--- a/src/location/declarativemaps/qdeclarativegeomapitembase.cpp
+++ b/src/location/declarativemaps/qdeclarativegeomapitembase.cpp
@@ -262,8 +262,8 @@ QSGNode *QDeclarativeGeoMapItemBase::updatePaintNode(QSGNode *oldNode, UpdatePai
if (!map_ || !quickMap_ || map_->supportedMapItemTypes() & itemType()) {
if (oldNode)
delete oldNode;
- oldNode = 0;
- return 0;
+ oldNode = nullptr;
+ return nullptr;
}
QSGOpacityNode *opn = static_cast<QSGOpacityNode *>(oldNode);
@@ -291,7 +291,7 @@ QSGNode *QDeclarativeGeoMapItemBase::updatePaintNode(QSGNode *oldNode, UpdatePai
QSGNode *QDeclarativeGeoMapItemBase::updateMapItemPaintNode(QSGNode *oldNode, UpdatePaintNodeData *)
{
delete oldNode;
- return 0;
+ return nullptr;
}
QGeoMap::ItemType QDeclarativeGeoMapItemBase::itemType() const
diff --git a/src/location/declarativemaps/qdeclarativegeoroutemodel.cpp b/src/location/declarativemaps/qdeclarativegeoroutemodel.cpp
index c1084bda..0d113959 100644
--- a/src/location/declarativemaps/qdeclarativegeoroutemodel.cpp
+++ b/src/location/declarativemaps/qdeclarativegeoroutemodel.cpp
@@ -250,7 +250,7 @@ QDeclarativeGeoRoute *QDeclarativeGeoRouteModel::get(int index)
{
if (index < 0 || index >= routes_.count()) {
qmlWarning(this) << QStringLiteral("Index '%1' out of range").arg(index);
- return 0;
+ return nullptr;
}
return routes_.at(index);
}
diff --git a/src/location/declarativeplaces/qdeclarativecategory.cpp b/src/location/declarativeplaces/qdeclarativecategory.cpp
index 281b118e..a2136ab9 100644
--- a/src/location/declarativeplaces/qdeclarativecategory.cpp
+++ b/src/location/declarativeplaces/qdeclarativecategory.cpp
@@ -410,14 +410,14 @@ void QDeclarativeCategory::replyFinished()
m_errorString.clear();
m_reply->deleteLater();
- m_reply = 0;
+ m_reply = nullptr;
setStatus(QDeclarativeCategory::Ready);
} else {
QString errorString = m_reply->errorString();
m_reply->deleteLater();
- m_reply = 0;
+ m_reply = nullptr;
setStatus(QDeclarativeCategory::Error, errorString);
}
@@ -432,29 +432,29 @@ void QDeclarativeCategory::replyFinished()
QPlaceManager *QDeclarativeCategory::manager()
{
if (m_status != QDeclarativeCategory::Ready && m_status != QDeclarativeCategory::Error)
- return 0;
+ return nullptr;
if (m_reply) {
m_reply->abort();
m_reply->deleteLater();
- m_reply = 0;
+ m_reply = nullptr;
}
if (!m_plugin) {
setStatus(Error, QCoreApplication::translate(CONTEXT_NAME, PLUGIN_PROPERTY_NOT_SET));
- return 0;
+ return nullptr;
}
QGeoServiceProvider *serviceProvider = m_plugin->sharedGeoServiceProvider();
if (!serviceProvider) {
setStatus(Error, QCoreApplication::translate(CONTEXT_NAME, PLUGIN_NOT_VALID));
- return 0;
+ return nullptr;
}
QPlaceManager *placeManager = serviceProvider->placeManager();
if (!placeManager) {
setStatus(Error, QCoreApplication::translate(CONTEXT_NAME, PLUGIN_ERROR)
.arg(m_plugin->name()).arg(serviceProvider->errorString()));
- return 0;
+ return nullptr;
}
return placeManager;
diff --git a/src/location/declarativeplaces/qdeclarativeplace.cpp b/src/location/declarativeplaces/qdeclarativeplace.cpp
index e4c6b4e1..06fa7c9a 100644
--- a/src/location/declarativeplaces/qdeclarativeplace.cpp
+++ b/src/location/declarativeplaces/qdeclarativeplace.cpp
@@ -695,14 +695,14 @@ void QDeclarativePlace::finished()
m_errorString.clear();
m_reply->deleteLater();
- m_reply = 0;
+ m_reply = nullptr;
setStatus(QDeclarativePlace::Ready);
} else {
QString errorString = m_reply->errorString();
m_reply->deleteLater();
- m_reply = 0;
+ m_reply = nullptr;
setStatus(QDeclarativePlace::Error, errorString);
}
@@ -1173,29 +1173,29 @@ void QDeclarativePlace::primarySignalsEmission(const QString &type)
QPlaceManager *QDeclarativePlace::manager()
{
if (m_status != QDeclarativePlace::Ready && m_status != QDeclarativePlace::Error)
- return 0;
+ return nullptr;
if (m_reply) {
m_reply->abort();
m_reply->deleteLater();
- m_reply = 0;
+ m_reply = nullptr;
}
if (!m_plugin) {
qmlWarning(this) << QStringLiteral("Plugin is not assigned to place.");
- return 0;
+ return nullptr;
}
QGeoServiceProvider *serviceProvider = m_plugin->sharedGeoServiceProvider();
if (!serviceProvider)
- return 0;
+ return nullptr;
QPlaceManager *placeManager = serviceProvider->placeManager();
if (!placeManager) {
setStatus(Error, QCoreApplication::translate(CONTEXT_NAME, PLUGIN_ERROR)
.arg(m_plugin->name()).arg(serviceProvider->errorString()));
- return 0;
+ return nullptr;
}
return placeManager;
diff --git a/src/location/declarativeplaces/qdeclarativeplacecontentmodel.cpp b/src/location/declarativeplaces/qdeclarativeplacecontentmodel.cpp
index 5e8ec41e..fe7111d6 100644
--- a/src/location/declarativeplaces/qdeclarativeplacecontentmodel.cpp
+++ b/src/location/declarativeplaces/qdeclarativeplacecontentmodel.cpp
@@ -135,7 +135,7 @@ void QDeclarativePlaceContentModel::clearData()
if (m_reply) {
m_reply->abort();
m_reply->deleteLater();
- m_reply = 0;
+ m_reply = nullptr;
}
m_nextRequest.clear();
@@ -304,7 +304,7 @@ void QDeclarativePlaceContentModel::fetchFinished()
return;
QPlaceContentReply *reply = m_reply;
- m_reply = 0;
+ m_reply = nullptr;
m_nextRequest = reply->nextPageRequest();
diff --git a/src/location/declarativeplaces/qdeclarativesearchmodelbase.cpp b/src/location/declarativeplaces/qdeclarativesearchmodelbase.cpp
index ee23b03b..36ea99cf 100644
--- a/src/location/declarativeplaces/qdeclarativesearchmodelbase.cpp
+++ b/src/location/declarativeplaces/qdeclarativesearchmodelbase.cpp
@@ -257,7 +257,7 @@ void QDeclarativeSearchModelBase::cancel()
if (m_reply) {
m_reply->deleteLater();
- m_reply = 0;
+ m_reply = nullptr;
}
setStatus(Ready);
diff --git a/src/location/declarativeplaces/qdeclarativesearchresultmodel.cpp b/src/location/declarativeplaces/qdeclarativesearchresultmodel.cpp
index 9e16aa70..93e83ce1 100644
--- a/src/location/declarativeplaces/qdeclarativesearchresultmodel.cpp
+++ b/src/location/declarativeplaces/qdeclarativesearchresultmodel.cpp
@@ -430,8 +430,7 @@ QDeclarativeCategory *QDeclarativeSearchResultModel::category_at(QQmlListPropert
QDeclarativeSearchResultModel *searchModel = qobject_cast<QDeclarativeSearchResultModel *>(list->object);
if (searchModel && (searchModel->m_categories.count() > index) && (index > -1))
return searchModel->m_categories.at(index);
- else
- return 0;
+ return nullptr;
}
void QDeclarativeSearchResultModel::categories_clear(QQmlListProperty<QDeclarativeCategory> *list)
@@ -754,7 +753,7 @@ void QDeclarativeSearchResultModel::queryFinished()
if (!m_reply)
return;
QPlaceReply *reply = m_reply;
- m_reply = 0;
+ m_reply = nullptr;
reply->deleteLater();
if (!m_incremental)
diff --git a/src/location/declarativeplaces/qdeclarativesearchsuggestionmodel.cpp b/src/location/declarativeplaces/qdeclarativesearchsuggestionmodel.cpp
index 7b91608b..4efc760a 100644
--- a/src/location/declarativeplaces/qdeclarativesearchsuggestionmodel.cpp
+++ b/src/location/declarativeplaces/qdeclarativesearchsuggestionmodel.cpp
@@ -321,7 +321,7 @@ void QDeclarativeSearchSuggestionModel::queryFinished()
return;
QPlaceReply *reply = m_reply;
- m_reply = 0;
+ m_reply = nullptr;
int initialCount = m_suggestions.count();
beginResetModel();
diff --git a/src/location/declarativeplaces/qdeclarativesupportedcategoriesmodel.cpp b/src/location/declarativeplaces/qdeclarativesupportedcategoriesmodel.cpp
index 2d354b50..74e4b15f 100644
--- a/src/location/declarativeplaces/qdeclarativesupportedcategoriesmodel.cpp
+++ b/src/location/declarativeplaces/qdeclarativesupportedcategoriesmodel.cpp
@@ -348,14 +348,14 @@ void QDeclarativeSupportedCategoriesModel::replyFinished()
if (m_response->error() == QPlaceReply::NoError) {
m_errorString.clear();
- m_response = 0;
+ m_response = nullptr;
updateLayout();
setStatus(QDeclarativeSupportedCategoriesModel::Ready);
} else {
const QString errorString = m_response->errorString();
- m_response = 0;
+ m_response = nullptr;
setStatus(Error, errorString);
}
diff --git a/src/location/doc/snippets/places/requesthandler.h b/src/location/doc/snippets/places/requesthandler.h
index 7b3a7cc4..365ab433 100644
--- a/src/location/doc/snippets/places/requesthandler.h
+++ b/src/location/doc/snippets/places/requesthandler.h
@@ -323,7 +323,7 @@ public slots:
//5) Discard the rely object when done.
searchReply->deleteLater();
- searchReply = 0;
+ searchReply = nullptr;
}
// ![Simple search handler]
@@ -341,7 +341,7 @@ public slots:
}
}
searchReply->deleteLater(); //discard reply
- searchReply = 0;
+ searchReply = nullptr;
}
//! [Search for places handler cpp]
@@ -352,7 +352,7 @@ public slots:
place = detailsReply->place();
detailsReply->deleteLater(); //discard reply
- detailsReply = 0;
+ detailsReply = nullptr;
}
//! [Details handler cpp]
@@ -381,7 +381,7 @@ public slots:
}
contentReply->deleteLater();
- contentReply = 0;
+ contentReply = nullptr;
}
//! [Image handler]
@@ -393,7 +393,7 @@ public slots:
}
suggestionReply->deleteLater(); //discard reply
- suggestionReply = 0;
+ suggestionReply = nullptr;
}
//! [Suggestion handler]
@@ -404,7 +404,7 @@ public slots:
qDebug() << savePlaceReply->id();
savePlaceReply->deleteLater(); //discard reply
- savePlaceReply = 0;
+ savePlaceReply = nullptr;
}
//! [Save place handler]
@@ -415,7 +415,7 @@ public slots:
<< removePlaceReply->id() << "was successful";
removePlaceReply->deleteLater(); //discard reply
- removePlaceReply = 0;
+ removePlaceReply = nullptr;
}
//! [Remove place handler]
@@ -427,7 +427,7 @@ public slots:
qDebug() << "Failed to initialize categories";
initCatReply->deleteLater();
- initCatReply = 0;
+ initCatReply = nullptr;
}
//! [Initialize categories reply]
@@ -451,7 +451,7 @@ public slots:
}
saveCategoryReply->deleteLater();
- saveCategoryReply = 0;
+ saveCategoryReply = nullptr;
}
//! [Save category handler]
@@ -462,7 +462,7 @@ public slots:
<< removeCategoryReply->id() << "was successful";
removeCategoryReply->deleteLater(); //discard reply
- removeCategoryReply = 0;
+ removeCategoryReply = nullptr;
}
//! [Remove category handler]
@@ -505,7 +505,7 @@ public slots:
}
matchReply->deleteLater();
- matchReply = 0;
+ matchReply = nullptr;
}
//! [Match places handler]
diff --git a/src/location/doc/src/qtlocation-geoservices.qdoc b/src/location/doc/src/qtlocation-geoservices.qdoc
index cc67e231..7c2c3cf0 100644
--- a/src/location/doc/src/qtlocation-geoservices.qdoc
+++ b/src/location/doc/src/qtlocation-geoservices.qdoc
@@ -85,7 +85,7 @@ methods:
\li \l QGeoServiceProviderFactory::createPlaceManagerEngine()
\endlist
-If a plugin does not provide an engine the relevant function should return 0.
+If a plugin does not provide an engine the relevant function should return \nullptr.
\annotatedlist QtLocation-impl
diff --git a/src/location/labs/qsg/qqsgmapobject.cpp b/src/location/labs/qsg/qqsgmapobject.cpp
index 964770d3..2ba5c8e8 100644
--- a/src/location/labs/qsg/qqsgmapobject.cpp
+++ b/src/location/labs/qsg/qqsgmapobject.cpp
@@ -58,7 +58,7 @@ QSGNode *QQSGMapObject::updateMapObjectNode(QSGNode *oldNode,
QQuickWindow * /*window*/)
{
delete oldNode;
- return 0;
+ return nullptr;
}
void QQSGMapObject::updateGeometry()
diff --git a/src/location/maps/qgeocodereply.cpp b/src/location/maps/qgeocodereply.cpp
index 06abc614..75b78659 100644
--- a/src/location/maps/qgeocodereply.cpp
+++ b/src/location/maps/qgeocodereply.cpp
@@ -202,7 +202,7 @@ void QGeoCodeReply::setViewport(const QGeoShape &viewport)
/*!
Returns the viewport which contains the results.
- This function will return 0 if no viewport bias
+ This function will return \nullptr if no viewport bias
was specified in the QGeoCodingManager function which created this reply.
*/
QGeoShape QGeoCodeReply::viewport() const
diff --git a/src/location/maps/qgeoserviceprovider.cpp b/src/location/maps/qgeoserviceprovider.cpp
index f0fcf332..72bdcf14 100644
--- a/src/location/maps/qgeoserviceprovider.cpp
+++ b/src/location/maps/qgeoserviceprovider.cpp
@@ -345,7 +345,7 @@ QGeoServiceProvider::NavigationFeatures QGeoServiceProvider::navigationFeatures(
template <class Engine>
Engine *createEngine(QGeoServiceProviderPrivate *)
{
- return 0;
+ return nullptr;
}
template <> QGeoCodingManagerEngine *createEngine<QGeoCodingManagerEngine>(QGeoServiceProviderPrivate *d_ptr)
{
@@ -387,7 +387,7 @@ Manager *QGeoServiceProviderPrivate::manager(QGeoServiceProvider::Error *_error,
if (!this->factory) {
error = this->error;
errorString = this->errorString;
- return 0;
+ return nullptr;
}
if (!manager) {
@@ -409,7 +409,7 @@ Manager *QGeoServiceProviderPrivate::manager(QGeoServiceProvider::Error *_error,
if (error != QGeoServiceProvider::NoError) {
delete manager;
- manager = 0;
+ manager = nullptr;
this->error = error;
this->errorString = errorString;
}
@@ -430,7 +430,7 @@ Manager *QGeoServiceProviderPrivate::manager(QGeoServiceProvider::Error *_error,
Returns the QGeoCodingManager made available by the service
provider.
- This function will return 0 if the service provider does not provide
+ This function will return \nullptr if the service provider does not provide
any geocoding services.
This function will attempt to construct a QGeoCodingManager instance
@@ -460,7 +460,7 @@ QGeoCodingManager *QGeoServiceProvider::geocodingManager() const
/*!
Returns the QGeoMappingManager made available by the service provider.
- This function will return 0 if the service provider does not provide
+ This function will return \nullptr if the service provider does not provide
any mapping services.
This function will attempt to construct a QGeoMappingManager instance
@@ -492,7 +492,7 @@ QGeoMappingManager *QGeoServiceProvider::mappingManager() const
/*!
Returns the QGeoRoutingManager made available by the service provider.
- This function will return 0 if the service provider does not provide
+ This function will return \nullptr if the service provider does not provide
any geographic routing services.
This function will attempt to construct a QGeoRoutingManager instance
@@ -755,12 +755,12 @@ void QGeoServiceProvider::setLocale(const QLocale &locale)
*******************************************************************************/
QGeoServiceProviderPrivate::QGeoServiceProviderPrivate()
- : factory(0),
+ : factory(nullptr),
experimental(false),
- geocodingManager(0),
- routingManager(0),
- mappingManager(0),
- placeManager(0),
+ geocodingManager(nullptr),
+ routingManager(nullptr),
+ mappingManager(nullptr),
+ placeManager(nullptr),
geocodeError(QGeoServiceProvider::NoError),
routingError(QGeoServiceProvider::NoError),
mappingError(QGeoServiceProvider::NoError),
@@ -783,16 +783,16 @@ QGeoServiceProviderPrivate::~QGeoServiceProviderPrivate()
void QGeoServiceProviderPrivate::unload()
{
delete geocodingManager;
- geocodingManager = 0;
+ geocodingManager = nullptr;
delete routingManager;
- routingManager = 0;
+ routingManager = nullptr;
delete mappingManager;
- mappingManager = 0;
+ mappingManager = nullptr;
delete placeManager;
- placeManager = 0;
+ placeManager = nullptr;
delete navigationManager;
navigationManager = nullptr;
diff --git a/src/location/maps/qgeoserviceproviderfactory.cpp b/src/location/maps/qgeoserviceproviderfactory.cpp
index fd34047a..fdd27464 100644
--- a/src/location/maps/qgeoserviceproviderfactory.cpp
+++ b/src/location/maps/qgeoserviceproviderfactory.cpp
@@ -86,7 +86,7 @@ QGeoServiceProviderFactory::createGeocodingManagerEngine(const QVariantMap &para
Q_UNUSED(error);
Q_UNUSED(errorString);
- return 0;
+ return nullptr;
}
/*!
@@ -113,7 +113,7 @@ QGeoServiceProviderFactory::createMappingManagerEngine(const QVariantMap &parame
Q_UNUSED(error);
Q_UNUSED(errorString);
- return 0;
+ return nullptr;
}
/*!
diff --git a/src/location/maps/qgeotiledmap.cpp b/src/location/maps/qgeotiledmap.cpp
index 273d60a9..7e43bf38 100644
--- a/src/location/maps/qgeotiledmap.cpp
+++ b/src/location/maps/qgeotiledmap.cpp
@@ -93,7 +93,7 @@ QGeoTiledMap::~QGeoTiledMap()
{
Q_D(QGeoTiledMap);
delete d->m_tileRequests;
- d->m_tileRequests = 0;
+ d->m_tileRequests = nullptr;
if (!d->m_engine.isNull()) {
QGeoTiledMappingManagerEngine *engine = qobject_cast<QGeoTiledMappingManagerEngine*>(d->m_engine);
@@ -194,7 +194,7 @@ QGeoTiledMapPrivate::QGeoTiledMapPrivate(QGeoTiledMappingManagerEngine *engine)
m_visibleTiles(new QGeoCameraTiles()),
m_prefetchTiles(new QGeoCameraTiles()),
m_mapScene(new QGeoTiledMapScene()),
- m_tileRequests(0),
+ m_tileRequests(nullptr),
m_maxZoomLevel(static_cast<int>(std::ceil(m_cameraCapabilities.maximumZoomLevel()))),
m_minZoomLevel(static_cast<int>(std::ceil(m_cameraCapabilities.minimumZoomLevel()))),
m_prefetchStyle(QGeoTiledMap::PrefetchTwoNeighbourLayers)
diff --git a/src/location/maps/qgeotiledmapscene.cpp b/src/location/maps/qgeotiledmapscene.cpp
index 8d4004a2..3193d01a 100644
--- a/src/location/maps/qgeotiledmapscene.cpp
+++ b/src/location/maps/qgeotiledmapscene.cpp
@@ -584,7 +584,7 @@ QSGNode *QGeoTiledMapScene::updateSceneGraph(QSGNode *oldNode, QQuickWindow *win
float h = d->m_screenSize.height();
if (w <= 0 || h <= 0) {
delete oldNode;
- return 0;
+ return nullptr;
}
QGeoTiledMapRootNode *mapRoot = static_cast<QGeoTiledMapRootNode *>(oldNode);
diff --git a/src/plugins/geoservices/esri/geoserviceproviderfactory_esri.cpp b/src/plugins/geoservices/esri/geoserviceproviderfactory_esri.cpp
index 197b16cd..e88ccd7f 100644
--- a/src/plugins/geoservices/esri/geoserviceproviderfactory_esri.cpp
+++ b/src/plugins/geoservices/esri/geoserviceproviderfactory_esri.cpp
@@ -70,7 +70,7 @@ QGeoRoutingManagerEngine *GeoServiceProviderFactoryEsri::createRoutingManagerEng
*error = QGeoServiceProvider::MissingRequiredParameterError;
*errorString = tr("Esri plugin requires a 'esri.token' parameter.\n"
"Please visit https://developers.arcgis.com/authentication/accessing-arcgis-online-services/");
- return 0;
+ return nullptr;
}
}
diff --git a/src/plugins/geoservices/itemsoverlay/qgeoserviceproviderpluginitemsoverlay.cpp b/src/plugins/geoservices/itemsoverlay/qgeoserviceproviderpluginitemsoverlay.cpp
index 6f3c9c3f..78941693 100644
--- a/src/plugins/geoservices/itemsoverlay/qgeoserviceproviderpluginitemsoverlay.cpp
+++ b/src/plugins/geoservices/itemsoverlay/qgeoserviceproviderpluginitemsoverlay.cpp
@@ -49,7 +49,7 @@ QGeoCodingManagerEngine *QGeoServiceProviderFactoryItemsOverlay::createGeocoding
Q_UNUSED(error);
Q_UNUSED(errorString);
- return 0;
+ return nullptr;
}
QGeoMappingManagerEngine *QGeoServiceProviderFactoryItemsOverlay::createMappingManagerEngine(
@@ -65,7 +65,7 @@ QGeoRoutingManagerEngine *QGeoServiceProviderFactoryItemsOverlay::createRoutingM
Q_UNUSED(error);
Q_UNUSED(errorString);
- return 0;
+ return nullptr;
}
QPlaceManagerEngine *QGeoServiceProviderFactoryItemsOverlay::createPlaceManagerEngine(
@@ -75,7 +75,7 @@ QPlaceManagerEngine *QGeoServiceProviderFactoryItemsOverlay::createPlaceManagerE
Q_UNUSED(error);
Q_UNUSED(errorString);
- return 0;
+ return nullptr;
}
QT_END_NAMESPACE
diff --git a/src/plugins/geoservices/mapbox/qgeoserviceproviderpluginmapbox.cpp b/src/plugins/geoservices/mapbox/qgeoserviceproviderpluginmapbox.cpp
index fa9462f1..5eea12c7 100644
--- a/src/plugins/geoservices/mapbox/qgeoserviceproviderpluginmapbox.cpp
+++ b/src/plugins/geoservices/mapbox/qgeoserviceproviderpluginmapbox.cpp
@@ -63,7 +63,7 @@ QGeoCodingManagerEngine *QGeoServiceProviderFactoryMapbox::createGeocodingManage
} else {
*error = QGeoServiceProvider::MissingRequiredParameterError;
*errorString = msgAccessTokenParameter();
- return 0;
+ return nullptr;
}
}
@@ -77,7 +77,7 @@ QGeoMappingManagerEngine *QGeoServiceProviderFactoryMapbox::createMappingManager
} else {
*error = QGeoServiceProvider::MissingRequiredParameterError;
*errorString = msgAccessTokenParameter();
- return 0;
+ return nullptr;
}
}
@@ -91,7 +91,7 @@ QGeoRoutingManagerEngine *QGeoServiceProviderFactoryMapbox::createRoutingManager
} else {
*error = QGeoServiceProvider::MissingRequiredParameterError;
*errorString = msgAccessTokenParameter();
- return 0;
+ return nullptr;
}
}
@@ -105,7 +105,7 @@ QPlaceManagerEngine *QGeoServiceProviderFactoryMapbox::createPlaceManagerEngine(
} else {
*error = QGeoServiceProvider::MissingRequiredParameterError;
*errorString = msgAccessTokenParameter();
- return 0;
+ return nullptr;
}
}
diff --git a/src/plugins/geoservices/mapboxgl/qgeomapmapboxgl.cpp b/src/plugins/geoservices/mapboxgl/qgeomapmapboxgl.cpp
index 51450fd5..9f12c1f5 100644
--- a/src/plugins/geoservices/mapboxgl/qgeomapmapboxgl.cpp
+++ b/src/plugins/geoservices/mapboxgl/qgeomapmapboxgl.cpp
@@ -96,10 +96,10 @@ QSGNode *QGeoMapMapboxGLPrivate::updateSceneGraph(QSGNode *node, QQuickWindow *w
if (m_viewportSize.isEmpty()) {
delete node;
- return 0;
+ return nullptr;
}
- QMapboxGL *map = 0;
+ QMapboxGL *map = nullptr;
if (!node) {
QOpenGLContext *currentCtx = QOpenGLContext::currentContext();
if (!currentCtx) {
diff --git a/src/plugins/geoservices/mapboxgl/qgeoserviceproviderpluginmapboxgl.cpp b/src/plugins/geoservices/mapboxgl/qgeoserviceproviderpluginmapboxgl.cpp
index a92d6644..db3ee36c 100644
--- a/src/plugins/geoservices/mapboxgl/qgeoserviceproviderpluginmapboxgl.cpp
+++ b/src/plugins/geoservices/mapboxgl/qgeoserviceproviderpluginmapboxgl.cpp
@@ -56,7 +56,7 @@ QGeoCodingManagerEngine *QGeoServiceProviderFactoryMapboxGL::createGeocodingMana
Q_UNUSED(error);
Q_UNUSED(errorString);
- return 0;
+ return nullptr;
}
QGeoMappingManagerEngine *QGeoServiceProviderFactoryMapboxGL::createMappingManagerEngine(
@@ -72,7 +72,7 @@ QGeoRoutingManagerEngine *QGeoServiceProviderFactoryMapboxGL::createRoutingManag
Q_UNUSED(error);
Q_UNUSED(errorString);
- return 0;
+ return nullptr;
}
QPlaceManagerEngine *QGeoServiceProviderFactoryMapboxGL::createPlaceManagerEngine(
@@ -82,7 +82,7 @@ QPlaceManagerEngine *QGeoServiceProviderFactoryMapboxGL::createPlaceManagerEngin
Q_UNUSED(error);
Q_UNUSED(errorString);
- return 0;
+ return nullptr;
}
QT_END_NAMESPACE
diff --git a/src/plugins/geoservices/nokia/qgeoserviceproviderplugin_nokia.cpp b/src/plugins/geoservices/nokia/qgeoserviceproviderplugin_nokia.cpp
index 9c433a30..c7edd1a1 100644
--- a/src/plugins/geoservices/nokia/qgeoserviceproviderplugin_nokia.cpp
+++ b/src/plugins/geoservices/nokia/qgeoserviceproviderplugin_nokia.cpp
@@ -103,7 +103,7 @@ namespace
checkUsageTerms(parameters, error, errorString);
if (*error != QGeoServiceProvider::NoError)
- return 0;
+ return nullptr;
QGeoNetworkAccessManager *networkManager = tryGetNetworkAccessManager(parameters);
if (!networkManager)
diff --git a/src/plugins/geoservices/nokia/qgeotilefetcher_nokia.cpp b/src/plugins/geoservices/nokia/qgeotilefetcher_nokia.cpp
index b86383bf..d13fa8ee 100644
--- a/src/plugins/geoservices/nokia/qgeotilefetcher_nokia.cpp
+++ b/src/plugins/geoservices/nokia/qgeotilefetcher_nokia.cpp
@@ -79,7 +79,7 @@ QGeoTileFetcherNokia::QGeoTileFetcherNokia(const QVariantMap &parameters,
QGeoTiledMappingManagerEngineNokia *engine,
const QSize &tileSize,
int ppi)
-: QGeoTileFetcher(engine), m_engineNokia(engine), m_networkManager(networkManager), m_ppi(ppi), m_copyrightsReply(0),
+: QGeoTileFetcher(engine), m_engineNokia(engine), m_networkManager(networkManager), m_ppi(ppi), m_copyrightsReply(nullptr),
m_baseUriProvider(new QGeoUriProvider(this, parameters, QStringLiteral("here.mapping.host"), MAP_TILES_HOST)),
m_aerialUriProvider(new QGeoUriProvider(this, parameters, QStringLiteral("here.mapping.host.aerial"), MAP_TILES_HOST_AERIAL))
{
diff --git a/src/plugins/geoservices/nokia/qplacemanagerengine_nokiav2.cpp b/src/plugins/geoservices/nokia/qplacemanagerengine_nokiav2.cpp
index 69c5932c..14772a9a 100644
--- a/src/plugins/geoservices/nokia/qplacemanagerengine_nokiav2.cpp
+++ b/src/plugins/geoservices/nokia/qplacemanagerengine_nokiav2.cpp
@@ -269,7 +269,7 @@ QPlaceDetailsReply *QPlaceManagerEngineNokiaV2::getPlaceDetails(const QString &p
QPlaceContentReply *QPlaceManagerEngineNokiaV2::getPlaceContent(const QPlaceContentRequest &request)
{
- QNetworkReply *networkReply = 0;
+ QNetworkReply *networkReply = nullptr;
if (request.contentContext().userType() == qMetaTypeId<QUrl>()) {
QUrl u = request.contentContext().value<QUrl>();
@@ -401,7 +401,7 @@ QPlaceSearchReply *QPlaceManagerEngineNokiaV2::search(const QPlaceSearchRequest
}
}
- QNetworkReply *networkReply = 0;
+ QNetworkReply *networkReply = nullptr;
if (query.searchContext().userType() == qMetaTypeId<QUrl>()) {
// provided search context
diff --git a/tests/auto/nokia_services/routing/tst_routing.cpp b/tests/auto/nokia_services/routing/tst_routing.cpp
index 0a5b7cc6..d653576a 100644
--- a/tests/auto/nokia_services/routing/tst_routing.cpp
+++ b/tests/auto/nokia_services/routing/tst_routing.cpp
@@ -129,7 +129,7 @@ MockGeoNetworkAccessManager::MockGeoNetworkAccessManager(QObject* parent)
QNetworkReply* MockGeoNetworkAccessManager::get(const QNetworkRequest& request)
{
MockGeoNetworkReply* r = m_reply;
- m_reply = 0;
+ m_reply = nullptr;
if (r) {
r->setRequest(request);
r->setOperation(QNetworkAccessManager::GetOperation);
@@ -217,7 +217,7 @@ void tst_nokia_routing::loadReply(const QString& filename)
QFile* file = new QFile(QFINDTESTDATA(filename));
if (!file->open(QIODevice::ReadOnly)) {
delete file;
- file = 0;
+ file = nullptr;
qDebug() << filename;
QTest::qFail("Failed to open file", __FILE__, __LINE__);
}
@@ -233,7 +233,7 @@ void tst_nokia_routing::calculateRoute()
m_calculationDone = false;
m_routingManager->calculateRoute(m_dummyRequest);
m_replyUnowned->complete();
- m_replyUnowned = 0;
+ m_replyUnowned = nullptr;
// Timeout of 200ms is required for slow targets (e.g. Qemu)
QTRY_VERIFY_WITH_TIMEOUT(m_calculationDone, 200);
}
@@ -351,16 +351,16 @@ void tst_nokia_routing::cleanupTestCase()
// network access manager will be deleted by plugin
- m_geoServiceProvider = 0;
- m_networkManager = 0;
- m_routingManager = 0;
+ m_geoServiceProvider = nullptr;
+ m_networkManager = nullptr;
+ m_routingManager = nullptr;
}
void tst_nokia_routing::cleanup()
{
delete m_reply;
- m_reply = 0;
- m_replyUnowned = 0;
+ m_reply = nullptr;
+ m_replyUnowned = nullptr;
m_expectError = false;
}
diff --git a/tests/auto/qplacemanager/tst_qplacemanager.cpp b/tests/auto/qplacemanager/tst_qplacemanager.cpp
index c8d38923..a53d15df 100644
--- a/tests/auto/qplacemanager/tst_qplacemanager.cpp
+++ b/tests/auto/qplacemanager/tst_qplacemanager.cpp
@@ -87,7 +87,7 @@ void tst_QPlaceManager::initTestCase()
+ QStringLiteral("/../../../plugins"));
#endif
#endif
- provider = 0;
+ provider = nullptr;
QStringList providers = QGeoServiceProvider::availableServiceProviders();
QVERIFY(providers.contains("qmlgeo.test.plugin"));
diff --git a/tests/auto/qplacemanager_unsupported/tst_qplacemanager_unsupported.cpp b/tests/auto/qplacemanager_unsupported/tst_qplacemanager_unsupported.cpp
index 7009af01..6a8f8cfc 100644
--- a/tests/auto/qplacemanager_unsupported/tst_qplacemanager_unsupported.cpp
+++ b/tests/auto/qplacemanager_unsupported/tst_qplacemanager_unsupported.cpp
@@ -99,8 +99,8 @@ void tst_QPlaceManagerUnsupported::initTestCase()
#endif
#endif
- m_provider = 0;
- m_manager = 0;
+ m_provider = nullptr;
+ m_manager = nullptr;
QStringList providers = QGeoServiceProvider::availableServiceProviders();
QVERIFY(providers.contains("test.places.unsupported"));