Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
kebekus committed Oct 1, 2024
2 parents 11fd8da + 678271b commit 9b7d090
Show file tree
Hide file tree
Showing 74 changed files with 1,910 additions and 1,671 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ build-android-release/
build-android-debug/
build-linux/
build-macos/
.project

# Doxygen generated documentation
doc/APIdoc
Expand Down
2 changes: 1 addition & 1 deletion 3rdParty/enrouteText
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ option(QTDEPLOY "Generate and run Qt deployment scripts" OFF)
# Project data
#

project(enroute VERSION 2.31.10)
project(enroute VERSION 2.31.11)
set(APP_ID de.akaflieg_freiburg.enroute)
set(DISPLAY_NAME "Enroute")
math(EXPR PROJECT_VERSION_CODE 10000*${PROJECT_VERSION_MAJOR}+100*${PROJECT_VERSION_MINOR}+${PROJECT_VERSION_PATCH})
Expand Down
13 changes: 6 additions & 7 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ set(SOURCES
navigation/Leg.h
navigation/Navigator.h
navigation/RemainingRouteInfo.h
notam/Notam.h
notam/NotamList.h
notam/NotamProvider.h
notam/NOTAM.h
notam/NOTAMList.h
notam/NOTAMProvider.h
notification/Notification.h
notification/Notification_DataUpdateAvailable.h
notification/NotificationManager.h
Expand Down Expand Up @@ -163,9 +163,9 @@ set(SOURCES
navigation/Leg.cpp
navigation/Navigator.cpp
navigation/RemainingRouteInfo.cpp
notam/Notam.cpp
notam/NotamList.cpp
notam/NotamProvider.cpp
notam/NOTAM.cpp
notam/NOTAMList.cpp
notam/NOTAMProvider.cpp
notification/Notification.cpp
notification/Notification_DataUpdateAvailable.cpp
notification/NotificationManager.cpp
Expand Down Expand Up @@ -538,7 +538,6 @@ qt_add_qml_module(${PROJECT_NAME}
qml/dialogs/AircraftSaveDialog.qml
qml/dialogs/ErrorDialog.qml
qml/dialogs/FirstRunDialog.qml
qml/dialogs/FlightRouteAddWPDialog.qml
qml/dialogs/FlightRouteSaveDialog.qml
qml/dialogs/LongTextDialogMD.qml
qml/dialogs/NotamListDialog.qml
Expand Down
2 changes: 1 addition & 1 deletion src/DemoRunner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ void DemoRunner::generateGooglePlayScreenshots()
generateScreenshotsForDevices({"phone", "sevenInch", "tenInch"}, false);
}

void DemoRunner::generateScreenshotsForDevices(QStringList devices, bool manual)
void DemoRunner::generateScreenshotsForDevices(const QStringList &devices, bool manual)
{
#if defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID) || defined(Q_OS_IOS)
Q_ASSERT(m_engine != nullptr);
Expand Down
2 changes: 1 addition & 1 deletion src/DemoRunner.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public slots:

QPointer<QQmlApplicationEngine> m_engine;

void generateScreenshotsForDevices(QStringList, bool);
void generateScreenshotsForDevices(const QStringList &, bool);

static void saveScreenshot(bool, QQuickWindow *, const QString&);
};
8 changes: 4 additions & 4 deletions src/GlobalObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include "geomaps/WaypointLibrary.h"
#include "navigation/Clock.h"
#include "navigation/Navigator.h"
#include "notam/NotamProvider.h"
#include "notam/NOTAMProvider.h"
#include "notification/NotificationManager.h"
#include "platform/FileExchange.h"
#include "platform/PlatformAdaptor.h"
Expand All @@ -56,7 +56,7 @@ QPointer<GeoMaps::GeoMapProvider> g_geoMapProvider {};
QPointer<Librarian> g_librarian {};
QPointer<Platform::PlatformAdaptor> g_platformAdaptor {};
QPointer<Navigation::Navigator> g_navigator {};
QPointer<NOTAM::NotamProvider> g_notamProvider {};
QPointer<NOTAM::NOTAMProvider> g_notamProvider {};
QPointer<QNetworkAccessManager> g_networkAccessManager {};
QPointer<Notifications::NotificationManager> g_notificationManager {};
QPointer<Traffic::PasswordDB> g_passwordDB {};
Expand Down Expand Up @@ -203,9 +203,9 @@ auto GlobalObject::networkAccessManager() -> QNetworkAccessManager*
}


auto GlobalObject::notamProvider() -> NOTAM::NotamProvider*
auto GlobalObject::notamProvider() -> NOTAM::NOTAMProvider*
{
return allocateInternal<NOTAM::NotamProvider>(g_notamProvider);
return allocateInternal<NOTAM::NOTAMProvider>(g_notamProvider);
}


Expand Down
4 changes: 2 additions & 2 deletions src/GlobalObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class Navigator;

namespace NOTAM
{
class NotamProvider;
class NOTAMProvider;
} // namespace NOTAM

namespace Notifications
Expand Down Expand Up @@ -221,7 +221,7 @@ class GlobalObject : public QObject
*
* @returns Pointer to appplication-wide static instance.
*/
Q_INVOKABLE static NOTAM::NotamProvider* notamProvider();
Q_INVOKABLE static NOTAM::NOTAMProvider* notamProvider();

/*! \brief Pointer to appplication-wide static notification manager instance
*
Expand Down
32 changes: 23 additions & 9 deletions src/dataManagement/DataManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

#include <QCoreApplication>
#include <QDirIterator>
#include <QGuiApplication>
#include <QImage>
#include <QJsonArray>
#include <QJsonDocument>
Expand Down Expand Up @@ -61,13 +62,16 @@ void DataManagement::DataManager::deferredInitialization()
// If there is a downloaded maps.json file, we read it.
updateDataItemListAndWhatsNew();

// If the last update is more than one day ago, automatically initiate an
// update, so that maps stay at least roughly current.
auto lastUpdate = QSettings().value(QStringLiteral("DataManager/MapListTimeStamp"), QDateTime()).toDateTime();
if (!lastUpdate.isValid() || (qAbs(lastUpdate.daysTo(QDateTime::currentDateTime()) > 0)))
{
updateRemoteDataItemList();
}
// Update maps.json file if that is too old. Check that whenever the app comes forward.
updateRemoteDataItemListIfOutdated();
connect(qGuiApp, &QGuiApplication::applicationStateChanged, this,
[this](Qt::ApplicationState state)
{
if (state == Qt::ApplicationActive)
{
updateRemoteDataItemListIfOutdated();
}
});
}


Expand Down Expand Up @@ -401,8 +405,6 @@ void DataManagement::DataManager::updateDataItemListAndWhatsNew()
}
}

qWarning() << minVersionString << currentVersionString;

if (minVersionString > currentVersionString)
{
if (!m_appUpdateRequired)
Expand Down Expand Up @@ -489,3 +491,15 @@ void DataManagement::DataManager::updateDataItemListAndWhatsNew()
emit whatsNewChanged();
}
}


void DataManagement::DataManager::updateRemoteDataItemListIfOutdated()
{
// If the last update is more than one day ago, automatically initiate an
// update, so that maps stay at least roughly current.
auto lastUpdate = QSettings().value(QStringLiteral("DataManager/MapListTimeStamp"), QDateTime()).toDateTime();
if (!lastUpdate.isValid() || (qAbs(lastUpdate.daysTo(QDateTime::currentDateTime()) > 0)))
{
m_mapList.startDownload();
}
}
10 changes: 4 additions & 6 deletions src/dataManagement/DataManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -301,12 +301,10 @@ class DataManager : public GlobalObject
public slots:
/*! \brief Triggers an update of the list of remotely available data items
*
* This will trigger a download the file maps.json from the remote server.
* This will trigger a download the file maps.json from the remote server if the last update
* is more than one day ago.
*/
void updateRemoteDataItemList()
{
m_mapList.startDownload();
}
void updateRemoteDataItemListIfOutdated();

signals:
/*! Notifier signal */
Expand Down Expand Up @@ -360,7 +358,7 @@ public slots:
QString m_dataDirectory {QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/aviation_maps"};

// The current whats new string from _aviationMaps.
QString m_whatsNew {};
QString m_whatsNew;

// This Downloadable object manages the central text file that describes the
// remotely available aviation maps.
Expand Down
4 changes: 2 additions & 2 deletions src/dataManagement/Downloadable_SingleFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -382,13 +382,13 @@ class Downloadable_SingleFile : public Downloadable_Abstract

// Temporary file for storing partiall data when downloading the remote
// file. Set to nullptr when no download is in progress.
QPointer<QSaveFile> m_saveFile{};
QPointer<QSaveFile> m_saveFile;

// URL of the remote file, as set in the constructor
QUrl m_url;

// Name of the local file, as set in the constructor
QString m_fileName{};
QString m_fileName;

// Modification date of the remote file, set directly via a setter method or
// by calling downloadRemoteFileInfo().
Expand Down
8 changes: 4 additions & 4 deletions src/fileFormats/GeoTIFF.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,10 @@ class GeoTIFF : public TIFF
void interpretGeoData();

// Geographic coordinates for corner of raster image
QGeoCoordinate m_topLeft {};
QGeoCoordinate m_topRight {};
QGeoCoordinate m_bottomLeft {};
QGeoCoordinate m_bottomRight {};
QGeoCoordinate m_topLeft;
QGeoCoordinate m_topRight;
QGeoCoordinate m_bottomLeft;
QGeoCoordinate m_bottomRight;

// Name
QString m_name;
Expand Down
2 changes: 1 addition & 1 deletion src/fileFormats/TIFF.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class TIFF : public DataFileAbstract
void readRasterSize();

// Size of the raster imags
QSize m_rasterSize {};
QSize m_rasterSize;

// TIFF tags and associated data
QMap<quint16, QVariantList> m_TIFFFields;
Expand Down
2 changes: 1 addition & 1 deletion src/fileFormats/TripKit.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ class TripKit : public DataFileAbstract

// Some trip kits contain the content top-level, other trip kits hide the content ina top-level
// directory. This string is either empty or of the form "topLevelDirName/".
QString m_prefix {};
QString m_prefix;
};

} // namespace FileFormats
10 changes: 5 additions & 5 deletions src/geomaps/Airspace.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,11 @@ class Airspace {
// in meters. If the height string cannot be parsed, returns the original string
[[nodiscard]] static auto makeMetric(const QString& standard) -> QString;

QString m_name{};
QString m_CAT{};
QString m_upperBound{};
QString m_lowerBound{};
QGeoPolygon m_polygon{};
QString m_name;
QString m_CAT;
QString m_upperBound;
QString m_lowerBound;
QGeoPolygon m_polygon;
};

