23#include <QJsonDocument>
25#include <QStandardPaths>
27#include "GlobalObject.h"
28#include "dataManagement/Downloadable_MultiFile.h"
29#include "dataManagement/Downloadable_SingleFile.h"
30#include "units/ByteSize.h"
33namespace DataManagement {
194 [[nodiscard]] QString
whatsNew()
const {
return m_whatsNew; }
222 Q_INVOKABLE QString
import(
const QString& fileName,
const QString& newName);
239 Q_INVOKABLE QString
importOpenAir(
const QString& fileName,
const QString& newName);
255 Q_INVOKABLE QString
importCub(
const QString& fileName,
const QString& newName);
287 QString saveAirspaceJson(
const QJsonDocument& json,
const QStringList& errors,
const QString& newName);
296 void cleanDataDirectory();
301 void onItemFileChanged();
306 void updateDataItemListAndWhatsNew();
316 bool m_appUpdateRequired {
false};
319 QString m_dataDirectory {QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) +
"/aviation_maps"};
326 DataManagement::Downloadable_SingleFile m_mapList { QUrl(QStringLiteral(
"https://enroute-data.akaflieg-freiburg.de/enroute-GeoJSONv003/maps.json")), QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) +
"/maps.json" };
Manages the list of geographic maps.
Units::ByteSize whatsNewHash
Hash of the current "what's new" message.
DataManagement::Downloadable_MultiFile * baseMaps
Downloadable_MultiFile that holds all base maps.
void deferredInitialization() override
Non-constructor initialization.
DataManagement::Downloadable_MultiFile * terrainMaps
Downloadable_MultiFile that holds all terrain maps.
bool appUpdateRequired
Indiates that the app needs to be updated.
DataManagement::Downloadable_MultiFile * aviationMaps
Downloadable_MultiFile that holds all aviation maps.
DataManagement::Downloadable_MultiFile * vacCollections
Downloadable_MultiFile that holds all VAC collections.
DataManagement::Downloadable_MultiFile * databases
Downloadable_MultiFile that holds all databases.
Q_INVOKABLE QString importOpenAir(const QString &fileName, const QString &newName)
Import airspace data into the library of locally installed maps.
DataManagement::Downloadable_MultiFile * items
Downloadable_MultiFile that holds all data items.
DataManagement::Downloadable_MultiFile * baseMapsRaster
Downloadable_MultiFile that holds all base maps in raster format.
Q_INVOKABLE QString importCub(const QString &fileName, const QString &newName)
Import airspace data into the library of locally installed maps.
DataManagement::Downloadable_MultiFile * baseMapsVector
Downloadable_MultiFile that holds all base maps in vector format.
void whatsNewChanged()
Notifier signal.
DataManagement::Downloadable_MultiFile * mapsAndData
Downloadable_MultiFile that holds all the map sets and databases.
DataManager(QObject *parent=nullptr)
Standard constructor.
DataManagement::Downloadable_SingleFile * mapList
Downloadable_SingleFile that holds the list of all maps and databases.
DataManagement::Downloadable_MultiFile * mapSets
Downloadable_MultiFile that holds all map sets.
void error(const QString &message)
Error message for user.
void updateRemoteDataItemListIfOutdated()
Triggers an update of the list of remotely available data items.
QString whatsNew
Current "what's new" message.
void appUpdateRequiredChanged()
Group of closely related downloadable items.
@ SingleUpdate
Update children that are updatable.
static Q_INVOKABLE DataManagement::DataManager * dataManager()
Pointer to appplication-wide static GeoMaps::DataManager instance.
GlobalObject(QObject *parent=nullptr)
Standard constructor.
Convenience class for size_t.