summaryrefslogtreecommitdiffstats
path: root/src/location/maps/qgeoroutesegment_p.h
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2022-09-14 15:26:46 +0200
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2022-09-19 14:52:08 +0200
commit69e0dea5de987d5b6e684b721b322b0495921981 (patch)
tree1c0adc35735dac93942c5bb7dec21b4382a6e794 /src/location/maps/qgeoroutesegment_p.h
parent88018b488a26bf3657960aed75c633bc13eb7aab (diff)
Cleanup: de-virtualize QGeoRouteSegmentPrivate
The possibility to override this type in plugins is not used anywhere, and overcomplicates the code. There isn't even a way to create a QGeoRouteSegment with a reimplementation of the private. So remove this; if this is really needed for anything, then we can bring it back later. Change-Id: I34ad55d0ddf29cafc53e90e2a987c3faf904b437 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'src/location/maps/qgeoroutesegment_p.h')
-rw-r--r--src/location/maps/qgeoroutesegment_p.h79
1 files changed, 20 insertions, 59 deletions
diff --git a/src/location/maps/qgeoroutesegment_p.h b/src/location/maps/qgeoroutesegment_p.h
index 3807d4b8..42cc428c 100644
--- a/src/location/maps/qgeoroutesegment_p.h
+++ b/src/location/maps/qgeoroutesegment_p.h
@@ -68,77 +68,38 @@ class Q_LOCATION_PRIVATE_EXPORT QGeoRouteSegmentPrivate : public QSharedData
{
public:
QGeoRouteSegmentPrivate();
- QGeoRouteSegmentPrivate(const QGeoRouteSegmentPrivate &other);
- virtual ~QGeoRouteSegmentPrivate();
- virtual QGeoRouteSegmentPrivate *clone() = 0;
-
- bool operator ==(const QGeoRouteSegmentPrivate &other) const;
-
- virtual bool valid() const;
- virtual void setValid(bool valid);
-
- virtual bool isLegLastSegment() const;
- virtual void setLegLastSegment(bool lastSegment);
-
- virtual int travelTime() const;
- virtual void setTravelTime(int travelTime);
-
- virtual qreal distance() const;
- virtual void setDistance(qreal distance);
-
- virtual QList<QGeoCoordinate> path() const;
- virtual void setPath(const QList<QGeoCoordinate> &path);
-
- virtual QGeoManeuver maneuver() const;
- virtual void setManeuver(const QGeoManeuver &maneuver);
-
- virtual QExplicitlySharedDataPointer<QGeoRouteSegmentPrivate> nextRouteSegment() const;
- virtual void setNextRouteSegment(const QExplicitlySharedDataPointer<QGeoRouteSegmentPrivate> &next);
-
- QExplicitlySharedDataPointer<QGeoRouteSegmentPrivate> m_nextSegment;
static QGeoRouteSegmentPrivate *get(QGeoRouteSegment &segment);
-protected:
- virtual bool equals(const QGeoRouteSegmentPrivate &other) const;
-};
-
-
-
-class Q_LOCATION_PRIVATE_EXPORT QGeoRouteSegmentPrivateDefault : public QGeoRouteSegmentPrivate
-{
-public:
- QGeoRouteSegmentPrivateDefault();
- QGeoRouteSegmentPrivateDefault(const QGeoRouteSegmentPrivateDefault &other);
- ~QGeoRouteSegmentPrivateDefault();
- QGeoRouteSegmentPrivate *clone() override;
-
- bool operator ==(const QGeoRouteSegmentPrivateDefault &other) const;
-
- bool valid() const override;
- void setValid(bool valid) override;
+ bool valid() const;
+ void setValid(bool valid);
- bool isLegLastSegment() const override;
- void setLegLastSegment(bool lastSegment) override;
+ bool isLegLastSegment() const;
+ void setLegLastSegment(bool lastSegment);
- int travelTime() const override;
- void setTravelTime(int travelTime) override;
+ int travelTime() const;
+ void setTravelTime(int travelTime);
- qreal distance() const override;
- void setDistance(qreal distance) override;
+ qreal distance() const;
+ void setDistance(qreal distance);
- QList<QGeoCoordinate> path() const override;
- void setPath(const QList<QGeoCoordinate> &path) override;
+ QList<QGeoCoordinate> path() const;
+ void setPath(const QList<QGeoCoordinate> &path);
- QGeoManeuver maneuver() const override;
- void setManeuver(const QGeoManeuver &maneuver) override;
+ QGeoManeuver maneuver() const;
+ void setManeuver(const QGeoManeuver &maneuver);
+ QExplicitlySharedDataPointer<QGeoRouteSegmentPrivate> nextRouteSegment() const;
+ void setNextRouteSegment(const QExplicitlySharedDataPointer<QGeoRouteSegmentPrivate> &next);
- bool m_valid;
+ QExplicitlySharedDataPointer<QGeoRouteSegmentPrivate> m_nextSegment;
+ bool m_valid = false;
bool m_legLastSegment = false;
- int m_travelTime;
- qreal m_distance;
+ int m_travelTime = 0;
+ qreal m_distance = 0.0;
QList<QGeoCoordinate> m_path;
QGeoManeuver m_maneuver;
+
+ friend bool operator==(const QGeoRouteSegmentPrivate &lhs, const QGeoRouteSegmentPrivate &rhs);
};
QT_END_NAMESPACE