/*! \brief Comparison */
Expand Down
12 changes: 6 additions & 6 deletions src/geomaps/VAC.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,22 +197,22 @@ class VAC
//

/*! \brief Member variable for property of the same name */
QGeoCoordinate bottomLeft {};
QGeoCoordinate bottomLeft;

/*! \brief Member variable for property of the same name */
QGeoCoordinate bottomRight {};
QGeoCoordinate bottomRight;

/*! \brief Member variable for property of the same name */
QString fileName {};
QString fileName;

/*! \brief Member variable for property of the same name */
QString name {};
QString name;

/*! \brief Member variable for property of the same name */
QGeoCoordinate topLeft {};
QGeoCoordinate topLeft;

/*! \brief Member variable for property of the same name */
QGeoCoordinate topRight {};
QGeoCoordinate topRight;

private:
// Obtain values for topLeft etc by looking at the file name
Expand Down
3 changes: 2 additions & 1 deletion src/icons.qrc.in
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@
<file alias="icons/material/ic_remove.svg">${material-design-icons_SOURCE_DIR}/content/svg/production/ic_remove_24px.svg</file>
<file alias="icons/material/ic_remove_circle.svg">${material-design-icons_SOURCE_DIR}/content/svg/production/ic_remove_circle_24px.svg</file>
<file alias="icons/material/ic_satellite.svg">${material-design-icons_SOURCE_DIR}/maps/svg/production/ic_satellite_24px.svg</file>
<file alias="icons/material/ic_send.svg">${material-design-icons_SOURCE_DIR}/content/svg/design/ic_send_24px.svg</file>
<file alias="icons/material/ic_search.svg">${material-design-icons_SOURCE_DIR}/action/svg/production/ic_search_24px.svg</file>
<file alias="icons/material/ic_send.svg">${material-design-icons_SOURCE_DIR}/content/svg/production/ic_send_24px.svg</file>
<file alias="icons/material/ic_settings.svg">${material-design-icons_SOURCE_DIR}/action/svg/production/ic_settings_24px.svg</file>
<file alias="icons/material/ic_settings_ethernet.svg">${material-design-icons_SOURCE_DIR}/action/svg/production/ic_settings_ethernet_24px.svg</file>
<file alias="icons/material/ic_speaker_phone.svg">${material-design-icons_SOURCE_DIR}/communication/svg/production/ic_speaker_phone_24px.svg</file>
Expand Down
7 changes: 2 additions & 5 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,12 +186,9 @@ auto main(int argc, char *argv[]) -> int
KDSingleApplication kdsingleapp;
if (!kdsingleapp.isPrimaryInstance())
{
if (positionalArguments.length() > 0)
{
if (!positionalArguments.empty()) {
kdsingleapp.sendMessage(positionalArguments[0].toUtf8());
}
else
{
} else {
kdsingleapp.sendMessage(QByteArray());
}
return 0;
Expand Down
4 changes: 2 additions & 2 deletions src/navigation/Aircraft.h
Original file line number Diff line number Diff line change
Expand Up @@ -386,8 +386,8 @@ class Aircraft {
FuelConsumptionUnit m_fuelConsumptionUnit {LiterPerHour};
HorizontalDistanceUnit m_horizontalDistanceUnit {NauticalMile};
Units::Speed m_minimumSpeed {};
QString m_name {};
VerticalDistanceUnit m_verticalDistanceUnit {Feet};
QString m_name;
VerticalDistanceUnit m_verticalDistanceUnit{Feet};
};

} // namespace Navigation
Expand Down
3 changes: 1 addition & 2 deletions src/navigation/Clock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
***************************************************************************/

#include "Clock.h"
#include "positioning/PositionProvider.h"

#include <QDate>
#include <QGuiApplication>
Expand All @@ -32,7 +31,7 @@ using namespace std::chrono_literals;
Navigation::Clock::Clock(QObject *parent) : GlobalObject(parent)
{
// We need to update the time regularly. I do not use a simple timer here that emits "timeChanged" once per minute, because I
// want the signal to be emitted right after the full minute. So, I use a timer that once a minute set a single-shot time
// want the signal to be emitted right after the full minute. So, I use a timer that once a minute sets a single-shot timer
// that is set to fire up 500ms after the full minute. This design will also work reliably if "timer" get out of sync,
// for instance because the app was sleeping for a while.
auto *timer = new QTimer(this);
Expand Down
Loading

0 comments on commit 9b7d090

Please sign in to comment.