Browse Source

Fix deprecated Qt 5.15 usage

QGC4.4
DonLakeFlyer 4 years ago committed by Don Gagne
parent
commit
835804b0cf
  1. 11
      src/Airmap/AirMapWeatherInfoManager.cc
  2. 4
      src/Airmap/AirMapWeatherInfoManager.h
  3. 4
      src/Airmap/QJsonWebToken/src/qjsonwebtoken.cpp

11
src/Airmap/AirMapWeatherInfoManager.cc

@ -10,9 +10,8 @@ @@ -10,9 +10,8 @@
#include "AirMapWeatherInfoManager.h"
#include "AirMapManager.h"
#define WEATHER_UPDATE_DISTANCE 50000 //-- 50km threshold for weather updates
#define WEATHER_UPDATE_TIME 30 * 60 * 60 * 1000 //-- 30 minutes threshold for weather updates
#define WEATHER_UPDATE_DISTANCE 50000 //-- 50km threshold for weather updates
#define WEATHER_UPDATE_TIME_MSECS 30 * 60 * 1000 //-- 30 minutes threshold for weather updates
using namespace airmap;
@ -30,12 +29,12 @@ AirMapWeatherInfoManager::setROI(const QGCGeoBoundingCube& roi, bool reset) @@ -30,12 +29,12 @@ AirMapWeatherInfoManager::setROI(const QGCGeoBoundingCube& roi, bool reset)
if(reset || (!_lastRoiCenter.isValid() || _lastRoiCenter.distanceTo(roi.center()) > WEATHER_UPDATE_DISTANCE)) {
_lastRoiCenter = roi.center();
_requestWeatherUpdate(_lastRoiCenter);
_weatherTime.start();
_weatherTimeElapsed.start();
} else {
//-- Check weather once every WEATHER_UPDATE_TIME
if(_weatherTime.elapsed() > WEATHER_UPDATE_TIME) {
if(_weatherTimeElapsed.elapsed() > WEATHER_UPDATE_TIME_MSECS) {
_requestWeatherUpdate(roi.center());
_weatherTime.start();
_weatherTimeElapsed.start();
}
}
}

4
src/Airmap/AirMapWeatherInfoManager.h

@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@
#include "QGCGeoBoundingCube.h"
#include <QGeoCoordinate>
#include <QTime>
#include <QElapsedTimer>
#include "airmap/advisory.h"
@ -57,5 +57,5 @@ private: @@ -57,5 +57,5 @@ private:
//-- Don't check the weather every time the user moves the map
AirMapSharedState& _shared;
QGeoCoordinate _lastRoiCenter;
QTime _weatherTime;
QElapsedTimer _weatherTimeElapsed;
};

4
src/Airmap/QJsonWebToken/src/qjsonwebtoken.cpp

@ -186,9 +186,9 @@ bool QJsonWebToken::setAlgorithmStr(QString strAlgorithm) @@ -186,9 +186,9 @@ bool QJsonWebToken::setAlgorithmStr(QString strAlgorithm)
// set algorithm
m_strAlgorithm = strAlgorithm;
// modify header
m_jdocHeader = QJsonDocument::fromJson(QObject::trUtf8("{\"typ\": \"JWT\", \"alg\" : \"").toUtf8()
m_jdocHeader = QJsonDocument::fromJson(QStringLiteral("{\"typ\": \"JWT\", \"alg\" : \"").toUtf8()
+ m_strAlgorithm.toUtf8()
+ QObject::trUtf8("\"}").toUtf8());
+ QStringLiteral("\"}").toUtf8());
return true;
}

Loading…
Cancel
Save