Browse Source

Fix deprecated Qt 5.15 usage

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

9
src/Airmap/AirMapWeatherInfoManager.cc

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

4
src/Airmap/AirMapWeatherInfoManager.h

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

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

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

Loading…
Cancel
Save