summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Solovev <ivan.solovev@qt.io>2021-01-21 12:25:05 +0100
committerIvan Solovev <ivan.solovev@qt.io>2021-01-22 14:32:03 +0100
commit8f25a043dae764bb7def1f67ea49595d74eeb1d0 (patch)
tree858d18240ed83edecd9a62b96b78cca1f1700cb5
parentb45ee37f5587f9193c8c03bba580334fbf0d9d42 (diff)
downloadqtlocation-dev.tar.gz
QtPositioning: get rid of warningsHEADdev
Fix warnings in QtPositioning sources. These are mostly the warnings regarding a missing "override" keyword in unit tests. Task-number: QTBUG-90491 Change-Id: I6ca676de0733767d4b85353670103ad5a8d60688 Reviewed-by: Juha Vuolle <juha.vuolle@insta.fi> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
-rw-r--r--examples/positioning/logfilepositionsource/logfilepositionsource.h14
-rw-r--r--examples/positioning/satelliteinfo/satellitemodel.h10
-rw-r--r--src/plugins/position/android/src/qgeopositioninfosource_android_p.h18
-rw-r--r--src/plugins/position/android/src/qgeosatelliteinfosource_android_p.h12
-rw-r--r--src/plugins/position/corelocation/qgeopositioninfosource_cl_p.h16
-rw-r--r--src/plugins/position/gypsy/qgeosatelliteinfosource_gypsy.cpp4
-rw-r--r--src/plugins/position/simulator/qgeopositioninfosource_simulator_p.h16
-rw-r--r--src/plugins/position/simulator/qgeosatelliteinfosource_simulator_p.h12
-rw-r--r--tests/auto/qgeoareamonitor/logfilepositionsource.h14
-rw-r--r--tests/auto/qgeopositioninfosource/testqgeopositioninfosource.cpp16
-rw-r--r--tests/auto/qgeosatelliteinfosource/testqgeosatelliteinfosource.cpp12
-rw-r--r--tests/auto/qnmeapositioninfosource/dummynmeapositioninfosource/tst_dummynmeapositioninfosource.cpp10
-rw-r--r--tests/auto/qnmeapositioninfosource/qnmeapositioninfosource_realtime_generic/tst_qnmeapositioninfosource_realtime_generic.cpp2
-rw-r--r--tests/auto/qnmeapositioninfosource/qnmeapositioninfosource_simulation_generic/tst_qnmeapositioninfosource_simulation_generic.cpp2
-rw-r--r--tests/auto/qnmeapositioninfosource/tst_qnmeapositioninfosource.h6
15 files changed, 83 insertions, 81 deletions
diff --git a/examples/positioning/logfilepositionsource/logfilepositionsource.h b/examples/positioning/logfilepositionsource/logfilepositionsource.h
index 843516cc..027dabd4 100644
--- a/examples/positioning/logfilepositionsource/logfilepositionsource.h
+++ b/examples/positioning/logfilepositionsource/logfilepositionsource.h
@@ -63,17 +63,17 @@ class LogFilePositionSource : public QGeoPositionInfoSource
public:
LogFilePositionSource(QObject *parent = 0);
- QGeoPositionInfo lastKnownPosition(bool fromSatellitePositioningMethodsOnly = false) const;
+ QGeoPositionInfo lastKnownPosition(bool fromSatellitePositioningMethodsOnly = false) const override;
- PositioningMethods supportedPositioningMethods() const;
- int minimumUpdateInterval() const;
- Error error() const;
+ PositioningMethods supportedPositioningMethods() const override;
+ int minimumUpdateInterval() const override;
+ Error error() const override;
public slots:
- virtual void startUpdates();
- virtual void stopUpdates();
+ virtual void startUpdates() override;
+ virtual void stopUpdates() override;
- virtual void requestUpdate(int timeout = 5000);
+ virtual void requestUpdate(int timeout = 5000) override;
private slots:
void readNextPosition();
diff --git a/examples/positioning/satelliteinfo/satellitemodel.h b/examples/positioning/satelliteinfo/satellitemodel.h
index 37f8301e..0b6cf6b1 100644
--- a/examples/positioning/satelliteinfo/satellitemodel.h
+++ b/examples/positioning/satelliteinfo/satellitemodel.h
@@ -80,13 +80,13 @@ public:
};
//From QAbstractListModel
- int rowCount(const QModelIndex &parent) const;
- QVariant data(const QModelIndex &index, int role) const;
- QHash<int, QByteArray> roleNames() const;
+ int rowCount(const QModelIndex &parent) const override;
+ QVariant data(const QModelIndex &index, int role) const override;
+ QHash<int, QByteArray> roleNames() const override;
//From QQmlParserStatus
- void classBegin() {}
- void componentComplete();
+ void classBegin() override {}
+ void componentComplete() override;
bool running() const;
void setRunning(bool isActive);
diff --git a/src/plugins/position/android/src/qgeopositioninfosource_android_p.h b/src/plugins/position/android/src/qgeopositioninfosource_android_p.h
index 61e107b1..334b42a8 100644
--- a/src/plugins/position/android/src/qgeopositioninfosource_android_p.h
+++ b/src/plugins/position/android/src/qgeopositioninfosource_android_p.h
@@ -62,18 +62,18 @@ public:
~QGeoPositionInfoSourceAndroid();
// From QGeoPositionInfoSource
- void setUpdateInterval(int msec);
- QGeoPositionInfo lastKnownPosition(bool fromSatellitePositioningMethodsOnly = false) const;
- PositioningMethods supportedPositioningMethods() const;
- void setPreferredPositioningMethods(PositioningMethods methods);
- int minimumUpdateInterval() const;
- Error error() const;
+ void setUpdateInterval(int msec) override;
+ QGeoPositionInfo lastKnownPosition(bool fromSatellitePositioningMethodsOnly = false) const override;
+ PositioningMethods supportedPositioningMethods() const override;
+ void setPreferredPositioningMethods(PositioningMethods methods) override;
+ int minimumUpdateInterval() const override;
+ Error error() const override;
public Q_SLOTS:
- virtual void startUpdates();
- virtual void stopUpdates();
+ virtual void startUpdates() override;
+ virtual void stopUpdates() override;
- virtual void requestUpdate(int timeout = 0);
+ virtual void requestUpdate(int timeout = 0) override;
void processPositionUpdate(const QGeoPositionInfo& pInfo);
void processSinglePositionUpdate(const QGeoPositionInfo& pInfo);
diff --git a/src/plugins/position/android/src/qgeosatelliteinfosource_android_p.h b/src/plugins/position/android/src/qgeosatelliteinfosource_android_p.h
index 37c64ad4..150009a2 100644
--- a/src/plugins/position/android/src/qgeosatelliteinfosource_android_p.h
+++ b/src/plugins/position/android/src/qgeosatelliteinfosource_android_p.h
@@ -63,15 +63,15 @@ public:
~QGeoSatelliteInfoSourceAndroid();
//From QGeoSatelliteInfoSource
- void setUpdateInterval(int msec);
- int minimumUpdateInterval() const;
+ void setUpdateInterval(int msec) override;
+ int minimumUpdateInterval() const override;
- Error error() const;
+ Error error() const override;
public Q_SLOTS:
- void startUpdates();
- void stopUpdates();
- void requestUpdate(int timeout = 0);
+ void startUpdates() override;
+ void stopUpdates() override;
+ void requestUpdate(int timeout = 0) override;
void processSatelliteUpdateInView(const QList<QGeoSatelliteInfo> &satsInView, bool isSingleUpdate);
void processSatelliteUpdateInUse(const QList<QGeoSatelliteInfo> &satsInUse, bool isSingleUpdate);
diff --git a/src/plugins/position/corelocation/qgeopositioninfosource_cl_p.h b/src/plugins/position/corelocation/qgeopositioninfosource_cl_p.h
index 5ede8bf6..411267b6 100644
--- a/src/plugins/position/corelocation/qgeopositioninfosource_cl_p.h
+++ b/src/plugins/position/corelocation/qgeopositioninfosource_cl_p.h
@@ -65,12 +65,12 @@ public:
QGeoPositionInfoSourceCL(QObject *parent = 0);
~QGeoPositionInfoSourceCL();
- QGeoPositionInfo lastKnownPosition(bool fromSatellitePositioningMethodsOnly = false) const;
- PositioningMethods supportedPositioningMethods() const;
+ QGeoPositionInfo lastKnownPosition(bool fromSatellitePositioningMethodsOnly = false) const override;
+ PositioningMethods supportedPositioningMethods() const override;
- void setUpdateInterval(int msec);
- int minimumUpdateInterval() const;
- Error error() const;
+ void setUpdateInterval(int msec) override;
+ int minimumUpdateInterval() const override;
+ Error error() const override;
void locationDataAvailable(QGeoPositionInfo location);
void setError(QGeoPositionInfoSource::Error positionError);
@@ -80,10 +80,10 @@ private:
void setTimeoutInterval(int msec);
public Q_SLOTS:
- void startUpdates();
- void stopUpdates();
+ void startUpdates() override;
+ void stopUpdates() override;
- void requestUpdate(int timeout = 0);
+ void requestUpdate(int timeout = 0) override;
protected:
virtual void timerEvent(QTimerEvent *event);
diff --git a/src/plugins/position/gypsy/qgeosatelliteinfosource_gypsy.cpp b/src/plugins/position/gypsy/qgeosatelliteinfosource_gypsy.cpp
index 1694fd30..2a3f31dc 100644
--- a/src/plugins/position/gypsy/qgeosatelliteinfosource_gypsy.cpp
+++ b/src/plugins/position/gypsy/qgeosatelliteinfosource_gypsy.cpp
@@ -218,7 +218,9 @@ int QGeoSatelliteInfoSourceGypsy::init()
GConfClient *client;
gchar *device_name;
- g_type_init ();
+#if !GLIB_CHECK_VERSION(2, 36, 0)
+ g_type_init (); // this function was deprecated in glib 2.36
+#endif
createEngine();
client = m_engine->eng_gconf_client_get_default();
diff --git a/src/plugins/position/simulator/qgeopositioninfosource_simulator_p.h b/src/plugins/position/simulator/qgeopositioninfosource_simulator_p.h
index 6b1acfc3..8fd33368 100644
--- a/src/plugins/position/simulator/qgeopositioninfosource_simulator_p.h
+++ b/src/plugins/position/simulator/qgeopositioninfosource_simulator_p.h
@@ -66,18 +66,18 @@ public:
QGeoPositionInfoSourceSimulator(QObject *parent = 0);
~QGeoPositionInfoSourceSimulator();
- QGeoPositionInfo lastKnownPosition(bool fromSatellitePositioningMethodsOnly = false) const;
- PositioningMethods supportedPositioningMethods() const;
+ QGeoPositionInfo lastKnownPosition(bool fromSatellitePositioningMethodsOnly = false) const override;
+ PositioningMethods supportedPositioningMethods() const override;
- void setUpdateInterval(int msec);
- int minimumUpdateInterval() const;
- Error error() const;
+ void setUpdateInterval(int msec) override;
+ int minimumUpdateInterval() const override;
+ Error error() const override;
public Q_SLOTS:
- void startUpdates();
- void stopUpdates();
+ void startUpdates() override;
+ void stopUpdates() override;
- void requestUpdate(int timeout = 0);
+ void requestUpdate(int timeout = 0) override;
private slots:
void updatePosition();
diff --git a/src/plugins/position/simulator/qgeosatelliteinfosource_simulator_p.h b/src/plugins/position/simulator/qgeosatelliteinfosource_simulator_p.h
index c2fb0d09..ac8293a2 100644
--- a/src/plugins/position/simulator/qgeosatelliteinfosource_simulator_p.h
+++ b/src/plugins/position/simulator/qgeosatelliteinfosource_simulator_p.h
@@ -69,15 +69,15 @@ public:
bool isConnected() const;
- virtual void setUpdateInterval(int msec);
- virtual int minimumUpdateInterval() const;
+ virtual void setUpdateInterval(int msec) override;
+ virtual int minimumUpdateInterval() const override;
// Default implementation for error()
- Error error() const { return QGeoSatelliteInfoSource::NoError; }
+ Error error() const override { return QGeoSatelliteInfoSource::NoError; }
public slots:
- virtual void startUpdates();
- virtual void stopUpdates();
- virtual void requestUpdate(int timeout = 5000);
+ virtual void startUpdates() override;
+ virtual void stopUpdates() override;
+ virtual void requestUpdate(int timeout = 5000) override;
private slots:
void updateData();
diff --git a/tests/auto/qgeoareamonitor/logfilepositionsource.h b/tests/auto/qgeoareamonitor/logfilepositionsource.h
index 3768d755..c284109e 100644
--- a/tests/auto/qgeoareamonitor/logfilepositionsource.h
+++ b/tests/auto/qgeoareamonitor/logfilepositionsource.h
@@ -42,17 +42,17 @@ class LogFilePositionSource : public QGeoPositionInfoSource
public:
LogFilePositionSource(QObject *parent = 0);
- QGeoPositionInfo lastKnownPosition(bool fromSatellitePositioningMethodsOnly = false) const;
+ QGeoPositionInfo lastKnownPosition(bool fromSatellitePositioningMethodsOnly = false) const override;
- PositioningMethods supportedPositioningMethods() const;
- int minimumUpdateInterval() const;
- Error error() const;
+ PositioningMethods supportedPositioningMethods() const override;
+ int minimumUpdateInterval() const override;
+ Error error() const override;
public slots:
- virtual void startUpdates();
- virtual void stopUpdates();
+ virtual void startUpdates() override;
+ virtual void stopUpdates() override;
- virtual void requestUpdate(int timeout = 5000);
+ virtual void requestUpdate(int timeout = 5000) override;
private slots:
void readNextPosition();
diff --git a/tests/auto/qgeopositioninfosource/testqgeopositioninfosource.cpp b/tests/auto/qgeopositioninfosource/testqgeopositioninfosource.cpp
index ce7b4d66..953d885a 100644
--- a/tests/auto/qgeopositioninfosource/testqgeopositioninfosource.cpp
+++ b/tests/auto/qgeopositioninfosource/testqgeopositioninfosource.cpp
@@ -68,7 +68,7 @@ public:
: QGeoPositionInfoSource(parent) {
}
- QGeoPositionInfo lastKnownPosition(bool /*fromSatellitePositioningMethodsOnly = false*/) const {
+ QGeoPositionInfo lastKnownPosition(bool /*fromSatellitePositioningMethodsOnly = false*/) const override {
return QGeoPositionInfo();
}
@@ -76,19 +76,19 @@ public:
m_methods = methods;
}
- virtual PositioningMethods supportedPositioningMethods() const {
+ virtual PositioningMethods supportedPositioningMethods() const override {
return m_methods;
}
- virtual int minimumUpdateInterval() const {
+ virtual int minimumUpdateInterval() const override {
return 0;
}
- virtual void startUpdates() {}
- virtual void stopUpdates() {}
+ virtual void startUpdates() override {}
+ virtual void stopUpdates() override {}
- virtual void requestUpdate(int) {}
+ virtual void requestUpdate(int) override {}
- Error error() const { return QGeoPositionInfoSource::NoError; }
+ Error error() const override { return QGeoPositionInfoSource::NoError; }
private:
PositioningMethods m_methods;
@@ -98,7 +98,7 @@ class DefaultSourceTest : public TestQGeoPositionInfoSource
{
Q_OBJECT
protected:
- QGeoPositionInfoSource *createTestSource() {
+ QGeoPositionInfoSource *createTestSource() override {
return QGeoPositionInfoSource::createSource(QStringLiteral("test.source"), 0);
}
};
diff --git a/tests/auto/qgeosatelliteinfosource/testqgeosatelliteinfosource.cpp b/tests/auto/qgeosatelliteinfosource/testqgeosatelliteinfosource.cpp
index 0e75baa4..42e2a3c6 100644
--- a/tests/auto/qgeosatelliteinfosource/testqgeosatelliteinfosource.cpp
+++ b/tests/auto/qgeosatelliteinfosource/testqgeosatelliteinfosource.cpp
@@ -64,13 +64,13 @@ public:
MySatelliteSource(QObject *parent = 0)
: QGeoSatelliteInfoSource(parent) {
}
- virtual void startUpdates() {}
- virtual void stopUpdates() {}
- virtual void requestUpdate(int) {}
- virtual int minimumUpdateInterval() const {
+ virtual void startUpdates() override {}
+ virtual void stopUpdates() override {}
+ virtual void requestUpdate(int) override {}
+ virtual int minimumUpdateInterval() const override {
return 0;
}
- Error error() const { return QGeoSatelliteInfoSource::NoError; }
+ Error error() const override { return QGeoSatelliteInfoSource::NoError; }
};
@@ -78,7 +78,7 @@ class DefaultSourceTest : public TestQGeoSatelliteInfoSource
{
Q_OBJECT
protected:
- QGeoSatelliteInfoSource *createTestSource() {
+ QGeoSatelliteInfoSource *createTestSource() override {
return QGeoSatelliteInfoSource::createDefaultSource(0);
}
};
diff --git a/tests/auto/qnmeapositioninfosource/dummynmeapositioninfosource/tst_dummynmeapositioninfosource.cpp b/tests/auto/qnmeapositioninfosource/dummynmeapositioninfosource/tst_dummynmeapositioninfosource.cpp
index e07fb707..8330e0b7 100644
--- a/tests/auto/qnmeapositioninfosource/dummynmeapositioninfosource/tst_dummynmeapositioninfosource.cpp
+++ b/tests/auto/qnmeapositioninfosource/dummynmeapositioninfosource/tst_dummynmeapositioninfosource.cpp
@@ -46,10 +46,10 @@ public:
DummyNmeaPositionInfoSource(QNmeaPositionInfoSource::UpdateMode mode, QObject *parent = 0);
protected:
- virtual bool parsePosInfoFromNmeaData(const char *data,
- int size,
- QGeoPositionInfo *posInfo,
- bool *hasFix);
+ bool parsePosInfoFromNmeaData(const char *data,
+ int size,
+ QGeoPositionInfo *posInfo,
+ bool *hasFix) override;
private:
int callCount;
@@ -70,7 +70,7 @@ bool DummyNmeaPositionInfoSource::parsePosInfoFromNmeaData(const char* data,
Q_UNUSED(size);
posInfo->setCoordinate(QGeoCoordinate(callCount * 1.0, callCount * 1.0, callCount * 1.0));
- posInfo->setTimestamp(QDateTime::currentDateTime().toUTC());
+ posInfo->setTimestamp(QDateTime::currentDateTimeUtc());
*hasFix = true;
++callCount;
diff --git a/tests/auto/qnmeapositioninfosource/qnmeapositioninfosource_realtime_generic/tst_qnmeapositioninfosource_realtime_generic.cpp b/tests/auto/qnmeapositioninfosource/qnmeapositioninfosource_realtime_generic/tst_qnmeapositioninfosource_realtime_generic.cpp
index d3f03c0d..5a7ec2e0 100644
--- a/tests/auto/qnmeapositioninfosource/qnmeapositioninfosource_realtime_generic/tst_qnmeapositioninfosource_realtime_generic.cpp
+++ b/tests/auto/qnmeapositioninfosource/qnmeapositioninfosource_realtime_generic/tst_qnmeapositioninfosource_realtime_generic.cpp
@@ -58,7 +58,7 @@ public:
}
protected:
- QGeoPositionInfoSource *createTestSource()
+ QGeoPositionInfoSource *createTestSource() override
{
QNmeaPositionInfoSource *source = new QNmeaPositionInfoSource(QNmeaPositionInfoSource::RealTimeMode);
QNmeaPositionInfoSourceProxy *proxy = static_cast<QNmeaPositionInfoSourceProxy*>(m_factory->createProxy(source));
diff --git a/tests/auto/qnmeapositioninfosource/qnmeapositioninfosource_simulation_generic/tst_qnmeapositioninfosource_simulation_generic.cpp b/tests/auto/qnmeapositioninfosource/qnmeapositioninfosource_simulation_generic/tst_qnmeapositioninfosource_simulation_generic.cpp
index adc55f64..2f2827de 100644
--- a/tests/auto/qnmeapositioninfosource/qnmeapositioninfosource_simulation_generic/tst_qnmeapositioninfosource_simulation_generic.cpp
+++ b/tests/auto/qnmeapositioninfosource/qnmeapositioninfosource_simulation_generic/tst_qnmeapositioninfosource_simulation_generic.cpp
@@ -51,7 +51,7 @@ public:
}
protected:
- QGeoPositionInfoSource *createTestSource()
+ QGeoPositionInfoSource *createTestSource() override
{
QNmeaPositionInfoSource *source = new QNmeaPositionInfoSource(QNmeaPositionInfoSource::SimulationMode);
source->setDevice(new UnlimitedNmeaStream(source));
diff --git a/tests/auto/qnmeapositioninfosource/tst_qnmeapositioninfosource.h b/tests/auto/qnmeapositioninfosource/tst_qnmeapositioninfosource.h
index 073a4aac..1b4aecce 100644
--- a/tests/auto/qnmeapositioninfosource/tst_qnmeapositioninfosource.h
+++ b/tests/auto/qnmeapositioninfosource/tst_qnmeapositioninfosource.h
@@ -162,7 +162,7 @@ public:
UnlimitedNmeaStream(QObject *parent) : QIODevice(parent) {}
protected:
- qint64 readData(char *data, qint64 maxSize)
+ qint64 readData(char *data, qint64 maxSize) override
{
QByteArray bytes = QLocationTestUtils::createRmcSentence(QDateTime::currentDateTime()).toLatin1();
qint64 sz = qMin(qint64(bytes.size()), maxSize);
@@ -170,12 +170,12 @@ protected:
return sz;
}
- qint64 writeData(const char *, qint64)
+ qint64 writeData(const char *, qint64) override
{
return -1;
}
- qint64 bytesAvailable() const
+ qint64 bytesAvailable() const override
{
return 1024 + QIODevice::bytesAvailable();
}