summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2022-09-11 01:50:21 +0200
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2022-09-14 17:17:25 +0200
commit6c5448e4825071405cd065807971f4d851c0a037 (patch)
tree7c4ab76f53f445b27092c9250c94ae79186a1d89
parenta2f3632ffd8aedd0a4896357c4ad92725670dbad (diff)
Constructor cleanup
Use member initialization, and remove unneeded implementations of special member functions. Fix coding style in related code. Change-Id: I3326e3f331762a9c1ad3c3baac0de02fc5bb2b44 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> (cherry picked from commit 48eb0a642688f792eb285ec56082b8f3c09d6605) Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
-rw-r--r--src/location/declarativemaps/qdeclarativegeocodemodel.cpp4
-rw-r--r--src/location/declarativemaps/qdeclarativegeocodemodel_p.h18
-rw-r--r--src/location/declarativemaps/qdeclarativegeomap.cpp22
-rw-r--r--src/location/declarativemaps/qdeclarativegeomap_p.h46
-rw-r--r--src/location/declarativemaps/qdeclarativegeomapcopyrightsnotice.cpp5
-rw-r--r--src/location/declarativemaps/qdeclarativegeomapcopyrightsnotice_p.h8
-rw-r--r--src/location/declarativemaps/qdeclarativegeomapitembase.cpp36
-rw-r--r--src/location/declarativemaps/qdeclarativegeomapitembase_p.h25
-rw-r--r--src/location/declarativemaps/qdeclarativegeomapitemgroup.cpp4
-rw-r--r--src/location/declarativemaps/qdeclarativegeomapitemgroup_p.h4
-rw-r--r--src/location/declarativemaps/qdeclarativegeomapitemview.cpp5
-rw-r--r--src/location/declarativemaps/qdeclarativegeomapitemview_p.h12
-rw-r--r--src/location/declarativemaps/qdeclarativegeomapparameter.cpp5
-rw-r--r--src/location/declarativemaps/qdeclarativegeomapparameter_p.h6
-rw-r--r--src/location/declarativemaps/qdeclarativegeomapquickitem.cpp5
-rw-r--r--src/location/declarativemaps/qdeclarativegeomapquickitem_p.h12
-rw-r--r--src/location/declarativemaps/qdeclarativegeoroutemodel.cpp14
-rw-r--r--src/location/declarativemaps/qdeclarativegeoroutemodel_p.h18
-rw-r--r--src/location/declarativemaps/qdeclarativegeoserviceprovider.cpp29
-rw-r--r--src/location/declarativemaps/qdeclarativegeoserviceprovider_p.h20
-rw-r--r--src/location/declarativemaps/qdeclarativepolygonmapitem.cpp16
-rw-r--r--src/location/declarativemaps/qdeclarativepolygonmapitem_p_p.h13
-rw-r--r--src/location/declarativemaps/qdeclarativepolylinemapitem.cpp15
-rw-r--r--src/location/declarativemaps/qdeclarativepolylinemapitem_p.h10
-rw-r--r--src/location/declarativemaps/qdeclarativerectanglemapitem.cpp7
-rw-r--r--src/location/declarativemaps/qdeclarativerectanglemapitem_p.h8
-rw-r--r--src/location/declarativemaps/qdeclarativeroutemapitem.cpp4
-rw-r--r--src/location/declarativemaps/qdeclarativeroutemapitem_p.h2
-rw-r--r--src/location/declarativemaps/qgeomapitemgeometry.cpp3
-rw-r--r--src/location/declarativemaps/qgeomapitemgeometry_p.h13
-rw-r--r--src/location/declarativemaps/qquickgeomapgesturearea.cpp7
-rw-r--r--src/location/declarativemaps/qquickgeomapgesturearea_p.h78
-rw-r--r--src/location/declarativeplaces/qdeclarativecategory.cpp7
-rw-r--r--src/location/declarativeplaces/qdeclarativecategory_p.h12
-rw-r--r--src/location/declarativeplaces/qdeclarativeplace.cpp15
-rw-r--r--src/location/declarativeplaces/qdeclarativeplace_p.h30
-rw-r--r--src/location/declarativeplaces/qdeclarativeplacecontentmodel.cpp5
-rw-r--r--src/location/declarativeplaces/qdeclarativeplacecontentmodel_p.h12
-rw-r--r--src/location/declarativeplaces/qdeclarativesearchmodelbase.cpp4
-rw-r--r--src/location/declarativeplaces/qdeclarativesearchmodelbase_p.h10
-rw-r--r--src/location/declarativeplaces/qdeclarativesearchresultmodel.cpp4
-rw-r--r--src/location/declarativeplaces/qdeclarativesearchresultmodel_p.h6
-rw-r--r--src/location/declarativeplaces/qdeclarativesupplier.cpp5
-rw-r--r--src/location/declarativeplaces/qdeclarativesupplier_p.h2
-rw-r--r--src/location/declarativeplaces/qdeclarativesupportedcategoriesmodel.cpp5
-rw-r--r--src/location/declarativeplaces/qdeclarativesupportedcategoriesmodel_p.h12
-rw-r--r--src/location/maps/qgeofiletilecache.cpp7
-rw-r--r--src/location/maps/qgeofiletilecache_p.h24
-rw-r--r--src/location/maps/qgeomap.cpp3
-rw-r--r--src/location/maps/qgeorouteparser.cpp5
-rw-r--r--src/location/maps/qgeorouteparser_p_p.h2
-rw-r--r--src/location/maps/qgeorouteparserosrmv4.cpp3
-rw-r--r--src/location/maps/qgeoroutereply.cpp10
-rw-r--r--src/location/maps/qgeoroutereply_p.h6
-rw-r--r--src/location/maps/qgeotiledmappingmanagerengine.cpp16
-rw-r--r--src/location/maps/qgeotiledmappingmanagerengine_p.h2
-rw-r--r--src/location/maps/qgeotiledmappingmanagerengine_p_p.h17
-rw-r--r--src/location/maps/qgeotiledmapreply.cpp12
-rw-r--r--src/location/maps/qgeotiledmapreply_p_p.h9
-rw-r--r--src/location/maps/qgeotilespec.cpp10
-rw-r--r--src/location/places/qplace.cpp4
-rw-r--r--src/location/places/qplaceattribute_p.h2
-rw-r--r--src/location/places/qplacecontent.cpp8
-rw-r--r--src/location/places/qplacecontentreply.cpp8
-rw-r--r--src/location/places/qplacecontentrequest.cpp17
-rw-r--r--src/location/places/qplacecontentrequest_p.h11
-rw-r--r--src/location/places/qplacedetailsreply.cpp4
-rw-r--r--src/location/places/qplaceeditorial.cpp17
-rw-r--r--src/location/places/qplaceeditorial_p.h7
-rw-r--r--src/location/places/qplaceicon.cpp29
-rw-r--r--src/location/places/qplaceicon_p.h9
-rw-r--r--src/location/places/qplaceimage.cpp18
-rw-r--r--src/location/places/qplaceimage_p.h7
-rw-r--r--src/location/places/qplacemanagerengine.cpp11
-rw-r--r--src/location/places/qplacemanagerengine_p.h9
-rw-r--r--src/location/places/qplacematchreply.cpp3
-rw-r--r--src/location/places/qplacematchrequest.cpp33
-rw-r--r--src/location/places/qplaceproposedsearchresult.cpp14
-rw-r--r--src/location/places/qplaceproposedsearchresult_p.h6
-rw-r--r--src/location/places/qplaceratings.cpp16
-rw-r--r--src/location/places/qplaceratings_p.h13
-rw-r--r--src/location/places/qplacereply_p.h10
-rw-r--r--src/location/places/qplaceresult.cpp17
-rw-r--r--src/location/places/qplaceresult_p.h11
-rw-r--r--src/location/places/qplacereview.cpp22
-rw-r--r--src/location/places/qplacereview_p.h9
-rw-r--r--src/location/places/qplacesearchreply.cpp3
-rw-r--r--src/location/places/qplacesearchrequest.cpp47
-rw-r--r--src/location/places/qplacesearchrequest_p.h13
-rw-r--r--src/location/places/qplacesearchsuggestionreply.cpp3
-rw-r--r--src/location/places/qplacesupplier.cpp17
-rw-r--r--src/location/places/qplacesupplier_p.h7
-rw-r--r--src/location/places/qplaceuser.cpp14
-rw-r--r--src/location/places/qplaceuser_p.h7
94 files changed, 352 insertions, 803 deletions
diff --git a/src/location/declarativemaps/qdeclarativegeocodemodel.cpp b/src/location/declarativemaps/qdeclarativegeocodemodel.cpp
index 8089ae0f..fb177a06 100644
--- a/src/location/declarativemaps/qdeclarativegeocodemodel.cpp
+++ b/src/location/declarativemaps/qdeclarativegeocodemodel.cpp
@@ -118,9 +118,7 @@ QT_BEGIN_NAMESPACE
QDeclarativeGeocodeModel::QDeclarativeGeocodeModel(QObject *parent)
-: QAbstractListModel(parent), autoUpdate_(false), complete_(false), reply_(0), plugin_(0),
- status_(QDeclarativeGeocodeModel::Null), error_(QDeclarativeGeocodeModel::NoError),
- address_(0), limit_(-1), offset_(0)
+ : QAbstractListModel(parent)
{
}
diff --git a/src/location/declarativemaps/qdeclarativegeocodemodel_p.h b/src/location/declarativemaps/qdeclarativegeocodemodel_p.h
index a70fc85c..134874c5 100644
--- a/src/location/declarativemaps/qdeclarativegeocodemodel_p.h
+++ b/src/location/declarativemaps/qdeclarativegeocodemodel_p.h
@@ -180,29 +180,29 @@ protected:
QGeoCodingManager *searchManager();
void setStatus(Status status);
void setError(GeocodeError error, const QString &errorString);
- bool autoUpdate_;
- bool complete_;
+ bool autoUpdate_ = false;
+ bool complete_ = false;
private:
void setLocations(const QList<QGeoLocation> &locations);
void abortRequest();
- QGeoCodeReply *reply_;
+ QGeoCodeReply *reply_ = nullptr;
- QDeclarativeGeoServiceProvider *plugin_;
+ QDeclarativeGeoServiceProvider *plugin_ = nullptr;
QGeoShape boundingArea_;
QList<QDeclarativeGeoLocation *> declarativeLocations_;
- Status status_;
+ Status status_ = QDeclarativeGeocodeModel::Null;
QString errorString_;
- GeocodeError error_;
+ GeocodeError error_ = QDeclarativeGeocodeModel::NoError;
QVariant queryVariant_;
QGeoCoordinate coordinate_;
- QDeclarativeGeoAddress *address_;
+ QDeclarativeGeoAddress *address_ = nullptr;
QString searchString_;
- int limit_;
- int offset_;
+ int limit_ = -1;
+ int offset_ = 0;
};
QT_END_NAMESPACE
diff --git a/src/location/declarativemaps/qdeclarativegeomap.cpp b/src/location/declarativemaps/qdeclarativegeomap.cpp
index 8a877cc8..df89ee90 100644
--- a/src/location/declarativemaps/qdeclarativegeomap.cpp
+++ b/src/location/declarativemaps/qdeclarativegeomap.cpp
@@ -178,26 +178,10 @@ static qreal sanitizeBearing(qreal bearing)
*/
QDeclarativeGeoMap::QDeclarativeGeoMap(QQuickItem *parent)
- : QQuickItem(parent),
- m_plugin(0),
- m_mappingManager(0),
- m_activeMapType(0),
- m_gestureArea(new QQuickGeoMapGestureArea(this)),
- m_map(0),
- m_error(QGeoServiceProvider::NoError),
- m_color(QColor::fromRgbF(0.9f, 0.9f, 0.9f)),
- m_componentCompleted(false),
- m_pendingFitViewport(false),
- m_copyrightsVisible(true),
- m_maximumViewportLatitude(0.0),
- m_initialized(false),
- m_userMinimumZoomLevel(qQNaN()),
- m_userMaximumZoomLevel(qQNaN()),
- m_userMinimumTilt(qQNaN()),
- m_userMaximumTilt(qQNaN()),
- m_userMinimumFieldOfView(qQNaN()),
- m_userMaximumFieldOfView(qQNaN())
+ : QQuickItem(parent)
{
+ m_gestureArea = new QQuickGeoMapGestureArea(this);
+
setAcceptHoverEvents(false);
setAcceptTouchEvents(true);
setAcceptedMouseButtons(Qt::LeftButton);
diff --git a/src/location/declarativemaps/qdeclarativegeomap_p.h b/src/location/declarativemaps/qdeclarativegeomap_p.h
index 9f5d21c9..721406c7 100644
--- a/src/location/declarativemaps/qdeclarativegeomap_p.h
+++ b/src/location/declarativemaps/qdeclarativegeomap_p.h
@@ -295,43 +295,43 @@ private:
private:
QQuickWindow *m_window = nullptr;
- QDeclarativeGeoServiceProvider *m_plugin;
- QGeoMappingManager *m_mappingManager;
- QDeclarativeGeoMapType *m_activeMapType;
+ QDeclarativeGeoServiceProvider *m_plugin = nullptr;
+ QGeoMappingManager *m_mappingManager = nullptr;
+ QDeclarativeGeoMapType *m_activeMapType = nullptr;
QList<QDeclarativeGeoMapType *> m_supportedMapTypes;
QList<QDeclarativeGeoMapItemView *> m_mapViews;
- QQuickGeoMapGestureArea *m_gestureArea;
+ QQuickGeoMapGestureArea *m_gestureArea = nullptr;
QPointer<QGeoMap> m_map;
QPointer<QDeclarativeGeoMapCopyrightNotice> m_copyrights;
QList<QPointer<QDeclarativeGeoMapItemBase> > m_mapItems;
QList<QPointer<QDeclarativeGeoMapItemGroup> > m_mapItemGroups;
QString m_errorString;
- QGeoServiceProvider::Error m_error;
+ QGeoServiceProvider::Error m_error = QGeoServiceProvider::NoError;
QGeoRectangle m_visibleRegion;
- QColor m_color;
+ QColor m_color = QColor::fromRgbF(0.9f, 0.9f, 0.9f);
QGeoCameraData m_cameraData;
- bool m_componentCompleted;
- bool m_pendingFitViewport;
- bool m_copyrightsVisible;
- double m_maximumViewportLatitude;
+ bool m_componentCompleted = false;
+ bool m_pendingFitViewport = false;
+ bool m_copyrightsVisible = true;
+ double m_maximumViewportLatitude = 0.0;
double m_minimumViewportLatitude = 0.0;
- bool m_initialized;
+ bool m_initialized = false;
bool m_sgNodeHasChanged = false;
QList<QDeclarativeGeoMapParameter *> m_mapParameters;
QList<QGeoMapObject*> m_pendingMapObjects; // Used only in the initialization phase
QGeoCameraCapabilities m_cameraCapabilities;
- qreal m_userMinimumZoomLevel;
- qreal m_userMaximumZoomLevel;
-
- qreal m_minimumTilt;
- qreal m_maximumTilt;
- qreal m_userMinimumTilt;
- qreal m_userMaximumTilt;
-
- qreal m_minimumFieldOfView;
- qreal m_maximumFieldOfView;
- qreal m_userMinimumFieldOfView;
- qreal m_userMaximumFieldOfView;
+ qreal m_userMinimumZoomLevel = Q_QNAN;
+ qreal m_userMaximumZoomLevel = Q_QNAN;
+
+ qreal m_minimumTilt = Q_QNAN;
+ qreal m_maximumTilt = Q_QNAN;
+ qreal m_userMinimumTilt = Q_QNAN;
+ qreal m_userMaximumTilt = Q_QNAN;
+
+ qreal m_minimumFieldOfView = Q_QNAN;
+ qreal m_maximumFieldOfView = Q_QNAN;
+ qreal m_userMinimumFieldOfView = Q_QNAN;
+ qreal m_userMaximumFieldOfView = Q_QNAN;
int m_copyNoticesVisible = 0;
qreal m_maxChildZ = 0;
diff --git a/src/location/declarativemaps/qdeclarativegeomapcopyrightsnotice.cpp b/src/location/declarativemaps/qdeclarativegeomapcopyrightsnotice.cpp
index 8505c90a..72de153e 100644
--- a/src/location/declarativemaps/qdeclarativegeomapcopyrightsnotice.cpp
+++ b/src/location/declarativemaps/qdeclarativegeomapcopyrightsnotice.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2014 Aaron McCarthy <mccarthy.aaron@gmail.com>
-** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtLocation module of the Qt Toolkit.
@@ -100,8 +100,7 @@ public:
*/
QDeclarativeGeoMapCopyrightNotice::QDeclarativeGeoMapCopyrightNotice(QQuickItem *parent)
-: QQuickPaintedItem(parent), m_copyrightsHtml(0), m_copyrightsVisible(true), m_mapSource(0),
- m_userDefinedStyleSheet(false)
+: QQuickPaintedItem(parent)
{
// If this item is constructed inside the map, automatically anchor it where it always used to be.
if (qobject_cast<QDeclarativeGeoMap *>(parent))
diff --git a/src/location/declarativemaps/qdeclarativegeomapcopyrightsnotice_p.h b/src/location/declarativemaps/qdeclarativegeomapcopyrightsnotice_p.h
index 5127c95f..7e4c9957 100644
--- a/src/location/declarativemaps/qdeclarativegeomapcopyrightsnotice_p.h
+++ b/src/location/declarativemaps/qdeclarativegeomapcopyrightsnotice_p.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2014 Aaron McCarthy <mccarthy.aaron@gmail.com>
-** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtLocation module of the Qt Toolkit.
@@ -110,15 +110,15 @@ protected:
private:
void createCopyright();
- QTextDocument *m_copyrightsHtml;
+ QTextDocument *m_copyrightsHtml = nullptr;
QString m_html;
QImage m_copyrightsImage;
QString m_activeAnchor;
- bool m_copyrightsVisible;
+ bool m_copyrightsVisible = true;
QPointer<QDeclarativeGeoMap> m_mapSource;
QColor m_backgroundColor;
QString m_styleSheet;
- bool m_userDefinedStyleSheet;
+ bool m_userDefinedStyleSheet = false;
Q_DISABLE_COPY(QDeclarativeGeoMapCopyrightNotice)
Q_DECLARE_PRIVATE(QDeclarativeGeoMapCopyrightNotice)
diff --git a/src/location/declarativemaps/qdeclarativegeomapitembase.cpp b/src/location/declarativemaps/qdeclarativegeomapitembase.cpp
index 78bcfe90..85478d0e 100644
--- a/src/location/declarativemaps/qdeclarativegeomapitembase.cpp
+++ b/src/location/declarativemaps/qdeclarativegeomapitembase.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtLocation module of the Qt Toolkit.
@@ -51,40 +51,8 @@
QT_BEGIN_NAMESPACE
-QGeoMapViewportChangeEvent::QGeoMapViewportChangeEvent()
- : zoomLevelChanged(false),
- centerChanged(false),
- mapSizeChanged(false),
- tiltChanged(false),
- bearingChanged(false),
- rollChanged(false)
-{
-}
-
-QGeoMapViewportChangeEvent::QGeoMapViewportChangeEvent(const QGeoMapViewportChangeEvent &other)
-{
- this->operator=(other);
-}
-
-QGeoMapViewportChangeEvent &QGeoMapViewportChangeEvent::operator=(const QGeoMapViewportChangeEvent &other)
-{
- if (this == &other)
- return (*this);
-
- cameraData = other.cameraData;
- mapSize = other.mapSize;
- zoomLevelChanged = other.zoomLevelChanged;
- centerChanged = other.centerChanged;
- mapSizeChanged = other.mapSizeChanged;
- tiltChanged = other.tiltChanged;
- bearingChanged = other.bearingChanged;
- rollChanged = other.rollChanged;
-
- return (*this);
-}
-
QDeclarativeGeoMapItemBase::QDeclarativeGeoMapItemBase(QQuickItem *parent)
-: QQuickItem(parent), map_(0), quickMap_(0), parentGroup_(0)
+ : QQuickItem(parent)
{
setFiltersChildMouseEvents(true);
connect(this, &QDeclarativeGeoMapItemBase::childrenChanged,
diff --git a/src/location/declarativemaps/qdeclarativegeomapitembase_p.h b/src/location/declarativemaps/qdeclarativegeomapitembase_p.h
index d1166291..7c029d80 100644
--- a/src/location/declarativemaps/qdeclarativegeomapitembase_p.h
+++ b/src/location/declarativemaps/qdeclarativegeomapitembase_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtLocation module of the Qt Toolkit.
@@ -64,22 +64,17 @@
QT_BEGIN_NAMESPACE
-class Q_LOCATION_PRIVATE_EXPORT QGeoMapViewportChangeEvent
+struct Q_LOCATION_PRIVATE_EXPORT QGeoMapViewportChangeEvent
{
-public:
- explicit QGeoMapViewportChangeEvent();
- QGeoMapViewportChangeEvent(const QGeoMapViewportChangeEvent &other);
- QGeoMapViewportChangeEvent &operator=(const QGeoMapViewportChangeEvent &other);
-
QGeoCameraData cameraData;
QSizeF mapSize;
- bool zoomLevelChanged;
- bool centerChanged;
- bool mapSizeChanged;
- bool tiltChanged;
- bool bearingChanged;
- bool rollChanged;
+ bool zoomLevelChanged = false;
+ bool centerChanged = false;
+ bool mapSizeChanged = false;
+ bool tiltChanged = false;
+ bool bearingChanged = false;
+ bool rollChanged = false;
};
class Q_LOCATION_PRIVATE_EXPORT QDeclarativeGeoMapItemBase : public QQuickItem
@@ -159,12 +154,12 @@ private Q_SLOTS:
private:
QPointer<QGeoMap> map_;
- QDeclarativeGeoMap *quickMap_;
+ QDeclarativeGeoMap *quickMap_ = nullptr;
QSizeF lastSize_;
QGeoCameraData lastCameraData_;
- QDeclarativeGeoMapItemGroup *parentGroup_;
+ QDeclarativeGeoMapItemGroup *parentGroup_ = nullptr;
std::unique_ptr<QDeclarativeGeoMapItemTransitionManager> m_transitionManager;
bool m_autoFadeIn = true;
diff --git a/src/location/declarativemaps/qdeclarativegeomapitemgroup.cpp b/src/location/declarativemaps/qdeclarativegeomapitemgroup.cpp
index 9c6cf2a9..fde79f85 100644
--- a/src/location/declarativemaps/qdeclarativegeomapitemgroup.cpp
+++ b/src/location/declarativemaps/qdeclarativegeomapitemgroup.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtLocation module of the Qt Toolkit.
@@ -141,7 +141,7 @@ QT_BEGIN_NAMESPACE
*/
QDeclarativeGeoMapItemGroup::QDeclarativeGeoMapItemGroup(QQuickItem *parent)
-: QQuickItem(parent), m_quickMap(nullptr)
+ : QQuickItem(parent)
{
connect(this, &QQuickItem::opacityChanged,
this, &QDeclarativeGeoMapItemGroup::mapItemOpacityChanged);
diff --git a/src/location/declarativemaps/qdeclarativegeomapitemgroup_p.h b/src/location/declarativemaps/qdeclarativegeomapitemgroup_p.h
index 58bf887d..96ef18d7 100644
--- a/src/location/declarativemaps/qdeclarativegeomapitemgroup_p.h
+++ b/src/location/declarativemaps/qdeclarativegeomapitemgroup_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtLocation module of the Qt Toolkit.
@@ -85,7 +85,7 @@ protected slots:
void onMapSizeChanged();
private:
- QDeclarativeGeoMap *m_quickMap;
+ QDeclarativeGeoMap *m_quickMap = nullptr;
QDeclarativeGeoMapItemGroup *m_parentGroup = nullptr;
std::unique_ptr<QDeclarativeGeoMapItemTransitionManager> m_transitionManager;
diff --git a/src/location/declarativemaps/qdeclarativegeomapitemview.cpp b/src/location/declarativemaps/qdeclarativegeomapitemview.cpp
index c95ae980..e5952075 100644
--- a/src/location/declarativemaps/qdeclarativegeomapitemview.cpp
+++ b/src/location/declarativemaps/qdeclarativegeomapitemview.cpp
@@ -2,7 +2,7 @@
**
** Copyright (C) 2015 Jolla Ltd.
** Contact: Aaron McCarthy <aaron.mccarthy@jollamobile.com>
-** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtLocation module of the Qt Toolkit.
@@ -94,8 +94,7 @@ QT_BEGIN_NAMESPACE
*/
QDeclarativeGeoMapItemView::QDeclarativeGeoMapItemView(QQuickItem *parent)
- : QDeclarativeGeoMapItemGroup(parent), m_componentCompleted(false), m_delegate(0),
- m_map(0), m_fitViewport(false), m_delegateModel(0)
+ : QDeclarativeGeoMapItemGroup(parent)
{
m_exit = new QQuickTransition(this);
QQmlListProperty<QQuickAbstractAnimation> anims = m_exit->animations();
diff --git a/src/location/declarativemaps/qdeclarativegeomapitemview_p.h b/src/location/declarativemaps/qdeclarativegeomapitemview_p.h
index ce81d87d..0b5e1274 100644
--- a/src/location/declarativemaps/qdeclarativegeomapitemview_p.h
+++ b/src/location/declarativemaps/qdeclarativegeomapitemview_p.h
@@ -2,7 +2,7 @@
**
** Copyright (C) 2015 Jolla Ltd.
** Contact: Aaron McCarthy <aaron.mccarthy@jollamobile.com>
-** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtLocation module of the Qt Toolkit.
@@ -142,15 +142,15 @@ private:
void addItemGroupToMap(QDeclarativeGeoMapItemGroup *item, int index, bool createdItem);
void addDelegateToMap(QQuickItem *object, int index, bool createdItem = false);
- bool m_componentCompleted;
+ bool m_componentCompleted = false;
QQmlIncubator::IncubationMode m_incubationMode = QQmlIncubator::Asynchronous;
- QQmlComponent *m_delegate;
+ QQmlComponent *m_delegate = nullptr;
QVariant m_itemModel;
- QDeclarativeGeoMap *m_map;
+ QDeclarativeGeoMap *m_map = nullptr;
QList<QQuickItem *> m_instantiatedItems;
- bool m_fitViewport;
+ bool m_fitViewport = false;
bool m_creatingObject = false;
- QQmlDelegateModel *m_delegateModel;
+ QQmlDelegateModel *m_delegateModel = nullptr;
QQuickTransition *m_enter = nullptr;
QQuickTransition *m_exit = nullptr;
diff --git a/src/location/declarativemaps/qdeclarativegeomapparameter.cpp b/src/location/declarativemaps/qdeclarativegeomapparameter.cpp
index 5c0d580a..ac654572 100644
--- a/src/location/declarativemaps/qdeclarativegeomapparameter.cpp
+++ b/src/location/declarativemaps/qdeclarativegeomapparameter.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtLocation module of the Qt Toolkit.
@@ -105,9 +105,8 @@ Q_SIGNALS:
*/
QDeclarativeGeoMapParameter::QDeclarativeGeoMapParameter(QObject *parent)
-: QGeoMapParameter(parent), m_initialPropertyCount(metaObject()->propertyCount()), m_complete(false)
+ : QGeoMapParameter(parent)
{
-
}
QDeclarativeGeoMapParameter::~QDeclarativeGeoMapParameter()
diff --git a/src/location/declarativemaps/qdeclarativegeomapparameter_p.h b/src/location/declarativemaps/qdeclarativegeomapparameter_p.h
index 0e25c830..994baccc 100644
--- a/src/location/declarativemaps/qdeclarativegeomapparameter_p.h
+++ b/src/location/declarativemaps/qdeclarativegeomapparameter_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtLocation module of the Qt Toolkit.
@@ -82,8 +82,8 @@ private slots:
void onPropertyUpdated(int index);
private:
- int m_initialPropertyCount;
- bool m_complete;
+ const int m_initialPropertyCount = staticMetaObject.propertyCount();
+ bool m_complete = false;
};
QT_END_NAMESPACE
diff --git a/src/location/declarativemaps/qdeclarativegeomapquickitem.cpp b/src/location/declarativemaps/qdeclarativegeomapquickitem.cpp
index 548edbd3..59c770d5 100644
--- a/src/location/declarativemaps/qdeclarativegeomapquickitem.cpp
+++ b/src/location/declarativemaps/qdeclarativegeomapquickitem.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtLocation module of the Qt Toolkit.
@@ -146,8 +146,7 @@ void QMapQuickItemMatrix4x4::applyTo(QMatrix4x4 *matrix) const
QDeclarativeGeoMapQuickItem::QDeclarativeGeoMapQuickItem(QQuickItem *parent)
-: QDeclarativeGeoMapItemBase(parent), zoomLevel_(0.0),
- mapAndSourceItemSet_(false), updatingGeometry_(false), matrix_(nullptr)
+ : QDeclarativeGeoMapItemBase(parent)
{
m_itemType = QGeoMap::MapQuickItem;
setFlag(ItemHasContents, true);
diff --git a/src/location/declarativemaps/qdeclarativegeomapquickitem_p.h b/src/location/declarativemaps/qdeclarativegeomapquickitem_p.h
index 23e450c9..4ffd5af6 100644
--- a/src/location/declarativemaps/qdeclarativegeomapquickitem_p.h
+++ b/src/location/declarativemaps/qdeclarativegeomapquickitem_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtLocation module of the Qt Toolkit.
@@ -123,12 +123,12 @@ private:
QGeoCoordinate coordinate_;
QGeoRectangle geoshape_;
QPointer<QQuickItem> sourceItem_;
- QQuickItem *opacityContainer_;
+ QQuickItem *opacityContainer_ = nullptr;
QPointF anchorPoint_;
- qreal zoomLevel_;
- bool mapAndSourceItemSet_;
- bool updatingGeometry_;
- QMapQuickItemMatrix4x4 *matrix_;
+ qreal zoomLevel_ = 0.0;
+ bool mapAndSourceItemSet_ = false;
+ bool updatingGeometry_ = false;
+ QMapQuickItemMatrix4x4 *matrix_ = nullptr;
friend class QDeclarativeGeoMap;
};
diff --git a/src/location/declarativemaps/qdeclarativegeoroutemodel.cpp b/src/location/declarativemaps/qdeclarativegeoroutemodel.cpp
index f1cafc9a..c1084bda 100644
--- a/src/location/declarativemaps/qdeclarativegeoroutemodel.cpp
+++ b/src/location/declarativemaps/qdeclarativegeoroutemodel.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtLocation module of the Qt Toolkit.
@@ -173,13 +173,7 @@ static QList<QVariantMap> waypointMetadata(const QList<QDeclarativeGeoWaypoint *
*/
QDeclarativeGeoRouteModel::QDeclarativeGeoRouteModel(QObject *parent)
- : QAbstractListModel(parent),
- complete_(false),
- plugin_(0),
- routeQuery_(0),
- autoUpdate_(false),
- status_(QDeclarativeGeoRouteModel::Null),
- error_(QDeclarativeGeoRouteModel::NoError)
+ : QAbstractListModel(parent)
{
}
@@ -757,12 +751,12 @@ void QDeclarativeGeoRouteModel::routingError(QGeoRouteReply *reply,
*/
QDeclarativeGeoRouteQuery::QDeclarativeGeoRouteQuery(QObject *parent)
-: QObject(parent), complete_(false), m_excludedAreaCoordinateChanged(false)
+ : QObject(parent)
{
}
QDeclarativeGeoRouteQuery::QDeclarativeGeoRouteQuery(const QGeoRouteRequest &request, QObject *parent)
-: QObject(parent), request_(request), complete_(false), m_excludedAreaCoordinateChanged(false)
+ : QObject(parent), request_(request)
{
// Extra params assumed to be already set in the request.
// Init waypoints
diff --git a/src/location/declarativemaps/qdeclarativegeoroutemodel_p.h b/src/location/declarativemaps/qdeclarativegeoroutemodel_p.h
index 735a7105..cc074e9f 100644
--- a/src/location/declarativemaps/qdeclarativegeoroutemodel_p.h
+++ b/src/location/declarativemaps/qdeclarativegeoroutemodel_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtLocation module of the Qt Toolkit.
@@ -174,16 +174,16 @@ private:
void setStatus(Status status);
void setError(RouteError error, const QString &errorString);
- bool complete_;
+ bool complete_ = false;
- QDeclarativeGeoServiceProvider *plugin_;
- QDeclarativeGeoRouteQuery *routeQuery_;
+ QDeclarativeGeoServiceProvider *plugin_ = nullptr;
+ QDeclarativeGeoRouteQuery *routeQuery_ = nullptr;
QList<QDeclarativeGeoRoute *> routes_;
- bool autoUpdate_;
- Status status_;
+ bool autoUpdate_ = false;
+ Status status_ = QDeclarativeGeoRouteModel::Null;
QString errorString_;
- RouteError error_;
+ RouteError error_ = QDeclarativeGeoRouteModel::NoError;
};
@@ -459,8 +459,8 @@ private:
Q_INVOKABLE void doCoordinateChanged();
QGeoRouteRequest request_;
- bool complete_;
- bool m_excludedAreaCoordinateChanged;
+ bool complete_ = false;
+ bool m_excludedAreaCoordinateChanged = false;
bool m_extraParametersChanged = false;
bool m_waypointsChanged = false;
QList<QDeclarativeGeoWaypoint *> m_waypoints;
diff --git a/src/location/declarativemaps/qdeclarativegeoserviceprovider.cpp b/src/location/declarativemaps/qdeclarativegeoserviceprovider.cpp
index be8f29a6..743cba76 100644
--- a/src/location/declarativemaps/qdeclarativegeoserviceprovider.cpp
+++ b/src/location/declarativemaps/qdeclarativegeoserviceprovider.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtLocation module of the Qt Toolkit.
@@ -87,19 +87,13 @@ QT_BEGIN_NAMESPACE
*/
QDeclarativeGeoServiceProvider::QDeclarativeGeoServiceProvider(QObject *parent)
-: QObject(parent),
- sharedProvider_(0),
- required_(new QDeclarativeGeoServiceProviderRequirements),
- complete_(false),
- experimental_(false)
+: QObject(parent), required_(new QDeclarativeGeoServiceProviderRequirements)
{
locales_.append(QLocale().name());
}
QDeclarativeGeoServiceProvider::~QDeclarativeGeoServiceProvider()
{
- delete required_;
- delete sharedProvider_;
}
@@ -143,13 +137,12 @@ void QDeclarativeGeoServiceProvider::tryAttach()
if (!parametersReady())
return;
- delete sharedProvider_;
- sharedProvider_ = nullptr;
+ sharedProvider_.reset();
if (name_.isEmpty())
return;
- sharedProvider_ = new QGeoServiceProvider(name_, parameterMap());
+ sharedProvider_.reset(new QGeoServiceProvider(name_, parameterMap()));
sharedProvider_->setQmlEngine(qmlEngine(this));
sharedProvider_->setLocale(QLocale(locales_.at(0)));
sharedProvider_->setAllowExperimental(experimental_);
@@ -476,7 +469,7 @@ bool QDeclarativeGeoServiceProvider::supportsNavigation(const QDeclarativeGeoSer
*/
QDeclarativeGeoServiceProviderRequirements *QDeclarativeGeoServiceProvider::requirements() const
{
- return required_;
+ return required_.get();
}
void QDeclarativeGeoServiceProvider::setRequirements(QDeclarativeGeoServiceProviderRequirements *req)
@@ -487,8 +480,7 @@ void QDeclarativeGeoServiceProvider::setRequirements(QDeclarativeGeoServiceProvi
if (required_ && *required_ == *req)
return;
- delete required_;
- required_ = req;
+ required_.reset(req);
QQmlEngine::setObjectOwnership(req, QQmlEngine::CppOwnership); // To prevent the engine from making this object disappear
}
@@ -547,7 +539,7 @@ void QDeclarativeGeoServiceProvider::setAllowExperimental(bool allow)
*/
QGeoServiceProvider *QDeclarativeGeoServiceProvider::sharedGeoServiceProvider() const
{
- return sharedProvider_;
+ return sharedProvider_.get();
}
/*!
@@ -674,12 +666,7 @@ QVariantMap QDeclarativeGeoServiceProvider::parameterMap() const
*******************************************************************************/
QDeclarativeGeoServiceProviderRequirements::QDeclarativeGeoServiceProviderRequirements(QObject *parent)
- : QObject(parent),
- mapping_(QDeclarativeGeoServiceProvider::NoMappingFeatures),
- routing_(QDeclarativeGeoServiceProvider::NoRoutingFeatures),
- geocoding_(QDeclarativeGeoServiceProvider::NoGeocodingFeatures),
- places_(QDeclarativeGeoServiceProvider::NoPlacesFeatures),
- navigation_(QDeclarativeGeoServiceProvider::NoNavigationFeatures)
+ : QObject(parent)
{
}
diff --git a/src/location/declarativemaps/qdeclarativegeoserviceprovider_p.h b/src/location/declarativemaps/qdeclarativegeoserviceprovider_p.h
index f26841d2..d2c56c0b 100644
--- a/src/location/declarativemaps/qdeclarativegeoserviceprovider_p.h
+++ b/src/location/declarativemaps/qdeclarativegeoserviceprovider_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtLocation module of the Qt Toolkit.
@@ -206,12 +206,12 @@ private:
static QDeclarativePluginParameter *parameter_at(QQmlListProperty<QDeclarativePluginParameter> *prop, qsizetype index);
static void parameter_clear(QQmlListProperty<QDeclarativePluginParameter> *prop);
- QGeoServiceProvider *sharedProvider_;
+ std::unique_ptr<QGeoServiceProvider> sharedProvider_;
QString name_;
QList<QDeclarativePluginParameter *> parameters_;
- QDeclarativeGeoServiceProviderRequirements *required_;
- bool complete_;
- bool experimental_;
+ std::unique_ptr<QDeclarativeGeoServiceProviderRequirements> required_;
+ bool complete_ = false;
+ bool experimental_ = false;
QStringList locales_;
QStringList prefer_;
Q_DISABLE_COPY(QDeclarativeGeoServiceProvider)
@@ -269,11 +269,11 @@ Q_SIGNALS:
void requirementsChanged();
private:
- QDeclarativeGeoServiceProvider::MappingFeatures mapping_;
- QDeclarativeGeoServiceProvider::RoutingFeatures routing_;
- QDeclarativeGeoServiceProvider::GeocodingFeatures geocoding_;
- QDeclarativeGeoServiceProvider::PlacesFeatures places_;
- QDeclarativeGeoServiceProvider::NavigationFeatures navigation_;
+ QDeclarativeGeoServiceProvider::MappingFeatures mapping_ = QDeclarativeGeoServiceProvider::NoMappingFeatures;
+ QDeclarativeGeoServiceProvider::RoutingFeatures routing_ = QDeclarativeGeoServiceProvider::NoRoutingFeatures;
+ QDeclarativeGeoServiceProvider::GeocodingFeatures geocoding_ = QDeclarativeGeoServiceProvider::NoGeocodingFeatures;
+ QDeclarativeGeoServiceProvider::PlacesFeatures places_ = QDeclarativeGeoServiceProvider::NoPlacesFeatures;
+ QDeclarativeGeoServiceProvider::NavigationFeatures navigation_ = QDeclarativeGeoServiceProvider::NoNavigationFeatures;
};
QT_END_NAMESPACE
diff --git a/src/location/declarativemaps/qdeclarativepolygonmapitem.cpp b/src/location/declarativemaps/qdeclarativepolygonmapitem.cpp
index 56ee7895..5c44ffff 100644
--- a/src/location/declarativemaps/qdeclarativepolygonmapitem.cpp
+++ b/src/location/declarativemaps/qdeclarativepolygonmapitem.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
- ** Copyright (C) 2015 The Qt Company Ltd.
+ ** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtLocation module of the Qt Toolkit.
@@ -153,10 +153,7 @@ QT_BEGIN_NAMESPACE
\since 5.14
*/
-QGeoMapPolygonGeometry::QGeoMapPolygonGeometry()
-: assumeSimple_(false)
-{
-}
+QGeoMapPolygonGeometry::QGeoMapPolygonGeometry() = default;
/*!
\internal
@@ -333,7 +330,8 @@ void QGeoMapPolygonGeometry::updateScreenPoints(const QGeoMap &map, qreal stroke
this->translate(QPointF(strokeWidth, strokeWidth));
}
-QGeoMapPolygonGeometryOpenGL::QGeoMapPolygonGeometryOpenGL(){
+QGeoMapPolygonGeometryOpenGL::QGeoMapPolygonGeometryOpenGL()
+{
}
void QGeoMapPolygonGeometryOpenGL::updateSourcePoints(const QGeoMap &map, const QList<QDoubleVector2D> &path)
@@ -918,9 +916,9 @@ QSGMaterialType *MapPolygonMaterial::type() const
return &type;
}
-MapPolygonNode::MapPolygonNode() :
- border_(new MapPolylineNode()),
- geometry_(QSGGeometry::defaultAttributes_Point2D(), 0)
+MapPolygonNode::MapPolygonNode()
+ : border_(new MapPolylineNode()),
+ geometry_(QSGGeometry::defaultAttributes_Point2D(), 0)
{
geometry_.setDrawingMode(QSGGeometry::DrawTriangles);
QSGGeometryNode::setMaterial(&fill_material_);
diff --git a/src/location/declarativemaps/qdeclarativepolygonmapitem_p_p.h b/src/location/declarativemaps/qdeclarativepolygonmapitem_p_p.h
index cc9d01a6..be8aa89a 100644
--- a/src/location/declarativemaps/qdeclarativepolygonmapitem_p_p.h
+++ b/src/location/declarativemaps/qdeclarativepolygonmapitem_p_p.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2020 Paolo Angelelli <paolo.angelelli@gmail.com>
-** Copyright (C) 2020 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtLocation module of the Qt Toolkit.
@@ -89,7 +89,7 @@ public:
protected:
QPainterPath srcPath_;
- bool assumeSimple_;
+ bool assumeSimple_ = false;
};
class Q_LOCATION_PRIVATE_EXPORT QGeoMapPolygonGeometryOpenGL : public QGeoMapItemGeometry
@@ -143,7 +143,7 @@ public:
QList<quint32> m_screenIndices;
QDoubleVector2D m_bboxLeftBoundWrapped;
QList<WrappedPolygon> m_wrappedPolygons;
- int m_wrapOffset;
+ int m_wrapOffset = 0;
};
class Q_LOCATION_PRIVATE_EXPORT MapPolygonShader : public QSGMaterialShader
@@ -270,12 +270,13 @@ public:
class Q_LOCATION_PRIVATE_EXPORT QDeclarativePolygonMapItemPrivateCPU: public QDeclarativePolygonMapItemPrivate
{
public:
- QDeclarativePolygonMapItemPrivateCPU(QDeclarativePolygonMapItem &polygon) : QDeclarativePolygonMapItemPrivate(polygon)
+ QDeclarativePolygonMapItemPrivateCPU(QDeclarativePolygonMapItem &polygon)
+ : QDeclarativePolygonMapItemPrivate(polygon)
{
}
QDeclarativePolygonMapItemPrivateCPU(QDeclarativePolygonMapItemPrivate &other)
- : QDeclarativePolygonMapItemPrivate(other)
+ : QDeclarativePolygonMapItemPrivate(other)
{
}
@@ -453,7 +454,7 @@ public:
}
QDeclarativePolygonMapItemPrivateOpenGL(QDeclarativePolygonMapItemPrivate &other)
- : QDeclarativePolygonMapItemPrivate(other)
+ : QDeclarativePolygonMapItemPrivate(other)
{
}
diff --git a/src/location/declarativemaps/qdeclarativepolylinemapitem.cpp b/src/location/declarativemaps/qdeclarativepolylinemapitem.cpp
index a7a3c21c..edfe5e6d 100644
--- a/src/location/declarativemaps/qdeclarativepolylinemapitem.cpp
+++ b/src/location/declarativemaps/qdeclarativepolylinemapitem.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
- ** Copyright (C) 2015 The Qt Company Ltd.
+ ** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtLocation module of the Qt Toolkit.
@@ -316,10 +316,8 @@ static QList<QList<QDoubleVector2D> > clipLine(
\since 5.14
*/
-QDeclarativeMapLineProperties::QDeclarativeMapLineProperties(QObject *parent) :
- QObject(parent),
- width_(1.0),
- color_(Qt::black)
+QDeclarativeMapLineProperties::QDeclarativeMapLineProperties(QObject *parent)
+ : QObject(parent)
{
}
@@ -927,11 +925,8 @@ struct PolylineBackendSelector
Q_GLOBAL_STATIC(PolylineBackendSelector, mapPolylineBackendSelector)
QDeclarativePolylineMapItem::QDeclarativePolylineMapItem(QQuickItem *parent)
-: QDeclarativeGeoMapItemBase(parent),
- m_line(this),
- m_dirtyMaterial(true),
- m_updatingGeometry(false),
- m_d(new QDeclarativePolylineMapItemPrivateCPU(*this))
+ : QDeclarativeGeoMapItemBase(parent), m_line(this),
+ m_d(new QDeclarativePolylineMapItemPrivateCPU(*this))
{
m_itemType = QGeoMap::MapPolyline;
m_geopath = QGeoPathEager();
diff --git a/src/location/declarativemaps/qdeclarativepolylinemapitem_p.h b/src/location/declarativemaps/qdeclarativepolylinemapitem_p.h
index b1317944..a754fa5e 100644
--- a/src/location/declarativemaps/qdeclarativepolylinemapitem_p.h
+++ b/src/location/declarativemaps/qdeclarativepolylinemapitem_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtLocation module of the Qt Toolkit.
@@ -84,8 +84,8 @@ Q_SIGNALS:
void colorChanged(const QColor &color);
private:
- qreal width_;
- QColor color_;
+ qreal width_ = 1.0;
+ QColor color_ = Qt::black;
};
class QDeclarativePolylineMapItemPrivate;
@@ -158,8 +158,8 @@ public:
QDeclarativeMapLineProperties m_line;
Backend m_backend = Software;
- bool m_dirtyMaterial;
- bool m_updatingGeometry;
+ bool m_dirtyMaterial = true;
+ bool m_updatingGeometry = false;
std::unique_ptr<QDeclarativePolylineMapItemPrivate> m_d;
diff --git a/src/location/declarativemaps/qdeclarativerectanglemapitem.cpp b/src/location/declarativemaps/qdeclarativerectanglemapitem.cpp
index 5594ef22..b7d01150 100644
--- a/src/location/declarativemaps/qdeclarativerectanglemapitem.cpp
+++ b/src/location/declarativemaps/qdeclarativerectanglemapitem.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtLocation module of the Qt Toolkit.
@@ -143,9 +143,8 @@ struct RectangleBackendSelector
Q_GLOBAL_STATIC(RectangleBackendSelector, mapRectangleBackendSelector)
QDeclarativeRectangleMapItem::QDeclarativeRectangleMapItem(QQuickItem *parent)
-: QDeclarativeGeoMapItemBase(parent), m_border(this), m_color(Qt::transparent), m_dirtyMaterial(true),
- m_updatingGeometry(false)
- , m_d(new QDeclarativeRectangleMapItemPrivateCPU(*this))
+ : QDeclarativeGeoMapItemBase(parent), m_border(this),
+ m_d(new QDeclarativeRectangleMapItemPrivateCPU(*this))
{
// ToDo: handle envvar, and switch implementation.
m_itemType = QGeoMap::MapRectangle;
diff --git a/src/location/declarativemaps/qdeclarativerectanglemapitem_p.h b/src/location/declarativemaps/qdeclarativerectanglemapitem_p.h
index af2e1ae1..968b9f21 100644
--- a/src/location/declarativemaps/qdeclarativerectanglemapitem_p.h
+++ b/src/location/declarativemaps/qdeclarativerectanglemapitem_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtLocation module of the Qt Toolkit.
@@ -124,10 +124,10 @@ protected Q_SLOTS:
private:
QGeoRectangle m_rectangle;
QDeclarativeMapLineProperties m_border;
- QColor m_color;
- bool m_dirtyMaterial;
+ QColor m_color = Qt::transparent;
+ bool m_dirtyMaterial = true;
- bool m_updatingGeometry;
+ bool m_updatingGeometry = false;
Backend m_backend = Software;
std::unique_ptr<QDeclarativeRectangleMapItemPrivate> m_d;
diff --git a/src/location/declarativemaps/qdeclarativeroutemapitem.cpp b/src/location/declarativemaps/qdeclarativeroutemapitem.cpp
index a5e90db5..4badf4fd 100644
--- a/src/location/declarativemaps/qdeclarativeroutemapitem.cpp
+++ b/src/location/declarativemaps/qdeclarativeroutemapitem.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtLocation module of the Qt Toolkit.
@@ -96,7 +96,7 @@ QT_BEGIN_NAMESPACE
QDeclarativeRouteMapItem::QDeclarativeRouteMapItem(QQuickItem *parent)
-: QDeclarativePolylineMapItem(parent), route_(0)
+: QDeclarativePolylineMapItem(parent)
{
setFlag(ItemHasContents, true);
}
diff --git a/src/location/declarativemaps/qdeclarativeroutemapitem_p.h b/src/location/declarativemaps/qdeclarativeroutemapitem_p.h
index 6e6f6359..7e8d9667 100644
--- a/src/location/declarativemaps/qdeclarativeroutemapitem_p.h
+++ b/src/location/declarativemaps/qdeclarativeroutemapitem_p.h
@@ -87,7 +87,7 @@ protected:
void setPath(const QJSValue &value) override;
private:
- QDeclarativeGeoRoute *route_;
+ QDeclarativeGeoRoute *route_ = nullptr;
};
QT_END_NAMESPACE
diff --git a/src/location/declarativemaps/qgeomapitemgeometry.cpp b/src/location/declarativemaps/qgeomapitemgeometry.cpp
index 08094b6c..6639f058 100644
--- a/src/location/declarativemaps/qgeomapitemgeometry.cpp
+++ b/src/location/declarativemaps/qgeomapitemgeometry.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtLocation module of the Qt Toolkit.
@@ -49,7 +49,6 @@
QT_BEGIN_NAMESPACE
QGeoMapItemGeometry::QGeoMapItemGeometry()
-: sourceDirty_(true), screenDirty_(true), clipToViewport_(true), preserveGeometry_(false)
{
}
diff --git a/src/location/declarativemaps/qgeomapitemgeometry_p.h b/src/location/declarativemaps/qgeomapitemgeometry_p.h
index 8dd8c83c..b6c4a515 100644
--- a/src/location/declarativemaps/qgeomapitemgeometry_p.h
+++ b/src/location/declarativemaps/qgeomapitemgeometry_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
- ** Copyright (C) 2015 The Qt Company Ltd.
+ ** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtLocation module of the Qt Toolkit.
@@ -137,14 +137,13 @@ public:
mutable bool m_dataChanged = false;
private:
- QGeoMapItemGeometry(const QGeoMapItemGeometry &other); // Or else it may crash on copy
- QGeoMapItemGeometry &operator= (const QGeoMapItemGeometry & other); // Or else it may crash on copy
+ Q_DISABLE_COPY(QGeoMapItemGeometry);
protected:
- bool sourceDirty_;
- bool screenDirty_;
- bool clipToViewport_;
- bool preserveGeometry_;
+ bool sourceDirty_ = true;
+ bool screenDirty_ = true;
+ bool clipToViewport_ = true;
+ bool preserveGeometry_ = false;
QGeoCoordinate geoLeftBound_;
QPointF firstPointOffset_;
diff --git a/src/location/declarativemaps/qquickgeomapgesturearea.cpp b/src/location/declarativemaps/qquickgeomapgesturearea.cpp
index c750d7d6..4e4b5609 100644
--- a/src/location/declarativemaps/qquickgeomapgesturearea.cpp
+++ b/src/location/declarativemaps/qquickgeomapgesturearea.cpp
@@ -502,12 +502,7 @@ QT_BEGIN_NAMESPACE
*/
QQuickGeoMapGestureArea::QQuickGeoMapGestureArea(QDeclarativeGeoMap *map)
- : QQuickItem(map),
- m_map(0),
- m_declarativeMap(map),
- m_enabled(true),
- m_acceptedGestures(PinchGesture | PanGesture | FlickGesture | RotationGesture | TiltGesture),
- m_preventStealing(false)
+ : QQuickItem(map), m_declarativeMap(map)
{
m_touchPointState = touchPoints0;
m_pinchState = pinchInactive;
diff --git a/src/location/declarativemaps/qquickgeomapgesturearea_p.h b/src/location/declarativemaps/qquickgeomapgesturearea_p.h
index 493fe5f8..e8735761 100644
--- a/src/location/declarativemaps/qquickgeomapgesturearea_p.h
+++ b/src/location/declarativemaps/qquickgeomapgesturearea_p.h
@@ -83,16 +83,13 @@ class Q_LOCATION_PRIVATE_EXPORT QGeoMapPinchEvent : public QObject
public:
QGeoMapPinchEvent(const QPointF &center, qreal angle,
- const QPointF &point1, const QPointF &point2,
- int pointCount = 0, bool accepted = true)
+ const QPointF &point1, const QPointF &point2,
+ int pointCount = 0, bool accepted = true)
: QObject(), m_center(center), m_angle(angle),
m_point1(point1), m_point2(point2),
- m_pointCount(pointCount), m_accepted(accepted) {}
- QGeoMapPinchEvent()
- : QObject(),
- m_angle(0.0),
- m_pointCount(0),
- m_accepted(true) {}
+ m_pointCount(pointCount), m_accepted(accepted)
+ {}
+ QGeoMapPinchEvent() = default;
QPointF center() const { return m_center; }
void setCenter(const QPointF &center) { m_center = center; }
@@ -109,11 +106,11 @@ public:
private:
QPointF m_center;
- qreal m_angle;
+ qreal m_angle = 0.0;
QPointF m_point1;
QPointF m_point2;
- int m_pointCount;
- bool m_accepted;
+ int m_pointCount = 0;
+ bool m_accepted = true;
};
class Q_LOCATION_PRIVATE_EXPORT QQuickGeoMapGestureArea: public QQuickItem
@@ -142,7 +139,8 @@ public:
PanGesture = 0x0002,
FlickGesture = 0x0004,
RotationGesture = 0x0008,
- TiltGesture = 0x0010
+ TiltGesture = 0x0010,
+ AllGestures = 0xffff
};
Q_DECLARE_FLAGS(AcceptedGestures, GeoMapGesture)
@@ -269,63 +267,54 @@ private:
void updateFlickParameters(const QPointF &pos);
private:
- QGeoMap* m_map;
- QDeclarativeGeoMap *m_declarativeMap;
- bool m_enabled;
+ QGeoMap* m_map = nullptr;
+ QDeclarativeGeoMap *m_declarativeMap = nullptr;
+ bool m_enabled = true;
// This should be intended as a "two fingers gesture" struct
struct Pinch
{
- Pinch() : m_pinchEnabled(true), m_rotationEnabled(true), m_tiltEnabled(true),
- m_startDist(0), m_lastAngle(0.0) {}
-
QGeoMapPinchEvent m_event;
- bool m_pinchEnabled;
- bool m_rotationEnabled;
- bool m_tiltEnabled;
+ bool m_pinchEnabled = true;
+ bool m_rotationEnabled = true;
+ bool m_tiltEnabled = true;
struct Zoom
{
- Zoom() : m_minimum(0.0), m_maximum(30.0), m_start(0.0), m_previous(0.0),
- maximumChange(4.0) {}
- qreal m_minimum;
- qreal m_maximum;
- qreal m_start;
- qreal m_previous;
- qreal maximumChange;
+ qreal m_minimum = 0.0;
+ qreal m_maximum = 30.0;
+ qreal m_start = 0.0;
+ qreal m_previous = 0.0;
+ qreal maximumChange = 4.0;
} m_zoom;
struct Rotation
{
- Rotation() : m_startBearing(0.0), m_previousTouchAngle(0.0), m_totalAngle(0.0) {}
- qreal m_startBearing;
- qreal m_previousTouchAngle; // needed for detecting crossing +- 180 in a safer way
- qreal m_totalAngle;
+ qreal m_startBearing = 0.0;
+ qreal m_previousTouchAngle = 0.0; // needed for detecting crossing +- 180 in a safer way
+ qreal m_totalAngle = 0.0;
} m_rotation;
struct Tilt
{
- Tilt() {}
QPointF m_startTouchCentroid;
qreal m_startTilt;
} m_tilt;
QPointF m_lastPoint1;
QPointF m_lastPoint2;
- qreal m_startDist;
- qreal m_lastAngle;
+ qreal m_startDist = 0.0;
+ qreal m_lastAngle = 0.0;
} m_pinch;
- AcceptedGestures m_acceptedGestures;
+ AcceptedGestures m_acceptedGestures = AllGestures;
struct Pan
{
- Pan() : m_maxVelocity(2500), m_deceleration(2500), m_animation(0), m_flickEnabled(true), m_panEnabled(true) {}
-
- qreal m_maxVelocity;
- qreal m_deceleration;
- QQuickGeoCoordinateAnimation *m_animation;
- bool m_flickEnabled;
- bool m_panEnabled;
+ qreal m_maxVelocity = 2500;
+ qreal m_deceleration = 2500;
+ QQuickGeoCoordinateAnimation *m_animation = nullptr;
+ bool m_flickEnabled = true;
+ bool m_panEnabled = true;
} m_flick;
@@ -347,8 +336,7 @@ private:
qreal m_distanceBetweenTouchPointsStart;
QPointF m_twoTouchPointsCentroidStart;
QPointF m_touchPointsCentroid;
- bool m_preventStealing;
- bool m_panEnabled;
+ bool m_preventStealing = false;
private:
// prototype state machine...
diff --git a/src/location/declarativeplaces/qdeclarativecategory.cpp b/src/location/declarativeplaces/qdeclarativecategory.cpp
index 3403aaf1..281b118e 100644
--- a/src/location/declarativeplaces/qdeclarativecategory.cpp
+++ b/src/location/declarativeplaces/qdeclarativecategory.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtLocation module of the Qt Toolkit.
@@ -82,15 +82,14 @@ QT_BEGIN_NAMESPACE
*/
QDeclarativeCategory::QDeclarativeCategory(QObject *parent)
-: QObject(parent), m_icon(0), m_plugin(0), m_reply(0), m_complete(false), m_status(Ready)
+ : QObject(parent)
{
}
QDeclarativeCategory::QDeclarativeCategory(const QPlaceCategory &category,
QDeclarativeGeoServiceProvider *plugin,
QObject *parent)
-: QObject(parent), m_category(category), m_icon(0), m_plugin(plugin), m_reply(0),
- m_complete(false), m_status(Ready)
+ : QObject(parent), m_category(category), m_plugin(plugin)
{
setCategory(category);
}
diff --git a/src/location/declarativeplaces/qdeclarativecategory_p.h b/src/location/declarativeplaces/qdeclarativecategory_p.h
index cf16b66d..57fb49b5 100644
--- a/src/location/declarativeplaces/qdeclarativecategory_p.h
+++ b/src/location/declarativeplaces/qdeclarativecategory_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtLocation module of the Qt Toolkit.
@@ -143,11 +143,11 @@ private:
QPlaceManager *manager();
QPlaceCategory m_category;
- QDeclarativePlaceIcon *m_icon;
- QDeclarativeGeoServiceProvider *m_plugin;
- QPlaceReply *m_reply;
- bool m_complete;
- Status m_status;
+ QDeclarativePlaceIcon *m_icon = nullptr;
+ QDeclarativeGeoServiceProvider *m_plugin = nullptr;
+ QPlaceReply *m_reply = nullptr;
+ bool m_complete = false;
+ Status m_status = Ready;
QString m_errorString;
};
diff --git a/src/location/declarativeplaces/qdeclarativeplace.cpp b/src/location/declarativeplaces/qdeclarativeplace.cpp
index f01a0b81..e4c6b4e1 100644
--- a/src/location/declarativeplaces/qdeclarativeplace.cpp
+++ b/src/location/declarativeplaces/qdeclarativeplace.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtLocation module of the Qt Toolkit.
@@ -185,11 +185,9 @@ QT_BEGIN_NAMESPACE
*/
QDeclarativePlace::QDeclarativePlace(QObject *parent)
-: QObject(parent), m_location(0), m_ratings(0), m_supplier(0), m_icon(0),
- m_reviewModel(0), m_imageModel(0), m_editorialModel(0),
+: QObject(parent),
m_extendedAttributes(new QQmlPropertyMap(this)),
- m_contactDetails(new QDeclarativeContactDetails(this)), m_reply(0), m_plugin(0),
- m_complete(false), m_favorite(0), m_status(QDeclarativePlace::Ready)
+ m_contactDetails(new QDeclarativeContactDetails(this))
{
connect(m_contactDetails, &QDeclarativeContactDetails::valueChanged,
this, &QDeclarativePlace::contactsModified);
@@ -198,11 +196,10 @@ QDeclarativePlace::QDeclarativePlace(QObject *parent)
}
QDeclarativePlace::QDeclarativePlace(const QPlace &src, QDeclarativeGeoServiceProvider *plugin, QObject *parent)
-: QObject(parent), m_location(0), m_ratings(0), m_supplier(0), m_icon(0),
- m_reviewModel(0), m_imageModel(0), m_editorialModel(0),
+: QObject(parent),
m_extendedAttributes(new QQmlPropertyMap(this)),
- m_contactDetails(new QDeclarativeContactDetails(this)), m_reply(0), m_plugin(plugin),
- m_complete(false), m_favorite(0), m_status(QDeclarativePlace::Ready)
+ m_contactDetails(new QDeclarativeContactDetails(this)),
+ m_plugin(plugin)
{
Q_ASSERT(plugin);
diff --git a/src/location/declarativeplaces/qdeclarativeplace_p.h b/src/location/declarativeplaces/qdeclarativeplace_p.h
index a2e21fe2..c54e3ddf 100644
--- a/src/location/declarativeplaces/qdeclarativeplace_p.h
+++ b/src/location/declarativeplaces/qdeclarativeplace_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtLocation module of the Qt Toolkit.
@@ -228,31 +228,31 @@ private:
QPlaceManager *manager();
QList<QDeclarativeCategory *> m_categories;
- QDeclarativeGeoLocation *m_location;
- QDeclarativeRatings *m_ratings;
- QDeclarativeSupplier *m_supplier;
- QDeclarativePlaceIcon *m_icon;
- QDeclarativeReviewModel *m_reviewModel;
- QDeclarativePlaceImageModel *m_imageModel;
- QDeclarativePlaceEditorialModel *m_editorialModel;
- QQmlPropertyMap *m_extendedAttributes;
- QDeclarativeContactDetails *m_contactDetails;
+ QDeclarativeGeoLocation *m_location = nullptr;
+ QDeclarativeRatings *m_ratings = nullptr;
+ QDeclarativeSupplier *m_supplier = nullptr;
+ QDeclarativePlaceIcon *m_icon = nullptr;
+ QDeclarativeReviewModel *m_reviewModel = nullptr;
+ QDeclarativePlaceImageModel *m_imageModel = nullptr;
+ QDeclarativePlaceEditorialModel *m_editorialModel = nullptr;
+ QQmlPropertyMap *m_extendedAttributes = nullptr;
+ QDeclarativeContactDetails *m_contactDetails = nullptr;
QPlace m_src;
- QPlaceReply *m_reply;
+ QPlaceReply *m_reply = nullptr;
- QDeclarativeGeoServiceProvider *m_plugin;
- bool m_complete;
+ QDeclarativeGeoServiceProvider *m_plugin = nullptr;
+ bool m_complete = false;
QString m_prevPrimaryPhone;
QString m_prevPrimaryEmail;
QString m_prevPrimaryFax;
QUrl m_prevPrimaryWebsite;
- QDeclarativePlace *m_favorite;
+ QDeclarativePlace *m_favorite = nullptr;
- Status m_status;
+ Status m_status = Ready;
QString m_errorString;
QList<QDeclarativeCategory *>m_categoriesToBeDeleted;
diff --git a/src/location/declarativeplaces/qdeclarativeplacecontentmodel.cpp b/src/location/declarativeplaces/qdeclarativeplacecontentmodel.cpp
index 29b101d4..5e8ec41e 100644
--- a/src/location/declarativeplaces/qdeclarativeplacecontentmodel.cpp
+++ b/src/location/declarativeplaces/qdeclarativeplacecontentmodel.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtLocation module of the Qt Toolkit.
@@ -52,8 +52,7 @@ QT_BEGIN_NAMESPACE
QDeclarativePlaceContentModel::QDeclarativePlaceContentModel(QPlaceContent::Type type,
QObject *parent)
-: QAbstractListModel(parent), m_place(0), m_type(type), m_batchSize(1), m_contentCount(-1),
- m_reply(0), m_complete(false)
+ : QAbstractListModel(parent), m_type(type)
{
}
diff --git a/src/location/declarativeplaces/qdeclarativeplacecontentmodel_p.h b/src/location/declarativeplaces/qdeclarativeplacecontentmodel_p.h
index 7f8504fa..0b48039c 100644
--- a/src/location/declarativeplaces/qdeclarativeplacecontentmodel_p.h
+++ b/src/location/declarativeplaces/qdeclarativeplacecontentmodel_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtLocation module of the Qt Toolkit.
@@ -127,15 +127,15 @@ protected:
QMap<QString, QDeclarativePlaceUser *>m_users;
private:
- QDeclarativePlace *m_place;
+ QDeclarativePlace *m_place = nullptr;
QPlaceContent::Type m_type;
- int m_batchSize;
- int m_contentCount;
+ int m_batchSize = 1;
+ int m_contentCount = -1;
- QPlaceContentReply *m_reply;
+ QPlaceContentReply *m_reply = nullptr;
QPlaceContentRequest m_nextRequest;
- bool m_complete;
+ bool m_complete = false;
};
QT_END_NAMESPACE
diff --git a/src/location/declarativeplaces/qdeclarativesearchmodelbase.cpp b/src/location/declarativeplaces/qdeclarativesearchmodelbase.cpp
index d7476aad..ee23b03b 100644
--- a/src/location/declarativeplaces/qdeclarativesearchmodelbase.cpp
+++ b/src/location/declarativeplaces/qdeclarativesearchmodelbase.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtLocation module of the Qt Toolkit.
@@ -55,7 +55,7 @@
QT_BEGIN_NAMESPACE
QDeclarativeSearchModelBase::QDeclarativeSearchModelBase(QObject *parent)
-: QAbstractListModel(parent), m_plugin(0), m_reply(0), m_complete(false), m_status(Null)
+ : QAbstractListModel(parent)
{
}
diff --git a/src/location/declarativeplaces/qdeclarativesearchmodelbase_p.h b/src/location/declarativeplaces/qdeclarativesearchmodelbase_p.h
index 692078b8..c46639ae 100644
--- a/src/location/declarativeplaces/qdeclarativesearchmodelbase_p.h
+++ b/src/location/declarativeplaces/qdeclarativesearchmodelbase_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtLocation module of the Qt Toolkit.
@@ -147,12 +147,12 @@ protected:
void setNextPageRequest(const QPlaceSearchRequest &next);
QPlaceSearchRequest m_request;
- QDeclarativeGeoServiceProvider *m_plugin;
- QPlaceReply *m_reply;
+ QDeclarativeGeoServiceProvider *m_plugin = nullptr;
+ QPlaceReply *m_reply = nullptr;
private:
- bool m_complete;
- Status m_status;
+ bool m_complete = false;
+ Status m_status = Null;
QString m_errorString;
QPlaceSearchRequest m_previousPageRequest;
QPlaceSearchRequest m_nextPageRequest;
diff --git a/src/location/declarativeplaces/qdeclarativesearchresultmodel.cpp b/src/location/declarativeplaces/qdeclarativesearchresultmodel.cpp
index c76024b3..9e16aa70 100644
--- a/src/location/declarativeplaces/qdeclarativesearchresultmodel.cpp
+++ b/src/location/declarativeplaces/qdeclarativesearchresultmodel.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtLocation module of the Qt Toolkit.
@@ -356,7 +356,7 @@ QT_BEGIN_NAMESPACE
*/
QDeclarativeSearchResultModel::QDeclarativeSearchResultModel(QObject *parent)
- : QDeclarativeSearchModelBase(parent), m_favoritesPlugin(0)
+ : QDeclarativeSearchModelBase(parent)
{
}
diff --git a/src/location/declarativeplaces/qdeclarativesearchresultmodel_p.h b/src/location/declarativeplaces/qdeclarativesearchresultmodel_p.h
index 1a11654d..4ecd36ec 100644
--- a/src/location/declarativeplaces/qdeclarativesearchresultmodel_p.h
+++ b/src/location/declarativeplaces/qdeclarativesearchresultmodel_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtLocation module of the Qt Toolkit.
@@ -173,7 +173,7 @@ private:
void removePageRow(int row);
QList<QDeclarativeCategory *> m_categories;
- QLocation::VisibilityScope m_visibilityScope;
+ QLocation::VisibilityScope m_visibilityScope = QLocation::UnspecifiedVisibility;
QMap<int, QList<QPlaceSearchResult>> m_pages;
QList<QPlaceSearchResult> m_results;
@@ -181,7 +181,7 @@ private:
QList<QDeclarativePlace *> m_places;
QList<QDeclarativePlaceIcon *> m_icons;
- QDeclarativeGeoServiceProvider *m_favoritesPlugin;
+ QDeclarativeGeoServiceProvider *m_favoritesPlugin = nullptr;
QVariantMap m_matchParameters;
bool m_incremental = false;
};
diff --git a/src/location/declarativeplaces/qdeclarativesupplier.cpp b/src/location/declarativeplaces/qdeclarativesupplier.cpp
index 99754ae9..54df840b 100644
--- a/src/location/declarativeplaces/qdeclarativesupplier.cpp
+++ b/src/location/declarativeplaces/qdeclarativesupplier.cpp
@@ -72,7 +72,7 @@ QT_BEGIN_NAMESPACE
*/
QDeclarativeSupplier::QDeclarativeSupplier(QObject *parent)
- : QObject(parent), m_icon(0)
+ : QObject(parent)
{
}
@@ -80,8 +80,7 @@ QDeclarativeSupplier::QDeclarativeSupplier(const QPlaceSupplier &src,
QDeclarativeGeoServiceProvider *plugin,
QObject *parent)
: QObject(parent),
- m_src(src),
- m_icon(0)
+ m_src(src)
{
setSupplier(src, plugin);
}
diff --git a/src/location/declarativeplaces/qdeclarativesupplier_p.h b/src/location/declarativeplaces/qdeclarativesupplier_p.h
index 1b3ab020..0c807218 100644
--- a/src/location/declarativeplaces/qdeclarativesupplier_p.h
+++ b/src/location/declarativeplaces/qdeclarativesupplier_p.h
@@ -104,7 +104,7 @@ Q_SIGNALS:
private:
QPlaceSupplier m_src;
- QDeclarativePlaceIcon *m_icon;
+ QDeclarativePlaceIcon *m_icon = nullptr;
};
QT_END_NAMESPACE
diff --git a/src/location/declarativeplaces/qdeclarativesupportedcategoriesmodel.cpp b/src/location/declarativeplaces/qdeclarativesupportedcategoriesmodel.cpp
index 8252d152..2d354b50 100644
--- a/src/location/declarativeplaces/qdeclarativesupportedcategoriesmodel.cpp
+++ b/src/location/declarativeplaces/qdeclarativesupportedcategoriesmodel.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2014 Aaron McCarthy <mccarthy.aaron@gmail.com>
-** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtLocation module of the Qt Toolkit.
@@ -139,8 +139,7 @@ QT_BEGIN_NAMESPACE
*/
QDeclarativeSupportedCategoriesModel::QDeclarativeSupportedCategoriesModel(QObject *parent)
-: QAbstractItemModel(parent), m_response(0), m_plugin(0), m_hierarchical(true),
- m_complete(false), m_status(Null)
+ : QAbstractItemModel(parent)
{
}
diff --git a/src/location/declarativeplaces/qdeclarativesupportedcategoriesmodel_p.h b/src/location/declarativeplaces/qdeclarativesupportedcategoriesmodel_p.h
index a13fe256..2686deeb 100644
--- a/src/location/declarativeplaces/qdeclarativesupportedcategoriesmodel_p.h
+++ b/src/location/declarativeplaces/qdeclarativesupportedcategoriesmodel_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtLocation module of the Qt Toolkit.
@@ -152,12 +152,12 @@ private:
void updateLayout();
void emitDataChanged() { Q_EMIT dataChanged(); }
- QPlaceReply *m_response;
+ QPlaceReply *m_response = nullptr;
- QDeclarativeGeoServiceProvider *m_plugin;
- bool m_hierarchical;
- bool m_complete;
- Status m_status;
+ QDeclarativeGeoServiceProvider *m_plugin = nullptr;
+ bool m_hierarchical = true;
+ bool m_complete = false;
+ Status m_status = Null;
QString m_errorString;
QHash<QString, PlaceCategoryNode *> m_categoriesTree;
diff --git a/src/location/maps/qgeofiletilecache.cpp b/src/location/maps/qgeofiletilecache.cpp
index c2990bc3..36d8dfee 100644
--- a/src/location/maps/qgeofiletilecache.cpp
+++ b/src/location/maps/qgeofiletilecache.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtLocation module of the Qt Toolkit.
@@ -89,11 +89,8 @@ QGeoCachedTileDisk::~QGeoCachedTileDisk()
}
QGeoFileTileCache::QGeoFileTileCache(const QString &directory, QObject *parent)
- : QAbstractGeoTileCache(parent), directory_(directory), minTextureUsage_(0), extraTextureUsage_(0)
- ,costStrategyDisk_(ByteSize), costStrategyMemory_(ByteSize), costStrategyTexture_(ByteSize)
- ,isDiskCostSet_(false), isMemoryCostSet_(false), isTextureCostSet_(false)
+ : QAbstractGeoTileCache(parent), directory_(directory)
{
-
}
void QGeoFileTileCache::init()
diff --git a/src/location/maps/qgeofiletilecache_p.h b/src/location/maps/qgeofiletilecache_p.h
index 128ad092..d0e860e8 100644
--- a/src/location/maps/qgeofiletilecache_p.h
+++ b/src/location/maps/qgeofiletilecache_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtLocation module of the Qt Toolkit.
@@ -151,20 +151,20 @@ protected:
virtual QString tileSpecToFilename(const QGeoTileSpec &spec, const QString &format, const QString &directory) const;
virtual QGeoTileSpec filenameToTileSpec(const QString &filename) const;
- QCache3Q<QGeoTileSpec, QGeoCachedTileDisk, QCache3QTileEvictionPolicy > diskCache_;
- QCache3Q<QGeoTileSpec, QGeoCachedTileMemory > memoryCache_;
- QCache3Q<QGeoTileSpec, QGeoTileTexture > textureCache_;
+ QCache3Q<QGeoTileSpec, QGeoCachedTileDisk, QCache3QTileEvictionPolicy> diskCache_;
+ QCache3Q<QGeoTileSpec, QGeoCachedTileMemory> memoryCache_;
+ QCache3Q<QGeoTileSpec, QGeoTileTexture> textureCache_;
QString directory_;
- int minTextureUsage_;
- int extraTextureUsage_;
- CostStrategy costStrategyDisk_;
- CostStrategy costStrategyMemory_;
- CostStrategy costStrategyTexture_;
- bool isDiskCostSet_;
- bool isMemoryCostSet_;
- bool isTextureCostSet_;
+ int minTextureUsage_ = 0;
+ int extraTextureUsage_ = 0;
+ CostStrategy costStrategyDisk_ = ByteSize;
+ CostStrategy costStrategyMemory_ = ByteSize;
+ CostStrategy costStrategyTexture_ = ByteSize;
+ bool isDiskCostSet_ = false;
+ bool isMemoryCostSet_ = false;
+ bool isTextureCostSet_ = false;
};
QT_END_NAMESPACE
diff --git a/src/location/maps/qgeomap.cpp b/src/location/maps/qgeomap.cpp
index 88c160ea..0318d5f1 100644
--- a/src/location/maps/qgeomap.cpp
+++ b/src/location/maps/qgeomap.cpp
@@ -366,8 +366,7 @@ void QGeoMap::setCopyrightVisible(bool visible)
QGeoMapPrivate::QGeoMapPrivate(QGeoMappingManagerEngine *engine, QGeoProjection *geoProjection)
: QObjectPrivate(),
m_geoProjection(geoProjection),
- m_engine(engine),
- m_activeMapType(QGeoMapType())
+ m_engine(engine)
{
// Setting the default camera caps without emitting anything
if (engine)
diff --git a/src/location/maps/qgeorouteparser.cpp b/src/location/maps/qgeorouteparser.cpp
index 3b34318a..e410e575 100644
--- a/src/location/maps/qgeorouteparser.cpp
+++ b/src/location/maps/qgeorouteparser.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtLocation module of the Qt Toolkit.
@@ -55,7 +55,8 @@ QT_BEGIN_NAMESPACE
Private class implementations
*/
-QGeoRouteParserPrivate::QGeoRouteParserPrivate() : QObjectPrivate(), trafficSide(QGeoRouteParser::RightHandTraffic)
+QGeoRouteParserPrivate::QGeoRouteParserPrivate()
+ : QObjectPrivate()
{
}
diff --git a/src/location/maps/qgeorouteparser_p_p.h b/src/location/maps/qgeorouteparser_p_p.h
index fe34ee0a..f1c9c207 100644
--- a/src/location/maps/qgeorouteparser_p_p.h
+++ b/src/location/maps/qgeorouteparser_p_p.h
@@ -68,7 +68,7 @@ public:
virtual QGeoRouteReply::Error parseReply(QList<QGeoRoute> &routes, QString &errorString, const QByteArray &reply) const = 0;
virtual QUrl requestUrl(const QGeoRouteRequest &request, const QString &prefix) const = 0;
- QGeoRouteParser::TrafficSide trafficSide;
+ QGeoRouteParser::TrafficSide trafficSide = QGeoRouteParser::RightHandTraffic;
};
QT_END_NAMESPACE
diff --git a/src/location/maps/qgeorouteparserosrmv4.cpp b/src/location/maps/qgeorouteparserosrmv4.cpp
index a24ae2db..2b1545cc 100644
--- a/src/location/maps/qgeorouteparserosrmv4.cpp
+++ b/src/location/maps/qgeorouteparserosrmv4.cpp
@@ -399,7 +399,8 @@ QUrl QGeoRouteParserOsrmV4Private::requestUrl(const QGeoRouteRequest &request, c
return url;
}
-QGeoRouteParserOsrmV4::QGeoRouteParserOsrmV4(QObject *parent) : QGeoRouteParser(*new QGeoRouteParserOsrmV4Private(), parent)
+QGeoRouteParserOsrmV4::QGeoRouteParserOsrmV4(QObject *parent)
+ : QGeoRouteParser(*new QGeoRouteParserOsrmV4Private(), parent)
{
}
diff --git a/src/location/maps/qgeoroutereply.cpp b/src/location/maps/qgeoroutereply.cpp
index 902ab2f2..c07f62ed 100644
--- a/src/location/maps/qgeoroutereply.cpp
+++ b/src/location/maps/qgeoroutereply.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtLocation module of the Qt Toolkit.
@@ -266,14 +266,14 @@ void QGeoRouteReply::abort()
*******************************************************************************/
QGeoRouteReplyPrivate::QGeoRouteReplyPrivate(const QGeoRouteRequest &request)
- : error(QGeoRouteReply::NoError),
- isFinished(false),
- request(request) {}
+ : request(request)
+{}
QGeoRouteReplyPrivate::QGeoRouteReplyPrivate(QGeoRouteReply::Error error, QString errorString)
: error(error),
errorString(errorString),
- isFinished(true) {}
+ isFinished(true)
+{}
QGeoRouteReplyPrivate::~QGeoRouteReplyPrivate() {}
diff --git a/src/location/maps/qgeoroutereply_p.h b/src/location/maps/qgeoroutereply_p.h
index aab2cac9..c82e2992 100644
--- a/src/location/maps/qgeoroutereply_p.h
+++ b/src/location/maps/qgeoroutereply_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2021 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtLocation module of the Qt Toolkit.
@@ -67,9 +67,9 @@ public:
QGeoRouteReplyPrivate(QGeoRouteReply::Error error, QString errorString);
~QGeoRouteReplyPrivate();
- QGeoRouteReply::Error error;
+ QGeoRouteReply::Error error = QGeoRouteReply::NoError;
QString errorString;
- bool isFinished;
+ bool isFinished = false;
QGeoRouteRequest request;
QList<QGeoRoute> routes;
diff --git a/src/location/maps/qgeotiledmappingmanagerengine.cpp b/src/location/maps/qgeotiledmappingmanagerengine.cpp
index 64e9045b..cf2bc70e 100644
--- a/src/location/maps/qgeotiledmappingmanagerengine.cpp
+++ b/src/location/maps/qgeotiledmappingmanagerengine.cpp
@@ -56,7 +56,6 @@ QT_BEGIN_NAMESPACE
QGeoTiledMappingManagerEngine::QGeoTiledMappingManagerEngine(QObject *parent)
: QGeoMappingManagerEngine(parent),
- m_prefetchStyle(QGeoTiledMap::PrefetchTwoNeighbourLayers),
d_ptr(new QGeoTiledMappingManagerEnginePrivate)
{
}
@@ -310,19 +309,4 @@ QSharedPointer<QGeoTileTexture> QGeoTiledMappingManagerEngine::getTileTexture(co
return d_ptr->tileCache_->get(spec);
}
-/*******************************************************************************
-*******************************************************************************/
-
-QGeoTiledMappingManagerEnginePrivate::QGeoTiledMappingManagerEnginePrivate()
-: m_tileVersion(-1),
- cacheHint_(QAbstractGeoTileCache::AllCaches),
- tileCache_(0),
- fetcher_(0)
-{
-}
-
-QGeoTiledMappingManagerEnginePrivate::~QGeoTiledMappingManagerEnginePrivate()
-{
-}
-
QT_END_NAMESPACE
diff --git a/src/location/maps/qgeotiledmappingmanagerengine_p.h b/src/location/maps/qgeotiledmappingmanagerengine_p.h
index 13c0b3cc..f46bf71a 100644
--- a/src/location/maps/qgeotiledmappingmanagerengine_p.h
+++ b/src/location/maps/qgeotiledmappingmanagerengine_p.h
@@ -106,7 +106,7 @@ protected:
void setCacheHint(QAbstractGeoTileCache::CacheAreas cacheHint);
void setTileCache(QAbstractGeoTileCache *cache);
- QGeoTiledMap::PrefetchStyle m_prefetchStyle;
+ QGeoTiledMap::PrefetchStyle m_prefetchStyle = QGeoTiledMap::PrefetchTwoNeighbourLayers;
QGeoTiledMappingManagerEnginePrivate *d_ptr;
Q_DECLARE_PRIVATE(QGeoTiledMappingManagerEngine)
diff --git a/src/location/maps/qgeotiledmappingmanagerengine_p_p.h b/src/location/maps/qgeotiledmappingmanagerengine_p_p.h
index 6b4f0741..aa8fc3b4 100644
--- a/src/location/maps/qgeotiledmappingmanagerengine_p_p.h
+++ b/src/location/maps/qgeotiledmappingmanagerengine_p_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtLocation module of the Qt Toolkit.
@@ -67,16 +67,15 @@ class QGeoTileFetcher;
class QGeoTiledMappingManagerEnginePrivate
{
public:
- QGeoTiledMappingManagerEnginePrivate();
- ~QGeoTiledMappingManagerEnginePrivate();
+ QGeoTiledMappingManagerEnginePrivate() = default;
QSize tileSize_;
- int m_tileVersion;
- QHash<QGeoTiledMap *, QSet<QGeoTileSpec> > mapHash_;
- QHash<QGeoTileSpec, QSet<QGeoTiledMap *> > tileHash_;
- QAbstractGeoTileCache::CacheAreas cacheHint_;
- QAbstractGeoTileCache *tileCache_;
- QGeoTileFetcher *fetcher_;
+ int m_tileVersion = -1;
+ QHash<QGeoTiledMap *, QSet<QGeoTileSpec>> mapHash_;
+ QHash<QGeoTileSpec, QSet<QGeoTiledMap *>> tileHash_;
+ QAbstractGeoTileCache::CacheAreas cacheHint_ = QAbstractGeoTileCache::AllCaches;
+ QAbstractGeoTileCache *tileCache_ = nullptr;
+ QGeoTileFetcher *fetcher_ = nullptr;
private:
Q_DISABLE_COPY(QGeoTiledMappingManagerEnginePrivate)
diff --git a/src/location/maps/qgeotiledmapreply.cpp b/src/location/maps/qgeotiledmapreply.cpp
index 7afceb7a..f37cebc6 100644
--- a/src/location/maps/qgeotiledmapreply.cpp
+++ b/src/location/maps/qgeotiledmapreply.cpp
@@ -282,17 +282,13 @@ void QGeoTiledMapReply::abort()
*******************************************************************************/
QGeoTiledMapReplyPrivate::QGeoTiledMapReplyPrivate(const QGeoTileSpec &spec)
- : error(QGeoTiledMapReply::NoError),
- isFinished(false),
- isCached(false),
- spec(spec) {}
+ : spec(spec)
+{}
QGeoTiledMapReplyPrivate::QGeoTiledMapReplyPrivate(QGeoTiledMapReply::Error error, const QString &errorString)
: error(error),
errorString(errorString),
- isFinished(true),
- isCached(false) {}
-
-QGeoTiledMapReplyPrivate::~QGeoTiledMapReplyPrivate() {}
+ isFinished(true)
+{}
QT_END_NAMESPACE
diff --git a/src/location/maps/qgeotiledmapreply_p_p.h b/src/location/maps/qgeotiledmapreply_p_p.h
index cde88bd4..124a7385 100644
--- a/src/location/maps/qgeotiledmapreply_p_p.h
+++ b/src/location/maps/qgeotiledmapreply_p_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtLocation module of the Qt Toolkit.
@@ -61,12 +61,11 @@ class QGeoTiledMapReplyPrivate
public:
QGeoTiledMapReplyPrivate(const QGeoTileSpec &spec);
QGeoTiledMapReplyPrivate(QGeoTiledMapReply::Error error, const QString &errorString);
- ~QGeoTiledMapReplyPrivate();
- QGeoTiledMapReply::Error error;
+ QGeoTiledMapReply::Error error = QGeoTiledMapReply::NoError;
QString errorString;
- bool isFinished;
- bool isCached;
+ bool isFinished = false;
+ bool isCached = false;
QGeoTileSpec spec;
QByteArray mapImageData;
diff --git a/src/location/maps/qgeotilespec.cpp b/src/location/maps/qgeotilespec.cpp
index db1fbadf..55e36b64 100644
--- a/src/location/maps/qgeotilespec.cpp
+++ b/src/location/maps/qgeotilespec.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtLocation module of the Qt Toolkit.
@@ -47,10 +47,14 @@ QT_BEGIN_NAMESPACE
QT_DEFINE_QSDP_SPECIALIZATION_DTOR(QGeoTileSpecPrivate)
QGeoTileSpec::QGeoTileSpec()
- : d(QSharedDataPointer<QGeoTileSpecPrivate>(new QGeoTileSpecPrivate())) {}
+ : d(new QGeoTileSpecPrivate())
+{
+}
QGeoTileSpec::QGeoTileSpec(const QString &plugin, int mapId, int zoom, int x, int y, int version)
- : d(QSharedDataPointer<QGeoTileSpecPrivate>(new QGeoTileSpecPrivate(plugin, mapId, zoom, x, y, version))) {}
+ : d(new QGeoTileSpecPrivate(plugin, mapId, zoom, x, y, version))
+{
+}
QGeoTileSpec::QGeoTileSpec(const QGeoTileSpec &other) noexcept = default;
diff --git a/src/location/places/qplace.cpp b/src/location/places/qplace.cpp
index 1991639d..f73ca971 100644
--- a/src/location/places/qplace.cpp
+++ b/src/location/places/qplace.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtLocation module of the Qt Toolkit.
@@ -129,7 +129,7 @@ QT_DEFINE_QSDP_SPECIALIZATION_DTOR(QPlacePrivate)
Constructs an empty place object.
*/
QPlace::QPlace()
- : d_ptr(new QPlacePrivateDefault())
+ : d_ptr(new QPlacePrivateDefault())
{
}
diff --git a/src/location/places/qplaceattribute_p.h b/src/location/places/qplaceattribute_p.h
index 54b203ac..b1d576c0 100644
--- a/src/location/places/qplaceattribute_p.h
+++ b/src/location/places/qplaceattribute_p.h
@@ -64,8 +64,6 @@ public:
QPlaceAttributePrivate(){}
QPlaceAttributePrivate(const QPlaceAttributePrivate &other);
virtual ~QPlaceAttributePrivate(){}
-
-
virtual bool operator== (const QPlaceAttributePrivate &other) const;
virtual QPlaceAttributePrivate *clone() const { return new QPlaceAttributePrivate(*this); }
diff --git a/src/location/places/qplacecontent.cpp b/src/location/places/qplacecontent.cpp
index 30b9d3e7..3999e0d7 100644
--- a/src/location/places/qplacecontent.cpp
+++ b/src/location/places/qplacecontent.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtLocation module of the Qt Toolkit.
@@ -133,7 +133,7 @@ bool QPlaceContentPrivate::compare(const QPlaceContentPrivate *other) const
Constructs an default content object which has no type.
*/
QPlaceContent::QPlaceContent()
- :d_ptr(0)
+ : d_ptr(nullptr)
{
}
@@ -141,7 +141,7 @@ QPlaceContent::QPlaceContent()
Constructs a new copy of \a other.
*/
QPlaceContent::QPlaceContent(const QPlaceContent &other)
- :d_ptr(other.d_ptr)
+ : d_ptr(other.d_ptr)
{
}
@@ -265,6 +265,6 @@ void QPlaceContent::setAttribution(const QString &attribution)
Constructs a new content object from the given pointer \a d.
*/
QPlaceContent::QPlaceContent(QPlaceContentPrivate *d)
- :d_ptr(d)
+ : d_ptr(d)
{
}
diff --git a/src/location/places/qplacecontentreply.cpp b/src/location/places/qplacecontentreply.cpp
index 6c774fed..d327ba27 100644
--- a/src/location/places/qplacecontentreply.cpp
+++ b/src/location/places/qplacecontentreply.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtLocation module of the Qt Toolkit.
@@ -46,12 +46,8 @@ QT_BEGIN_NAMESPACE
class QPlaceContentReplyPrivate : public QPlaceReplyPrivate
{
public:
- QPlaceContentReplyPrivate()
- : totalCount(0)
- { }
-
QPlaceContent::Collection contentCollection;
- int totalCount;
+ int totalCount = 0;
QPlaceContentRequest contentRequest;
QPlaceContentRequest previousPageRequest;
QPlaceContentRequest nextPageRequest;
diff --git a/src/location/places/qplacecontentrequest.cpp b/src/location/places/qplacecontentrequest.cpp
index d0ce72a5..7479f06c 100644
--- a/src/location/places/qplacecontentrequest.cpp
+++ b/src/location/places/qplacecontentrequest.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtLocation module of the Qt Toolkit.
@@ -45,21 +45,6 @@ QT_BEGIN_NAMESPACE
QT_DEFINE_QSDP_SPECIALIZATION_DTOR(QPlaceContentRequestPrivate)
-QPlaceContentRequestPrivate::QPlaceContentRequestPrivate()
-: QSharedData(), contentType(QPlaceContent::NoType), limit(-1)
-{
-}
-
-QPlaceContentRequestPrivate::QPlaceContentRequestPrivate(const QPlaceContentRequestPrivate &other)
-: QSharedData(other), contentType(other.contentType), placeId(other.placeId),
- contentContext(other.contentContext), limit(other.limit)
-{
-}
-
-QPlaceContentRequestPrivate::~QPlaceContentRequestPrivate()
-{
-}
-
bool QPlaceContentRequestPrivate::operator==(const QPlaceContentRequestPrivate &other) const
{
return contentType == other.contentType
diff --git a/src/location/places/qplacecontentrequest_p.h b/src/location/places/qplacecontentrequest_p.h
index 6ea4c664..3fec2685 100644
--- a/src/location/places/qplacecontentrequest_p.h
+++ b/src/location/places/qplacecontentrequest_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2021 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtLocation module of the Qt Toolkit.
@@ -61,19 +61,14 @@ QT_BEGIN_NAMESPACE
class QPlaceContentRequestPrivate : public QSharedData
{
public:
- QPlaceContentRequestPrivate();
- QPlaceContentRequestPrivate(const QPlaceContentRequestPrivate &other);
- ~QPlaceContentRequestPrivate();
-
- QPlaceContentRequestPrivate &operator=(const QPlaceContentRequestPrivate &other);
bool operator==(const QPlaceContentRequestPrivate &other) const;
void clear();
- QPlaceContent::Type contentType;
+ QPlaceContent::Type contentType = QPlaceContent::NoType;
QString placeId;
QVariant contentContext;
- int limit;
+ int limit = -1;
};
QT_END_NAMESPACE
diff --git a/src/location/places/qplacedetailsreply.cpp b/src/location/places/qplacedetailsreply.cpp
index 746001a1..5b76e82d 100644
--- a/src/location/places/qplacedetailsreply.cpp
+++ b/src/location/places/qplacedetailsreply.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtLocation module of the Qt Toolkit.
@@ -46,8 +46,6 @@ QT_BEGIN_NAMESPACE
class QPlaceDetailsReplyPrivate : public QPlaceReplyPrivate
{
public:
- QPlaceDetailsReplyPrivate() {}
- ~QPlaceDetailsReplyPrivate() {}
QPlace result;
};
diff --git a/src/location/places/qplaceeditorial.cpp b/src/location/places/qplaceeditorial.cpp
index 2961da27..bcf27353 100644
--- a/src/location/places/qplaceeditorial.cpp
+++ b/src/location/places/qplaceeditorial.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtLocation module of the Qt Toolkit.
@@ -42,21 +42,6 @@
QT_USE_NAMESPACE
-QPlaceEditorialPrivate::QPlaceEditorialPrivate()
-: QPlaceContentPrivate()
-{
-}
-
-QPlaceEditorialPrivate::QPlaceEditorialPrivate(const QPlaceEditorialPrivate &other)
-: QPlaceContentPrivate(other), text(other.text), contentTitle(other.contentTitle),
- language(other.language)
-{
-}
-
-QPlaceEditorialPrivate::~QPlaceEditorialPrivate()
-{
-}
-
bool QPlaceEditorialPrivate::compare(const QPlaceContentPrivate *other) const
{
const QPlaceEditorialPrivate *od = static_cast<const QPlaceEditorialPrivate *>(other);
diff --git a/src/location/places/qplaceeditorial_p.h b/src/location/places/qplaceeditorial_p.h
index e8c5fe71..afcab4d9 100644
--- a/src/location/places/qplaceeditorial_p.h
+++ b/src/location/places/qplaceeditorial_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtLocation module of the Qt Toolkit.
@@ -61,11 +61,6 @@ QT_BEGIN_NAMESPACE
class QPlaceEditorialPrivate : public QPlaceContentPrivate
{
public:
- QPlaceEditorialPrivate();
- QPlaceEditorialPrivate(const QPlaceEditorialPrivate &other);
-
- ~QPlaceEditorialPrivate();
-
bool compare(const QPlaceContentPrivate *other) const override;
Q_DEFINE_CONTENT_PRIVATE_HELPER(QPlaceEditorial, QPlaceContent::EditorialType)
diff --git a/src/location/places/qplaceicon.cpp b/src/location/places/qplaceicon.cpp
index e58b6d7c..50bbef6c 100644
--- a/src/location/places/qplaceicon.cpp
+++ b/src/location/places/qplaceicon.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtLocation module of the Qt Toolkit.
@@ -48,33 +48,6 @@ QT_USE_NAMESPACE
QT_DEFINE_QSDP_SPECIALIZATION_DTOR(QPlaceIconPrivate)
-QPlaceIconPrivate::QPlaceIconPrivate()
- : QSharedData(), manager(0)
-{
-}
-
-QPlaceIconPrivate::QPlaceIconPrivate(const QPlaceIconPrivate &other)
- : QSharedData(other),
- manager(other.manager),
- parameters(other.parameters)
-{
-}
-
-QPlaceIconPrivate::~QPlaceIconPrivate()
-{
-}
-
-QPlaceIconPrivate &QPlaceIconPrivate::operator=(const QPlaceIconPrivate &other)
-{
- if (this == &other)
- return *this;
-
- manager = other.manager;
- parameters = other.parameters;
-
- return *this;
-}
-
bool QPlaceIconPrivate::operator == (const QPlaceIconPrivate &other) const
{
return manager == other.manager
diff --git a/src/location/places/qplaceicon_p.h b/src/location/places/qplaceicon_p.h
index 5292b1bd..889a1369 100644
--- a/src/location/places/qplaceicon_p.h
+++ b/src/location/places/qplaceicon_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2021 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtLocation module of the Qt Toolkit.
@@ -62,14 +62,9 @@ class QPlaceManager;
class QPlaceIconPrivate: public QSharedData
{
public:
- QPlaceIconPrivate();
- QPlaceIconPrivate(const QPlaceIconPrivate &other);
- ~QPlaceIconPrivate();
-
- QPlaceIconPrivate &operator=(const QPlaceIconPrivate &other);
bool operator == (const QPlaceIconPrivate &other) const;
- QPlaceManager *manager;
+ QPlaceManager *manager = nullptr;
QVariantMap parameters;
};
diff --git a/src/location/places/qplaceimage.cpp b/src/location/places/qplaceimage.cpp
index bfdf18b7..fc87bfef 100644
--- a/src/location/places/qplaceimage.cpp
+++ b/src/location/places/qplaceimage.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtLocation module of the Qt Toolkit.
@@ -42,22 +42,6 @@
QT_USE_NAMESPACE
-QPlaceImagePrivate::QPlaceImagePrivate() : QPlaceContentPrivate()
-{
-}
-
-QPlaceImagePrivate::QPlaceImagePrivate(const QPlaceImagePrivate &other)
- : QPlaceContentPrivate(other)
-{
- url = other.url;
- id = other.id;
- mimeType = other.mimeType;
-}
-
-QPlaceImagePrivate::~QPlaceImagePrivate()
-{
-}
-
bool QPlaceImagePrivate::compare(const QPlaceContentPrivate *other) const
{
const QPlaceImagePrivate *od = static_cast<const QPlaceImagePrivate *>(other);
diff --git a/src/location/places/qplaceimage_p.h b/src/location/places/qplaceimage_p.h
index d81afd96..c790ee76 100644
--- a/src/location/places/qplaceimage_p.h
+++ b/src/location/places/qplaceimage_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtLocation module of the Qt Toolkit.
@@ -62,11 +62,6 @@ QT_BEGIN_NAMESPACE
class QPlaceImagePrivate : public QPlaceContentPrivate
{
public:
- QPlaceImagePrivate();
- QPlaceImagePrivate(const QPlaceImagePrivate &other);
-
- ~QPlaceImagePrivate();
-
bool compare(const QPlaceContentPrivate *other) const override;
Q_DEFINE_CONTENT_PRIVATE_HELPER(QPlaceImage, QPlaceContent::ImageType)
diff --git a/src/location/places/qplacemanagerengine.cpp b/src/location/places/qplacemanagerengine.cpp
index 302e029b..cab5603d 100644
--- a/src/location/places/qplacemanagerengine.cpp
+++ b/src/location/places/qplacemanagerengine.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtLocation module of the Qt Toolkit.
@@ -356,15 +356,6 @@ QUrl QPlaceManagerEngine::constructIconUrl(const QPlaceIcon &icon, const QSize &
return QUrl();
}
-QPlaceManagerEnginePrivate::QPlaceManagerEnginePrivate()
- : managerVersion(-1), manager(0)
-{
-}
-
-QPlaceManagerEnginePrivate::~QPlaceManagerEnginePrivate()
-{
-}
-
/*!
\fn void QPlaceManagerEngine::finished(QPlaceReply *reply)
diff --git a/src/location/places/qplacemanagerengine_p.h b/src/location/places/qplacemanagerengine_p.h
index b93cbd53..7cd58e5c 100644
--- a/src/location/places/qplacemanagerengine_p.h
+++ b/src/location/places/qplacemanagerengine_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2021 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtLocation module of the Qt Toolkit.
@@ -60,12 +60,11 @@ QT_BEGIN_NAMESPACE
class QPlaceManagerEnginePrivate
{
public:
- QPlaceManagerEnginePrivate();
- ~QPlaceManagerEnginePrivate();
+ QPlaceManagerEnginePrivate() = default;
QString managerName;
- int managerVersion;
- QPlaceManager *manager;
+ int managerVersion = -1;
+ QPlaceManager *manager = nullptr;
private:
Q_DISABLE_COPY(QPlaceManagerEnginePrivate)
diff --git a/src/location/places/qplacematchreply.cpp b/src/location/places/qplacematchreply.cpp
index 73059053..239db759 100644
--- a/src/location/places/qplacematchreply.cpp
+++ b/src/location/places/qplacematchreply.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtLocation module of the Qt Toolkit.
@@ -47,7 +47,6 @@ QT_BEGIN_NAMESPACE
class QPlaceMatchReplyPrivate : public QPlaceReplyPrivate
{
public:
- QPlaceMatchReplyPrivate(){}
QList<QPlace> places;
QPlaceMatchRequest request;
};
diff --git a/src/location/places/qplacematchrequest.cpp b/src/location/places/qplacematchrequest.cpp
index 1356b1d7..85beaebe 100644
--- a/src/location/places/qplacematchrequest.cpp
+++ b/src/location/places/qplacematchrequest.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtLocation module of the Qt Toolkit.
@@ -49,11 +49,6 @@ QT_BEGIN_NAMESPACE
class QPlaceMatchRequestPrivate : public QSharedData
{
public:
- QPlaceMatchRequestPrivate();
- QPlaceMatchRequestPrivate(const QPlaceMatchRequestPrivate &other);
- ~QPlaceMatchRequestPrivate();
-
- QPlaceMatchRequestPrivate &operator=(const QPlaceMatchRequestPrivate &other);
bool operator==(const QPlaceMatchRequestPrivate &other) const;
void clear();
@@ -64,32 +59,6 @@ public:
QT_DEFINE_QSDP_SPECIALIZATION_DTOR(QPlaceMatchRequestPrivate)
-QPlaceMatchRequestPrivate::QPlaceMatchRequestPrivate()
- : QSharedData()
-{
-}
-
-QPlaceMatchRequestPrivate::QPlaceMatchRequestPrivate(const QPlaceMatchRequestPrivate &other)
- : QSharedData(other),
- places(other.places),
- parameters(other.parameters)
-{
-}
-
-QPlaceMatchRequestPrivate::~QPlaceMatchRequestPrivate()
-{
-}
-
-QPlaceMatchRequestPrivate &QPlaceMatchRequestPrivate::operator=(const QPlaceMatchRequestPrivate &other)
-{
- if (this != &other) {
- places = other.places;
- parameters = other.parameters;
- }
-
- return *this;
-}
-
bool QPlaceMatchRequestPrivate::operator==(const QPlaceMatchRequestPrivate &other) const
{
return (places == other.places
diff --git a/src/location/places/qplaceproposedsearchresult.cpp b/src/location/places/qplaceproposedsearchresult.cpp
index 671a2714..f64fce49 100644
--- a/src/location/places/qplaceproposedsearchresult.cpp
+++ b/src/location/places/qplaceproposedsearchresult.cpp
@@ -1,6 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2013 Aaron McCarthy <mccarthy.aaron@gmail.com>
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtLocation module of the Qt Toolkit.
@@ -42,19 +43,6 @@
QT_BEGIN_NAMESPACE
-QPlaceProposedSearchResultPrivate::QPlaceProposedSearchResultPrivate()
-{
-}
-
-QPlaceProposedSearchResultPrivate::QPlaceProposedSearchResultPrivate(const QPlaceProposedSearchResultPrivate &other)
-: QPlaceSearchResultPrivate(other), searchRequest(other.searchRequest)
-{
-}
-
-QPlaceProposedSearchResultPrivate::~QPlaceProposedSearchResultPrivate()
-{
-}
-
bool QPlaceProposedSearchResultPrivate::compare(const QPlaceSearchResultPrivate *other) const
{
const QPlaceProposedSearchResultPrivate *od = static_cast<const QPlaceProposedSearchResultPrivate *>(other);
diff --git a/src/location/places/qplaceproposedsearchresult_p.h b/src/location/places/qplaceproposedsearchresult_p.h
index abecaa61..30df6c9d 100644
--- a/src/location/places/qplaceproposedsearchresult_p.h
+++ b/src/location/places/qplaceproposedsearchresult_p.h
@@ -1,6 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2013 Aaron McCarthy <mccarthy.aaron@gmail.com>
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtLocation module of the Qt Toolkit.
@@ -58,11 +59,6 @@ QT_BEGIN_NAMESPACE
class QPlaceProposedSearchResultPrivate : public QPlaceSearchResultPrivate
{
public:
- QPlaceProposedSearchResultPrivate();
- QPlaceProposedSearchResultPrivate(const QPlaceProposedSearchResultPrivate &other);
-
- ~QPlaceProposedSearchResultPrivate();
-
bool compare(const QPlaceSearchResultPrivate *other) const override;
Q_DEFINE_SEARCHRESULT_PRIVATE_HELPER(QPlaceProposedSearchResult, QPlaceSearchResult::ProposedSearchResult)
diff --git a/src/location/places/qplaceratings.cpp b/src/location/places/qplaceratings.cpp
index b47b19c1..ba4389ef 100644
--- a/src/location/places/qplaceratings.cpp
+++ b/src/location/places/qplaceratings.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtLocation module of the Qt Toolkit.
@@ -44,20 +44,6 @@ QT_USE_NAMESPACE
QT_DEFINE_QSDP_SPECIALIZATION_DTOR(QPlaceRatingsPrivate)
-QPlaceRatingsPrivate::QPlaceRatingsPrivate()
- : QSharedData(), average(0), maximum(0), count(0)
-{
-}
-
-QPlaceRatingsPrivate::QPlaceRatingsPrivate(const QPlaceRatingsPrivate &other)
-: QSharedData(), average(0), maximum(other.maximum), count(other.count)
-{
-}
-
-QPlaceRatingsPrivate::~QPlaceRatingsPrivate()
-{
-}
-
bool QPlaceRatingsPrivate::operator==(const QPlaceRatingsPrivate &other) const
{
return average == other.average && maximum == other.maximum && count == other.count;
diff --git a/src/location/places/qplaceratings_p.h b/src/location/places/qplaceratings_p.h
index 84c527fa..0b8c5d91 100644
--- a/src/location/places/qplaceratings_p.h
+++ b/src/location/places/qplaceratings_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2021 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtLocation module of the Qt Toolkit.
@@ -59,18 +59,13 @@ QT_BEGIN_NAMESPACE
class QPlaceRatingsPrivate : public QSharedData
{
public:
- QPlaceRatingsPrivate();
- QPlaceRatingsPrivate(const QPlaceRatingsPrivate &other);
-
- ~QPlaceRatingsPrivate();
-
bool operator==(const QPlaceRatingsPrivate &other) const;
bool isEmpty() const;
- qreal average;
- qreal maximum;
- int count;
+ qreal average = 0;
+ qreal maximum = 0;
+ int count = 0;
};
QT_END_NAMESPACE
diff --git a/src/location/places/qplacereply_p.h b/src/location/places/qplacereply_p.h
index 8fe57832..c044b595 100644
--- a/src/location/places/qplacereply_p.h
+++ b/src/location/places/qplacereply_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2021 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtLocation module of the Qt Toolkit.
@@ -58,13 +58,9 @@ QT_BEGIN_NAMESPACE
class QPlaceReplyPrivate
{
public:
- QPlaceReplyPrivate() :
- isFinished(false),
- error(QPlaceReply::NoError),
- errorString(QString()){}
virtual ~QPlaceReplyPrivate(){}
- bool isFinished;
- QPlaceReply::Error error;
+ bool isFinished = false;
+ QPlaceReply::Error error = QPlaceReply::NoError;
QString errorString;
};
diff --git a/src/location/places/qplaceresult.cpp b/src/location/places/qplaceresult.cpp
index 541b6e5d..a50bcb84 100644
--- a/src/location/places/qplaceresult.cpp
+++ b/src/location/places/qplaceresult.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtLocation module of the Qt Toolkit.
@@ -43,21 +43,6 @@
QT_USE_NAMESPACE
-QPlaceResultPrivate::QPlaceResultPrivate()
- : QPlaceSearchResultPrivate(), distance(qQNaN()), sponsored(false)
-{
-}
-
-QPlaceResultPrivate::QPlaceResultPrivate(const QPlaceResultPrivate &other)
-: QPlaceSearchResultPrivate(other), distance(other.distance), place(other.place),
- sponsored(other.sponsored)
-{
-}
-
-QPlaceResultPrivate::~QPlaceResultPrivate()
-{
-}
-
bool QPlaceResultPrivate::compare(const QPlaceSearchResultPrivate *other) const
{
const QPlaceResultPrivate *od = static_cast<const QPlaceResultPrivate *>(other);
diff --git a/src/location/places/qplaceresult_p.h b/src/location/places/qplaceresult_p.h
index ac3a527d..03b24548 100644
--- a/src/location/places/qplaceresult_p.h
+++ b/src/location/places/qplaceresult_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtLocation module of the Qt Toolkit.
@@ -59,18 +59,13 @@ QT_BEGIN_NAMESPACE
class QPlaceResultPrivate : public QPlaceSearchResultPrivate
{
public:
- QPlaceResultPrivate();
- QPlaceResultPrivate(const QPlaceResultPrivate &other);
-
- ~QPlaceResultPrivate();
-
bool compare(const QPlaceSearchResultPrivate *other) const override;
Q_DEFINE_SEARCHRESULT_PRIVATE_HELPER(QPlaceResult, QPlaceSearchResult::PlaceResult)
- qreal distance;
+ qreal distance = Q_QNAN;
QPlace place;
- bool sponsored;
+ bool sponsored = false;
};
QT_END_NAMESPACE
diff --git a/src/location/places/qplacereview.cpp b/src/location/places/qplacereview.cpp
index 94a0e1b6..83dc298c 100644
--- a/src/location/places/qplacereview.cpp
+++ b/src/location/places/qplacereview.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtLocation module of the Qt Toolkit.
@@ -42,26 +42,6 @@
QT_BEGIN_NAMESPACE
-QPlaceReviewPrivate::QPlaceReviewPrivate()
-: QPlaceContentPrivate(), rating(0)
-{
-}
-
-QPlaceReviewPrivate::QPlaceReviewPrivate(const QPlaceReviewPrivate &other)
- : QPlaceContentPrivate(other)
-{
- dateTime = other.dateTime;
- text = other.text;
- language = other.language;
- rating = other.rating;
- reviewId = other.reviewId;
- title = other.title;
-}
-
-QPlaceReviewPrivate::~QPlaceReviewPrivate()
-{
-}
-
bool QPlaceReviewPrivate::compare(const QPlaceContentPrivate *other) const
{
const QPlaceReviewPrivate *od = static_cast<const QPlaceReviewPrivate *>(other);
diff --git a/src/location/places/qplacereview_p.h b/src/location/places/qplacereview_p.h
index b6b29e5f..8fc4a9ba 100644
--- a/src/location/places/qplacereview_p.h
+++ b/src/location/places/qplacereview_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtLocation module of the Qt Toolkit.
@@ -61,11 +61,6 @@ QT_BEGIN_NAMESPACE
class QPlaceReviewPrivate : public QPlaceContentPrivate
{
public:
- QPlaceReviewPrivate();
- QPlaceReviewPrivate(const QPlaceReviewPrivate &other);
-
- ~QPlaceReviewPrivate();
-
bool compare(const QPlaceContentPrivate *other) const override;
Q_DEFINE_CONTENT_PRIVATE_HELPER(QPlaceReview, QPlaceContent::ReviewType);
@@ -73,7 +68,7 @@ public:
QDateTime dateTime;
QString text;
QString language;
- qreal rating;
+ qreal rating = 0;
QString reviewId;
QString title;
};
diff --git a/src/location/places/qplacesearchreply.cpp b/src/location/places/qplacesearchreply.cpp
index fd9cdf30..d3b34ab7 100644
--- a/src/location/places/qplacesearchreply.cpp
+++ b/src/location/places/qplacesearchreply.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtLocation module of the Qt Toolkit.
@@ -47,7 +47,6 @@ QT_BEGIN_NAMESPACE
class QPlaceSearchReplyPrivate : public QPlaceReplyPrivate
{
public:
- QPlaceSearchReplyPrivate(){}
QList<QPlaceSearchResult> results;
QPlaceSearchRequest searchRequest;
QPlaceSearchRequest previousPageRequest;
diff --git a/src/location/places/qplacesearchrequest.cpp b/src/location/places/qplacesearchrequest.cpp
index 06d7268e..382f0fb5 100644
--- a/src/location/places/qplacesearchrequest.cpp
+++ b/src/location/places/qplacesearchrequest.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtLocation module of the Qt Toolkit.
@@ -53,51 +53,6 @@ QT_BEGIN_NAMESPACE
QT_DEFINE_QSDP_SPECIALIZATION_DTOR(QPlaceSearchRequestPrivate)
-QPlaceSearchRequestPrivate::QPlaceSearchRequestPrivate()
-: QSharedData(),
- visibilityScope(QLocation::UnspecifiedVisibility),
- relevanceHint(QPlaceSearchRequest::UnspecifiedHint),
- limit(-1)
-{
-}
-
-QPlaceSearchRequestPrivate::QPlaceSearchRequestPrivate(const QPlaceSearchRequestPrivate &other)
- : QSharedData(other),
- searchTerm(other.searchTerm),
- categories(other.categories),
- searchArea(other.searchArea),
- recommendationId(other.recommendationId),
- visibilityScope(other.visibilityScope),
- relevanceHint(other.relevanceHint),
- limit(other.limit),
- searchContext(other.searchContext),
- related(other.related),
- page(other.page)
-{
-}
-
-QPlaceSearchRequestPrivate::~QPlaceSearchRequestPrivate()
-{
-}
-
-QPlaceSearchRequestPrivate &QPlaceSearchRequestPrivate::operator=(const QPlaceSearchRequestPrivate &other)
-{
- if (this != &other) {
- searchTerm = other.searchTerm;
- categories = other.categories;
- searchArea = other.searchArea;
- recommendationId = other.recommendationId;
- visibilityScope = other.visibilityScope;
- relevanceHint = other.relevanceHint;
- limit = other.limit;
- searchContext = other.searchContext;
- related = other.related;
- page = other.page;
- }
-
- return *this;
-}
-
bool QPlaceSearchRequestPrivate::operator==(const QPlaceSearchRequestPrivate &other) const
{
return searchTerm == other.searchTerm &&
diff --git a/src/location/places/qplacesearchrequest_p.h b/src/location/places/qplacesearchrequest_p.h
index 2d158ba0..f48519ca 100644
--- a/src/location/places/qplacesearchrequest_p.h
+++ b/src/location/places/qplacesearchrequest_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2018 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtLocation module of the Qt Toolkit.
@@ -66,11 +66,6 @@ QT_BEGIN_NAMESPACE
class Q_LOCATION_PRIVATE_EXPORT QPlaceSearchRequestPrivate : public QSharedData
{
public:
- QPlaceSearchRequestPrivate();
- QPlaceSearchRequestPrivate(const QPlaceSearchRequestPrivate &other);
- ~QPlaceSearchRequestPrivate();
-
- QPlaceSearchRequestPrivate &operator=(const QPlaceSearchRequestPrivate &other);
bool operator==(const QPlaceSearchRequestPrivate &other) const;
void clear();
@@ -81,10 +76,10 @@ public:
QList<QPlaceCategory> categories;
QGeoShape searchArea;
QString recommendationId;
- QLocation::VisibilityScope visibilityScope;
- QPlaceSearchRequest::RelevanceHint relevanceHint;
+ QLocation::VisibilityScope visibilityScope = QLocation::UnspecifiedVisibility;
+ QPlaceSearchRequest::RelevanceHint relevanceHint = QPlaceSearchRequest::UnspecifiedHint;
QGeoRoute routeSearchArea;
- int limit;
+ int limit = -1;
QVariant searchContext;
bool related = false;
int page = 0;
diff --git a/src/location/places/qplacesearchsuggestionreply.cpp b/src/location/places/qplacesearchsuggestionreply.cpp
index 6c12f68c..e0176526 100644
--- a/src/location/places/qplacesearchsuggestionreply.cpp
+++ b/src/location/places/qplacesearchsuggestionreply.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtLocation module of the Qt Toolkit.
@@ -45,7 +45,6 @@ QT_BEGIN_NAMESPACE
class QPlaceSearchSuggestionReplyPrivate : public QPlaceReplyPrivate
{
public:
- QPlaceSearchSuggestionReplyPrivate(){}
QStringList suggestions;
};
diff --git a/src/location/places/qplacesupplier.cpp b/src/location/places/qplacesupplier.cpp
index 35d976eb..7b730f94 100644
--- a/src/location/places/qplacesupplier.cpp
+++ b/src/location/places/qplacesupplier.cpp
@@ -44,23 +44,6 @@ QT_USE_NAMESPACE
QT_DEFINE_QSDP_SPECIALIZATION_DTOR(QPlaceSupplierPrivate)
-QPlaceSupplierPrivate::QPlaceSupplierPrivate() : QSharedData()
-{
-}
-
-QPlaceSupplierPrivate::QPlaceSupplierPrivate(const QPlaceSupplierPrivate &other)
- : QSharedData()
-{
- this->name = other.name;
- this->supplierId = other.supplierId;
- this->url = other.url;
- this->icon = other.icon;
-}
-
-QPlaceSupplierPrivate::~QPlaceSupplierPrivate()
-{
-}
-
bool QPlaceSupplierPrivate::operator==(const QPlaceSupplierPrivate &other) const
{
return (
diff --git a/src/location/places/qplacesupplier_p.h b/src/location/places/qplacesupplier_p.h
index b1172239..41a26bda 100644
--- a/src/location/places/qplacesupplier_p.h
+++ b/src/location/places/qplacesupplier_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2021 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtLocation module of the Qt Toolkit.
@@ -62,11 +62,6 @@ QT_BEGIN_NAMESPACE
class QPlaceSupplierPrivate : public QSharedData
{
public:
- QPlaceSupplierPrivate();
- QPlaceSupplierPrivate(const QPlaceSupplierPrivate &other);
-
- ~QPlaceSupplierPrivate();
-
bool operator==(const QPlaceSupplierPrivate &other) const;
bool isEmpty() const;
diff --git a/src/location/places/qplaceuser.cpp b/src/location/places/qplaceuser.cpp
index de2e82a6..48241e7a 100644
--- a/src/location/places/qplaceuser.cpp
+++ b/src/location/places/qplaceuser.cpp
@@ -44,20 +44,6 @@ QT_USE_NAMESPACE
QT_DEFINE_QSDP_SPECIALIZATION_DTOR(QPlaceUserPrivate)
-QPlaceUserPrivate::QPlaceUserPrivate()
- : QSharedData()
-{
-}
-
-QPlaceUserPrivate::QPlaceUserPrivate(const QPlaceUserPrivate &other)
- : QSharedData(), userId(other.userId), name(other.name)
-{
-}
-
-QPlaceUserPrivate::~QPlaceUserPrivate()
-{
-}
-
bool QPlaceUserPrivate::operator==(const QPlaceUserPrivate &other) const
{
return userId == other.userId && name == other.name;
diff --git a/src/location/places/qplaceuser_p.h b/src/location/places/qplaceuser_p.h
index 2110ec28..b90dc0e2 100644
--- a/src/location/places/qplaceuser_p.h
+++ b/src/location/places/qplaceuser_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2021 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtLocation module of the Qt Toolkit.
@@ -60,11 +60,6 @@ QT_BEGIN_NAMESPACE
class QPlaceUserPrivate : public QSharedData
{
public:
- QPlaceUserPrivate();
- QPlaceUserPrivate(const QPlaceUserPrivate &other);
-
- ~QPlaceUserPrivate();
-
bool operator==(const QPlaceUserPrivate &other) const;
QString userId;