From 835804b0cf47de569193263f0759e235b04025eb Mon Sep 17 00:00:00 2001 From: DonLakeFlyer Date: Wed, 7 Jul 2021 12:07:57 -0700 Subject: [PATCH] Fix deprecated Qt 5.15 usage --- src/Airmap/AirMapWeatherInfoManager.cc | 11 +++++------ src/Airmap/AirMapWeatherInfoManager.h | 4 ++-- src/Airmap/QJsonWebToken/src/qjsonwebtoken.cpp | 4 ++-- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/Airmap/AirMapWeatherInfoManager.cc b/src/Airmap/AirMapWeatherInfoManager.cc index 6427f9a..194d5a2 100644 --- a/src/Airmap/AirMapWeatherInfoManager.cc +++ b/src/Airmap/AirMapWeatherInfoManager.cc @@ -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) 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(); } } } diff --git a/src/Airmap/AirMapWeatherInfoManager.h b/src/Airmap/AirMapWeatherInfoManager.h index 1ea75bb..337bff1 100644 --- a/src/Airmap/AirMapWeatherInfoManager.h +++ b/src/Airmap/AirMapWeatherInfoManager.h @@ -16,7 +16,7 @@ #include "QGCGeoBoundingCube.h" #include -#include +#include #include "airmap/advisory.h" @@ -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; }; diff --git a/src/Airmap/QJsonWebToken/src/qjsonwebtoken.cpp b/src/Airmap/QJsonWebToken/src/qjsonwebtoken.cpp index 8676bfe..f207152 100644 --- a/src/Airmap/QJsonWebToken/src/qjsonwebtoken.cpp +++ b/src/Airmap/QJsonWebToken/src/qjsonwebtoken.cpp @@ -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; }