summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2022-09-12 16:25:42 +0200
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2022-09-14 17:17:44 +0200
commit9e6de375a51151a6efbff0692a77da8d53a5fe63 (patch)
tree6907f53a8a1f2635db4007782b4384eaf7d84a38
parentebcfa13dd14c949681a3db78fb06349ffad5fdbc (diff)
Cleanup: Don't pass 0 to QSharedPointer constructor
Use the default constructor. Change-Id: Id9b5b9809cc2d247e50c7b37c370e9c13a19b513 Reviewed-by: Alex Blasche <alexander.blasche@qt.io> (cherry picked from commit 8791d66b4116b4f4a942416ca290274da3653dee) Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
-rw-r--r--src/location/maps/qcache3q_p.h2
-rw-r--r--src/location/maps/qgeofiletilecache.cpp4
-rw-r--r--src/plugins/geoservices/osm/qgeofiletilecacheosm.cpp2
3 files changed, 4 insertions, 4 deletions
diff --git a/src/location/maps/qcache3q_p.h b/src/location/maps/qcache3q_p.h
index 043b2771..9a3b2f17 100644
--- a/src/location/maps/qcache3q_p.h
+++ b/src/location/maps/qcache3q_p.h
@@ -435,7 +435,7 @@ QSharedPointer<T> QCache3Q<Key,T,EvPolicy>::object(const Key &key) const
{
if (!lookup_.contains(key)) {
const_cast<QCache3Q<Key,T,EvPolicy> *>(this)->missCount_++;
- return QSharedPointer<T>(0);
+ return QSharedPointer<T>();
}
QCache3Q<Key,T,EvPolicy> *me = const_cast<QCache3Q<Key,T,EvPolicy> *>(this);
diff --git a/src/location/maps/qgeofiletilecache.cpp b/src/location/maps/qgeofiletilecache.cpp
index 36d8dfee..fb596c42 100644
--- a/src/location/maps/qgeofiletilecache.cpp
+++ b/src/location/maps/qgeofiletilecache.cpp
@@ -555,7 +555,7 @@ QSharedPointer<QGeoTileTexture> QGeoFileTileCache::getFromMemory(const QGeoTileS
QImage image;
if (!image.loadFromData(tm->bytes)) {
handleError(spec, QLatin1String("Problem with tile image"));
- return QSharedPointer<QGeoTileTexture>(0);
+ return QSharedPointer<QGeoTileTexture>();
}
QSharedPointer<QGeoTileTexture> tt = addToTextureCache(spec, image);
if (tt)
@@ -588,7 +588,7 @@ QSharedPointer<QGeoTileTexture> QGeoFileTileCache::getFromDisk(const QGeoTileSpe
// This is a truly invalid image. The fetcher should try again.
if (!image.loadFromData(bytes)) {
handleError(spec, QLatin1String("Problem with tile image"));
- return QSharedPointer<QGeoTileTexture>(0);
+ return QSharedPointer<QGeoTileTexture>();
}
// Converting it here, instead of in each QSGTexture::bind()
diff --git a/src/plugins/geoservices/osm/qgeofiletilecacheosm.cpp b/src/plugins/geoservices/osm/qgeofiletilecacheosm.cpp
index 032ee085..cfde80bf 100644
--- a/src/plugins/geoservices/osm/qgeofiletilecacheosm.cpp
+++ b/src/plugins/geoservices/osm/qgeofiletilecacheosm.cpp
@@ -170,7 +170,7 @@ QSharedPointer<QGeoTileTexture> QGeoFileTileCacheOsm::getFromOfflineStorage(cons
QImage image;
if (!image.loadFromData(bytes)) {
handleError(spec, QLatin1String("Problem with tile image"));
- return QSharedPointer<QGeoTileTexture>(0);
+ return QSharedPointer<QGeoTileTexture>();
}
addToMemoryCache(spec, bytes, QString());