1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-06-07 08:24:43 -04:00

Make rollup state a serializable object so that it can be dumped in JSON format for the API. Prerequisite tp #1050

This commit is contained in:
f4exb
2022-01-09 05:27:12 +01:00
parent e2fc5aa87c
commit 98b305f320
599 changed files with 6183 additions and 640 deletions
+14 -4
View File
@@ -47,7 +47,8 @@ const QStringList MapSettings::m_mapProviders = {
QStringLiteral("mapboxgl")
};
MapSettings::MapSettings()
MapSettings::MapSettings() :
m_rollupState(nullptr)
{
resetToDefaults();
}
@@ -97,7 +98,11 @@ QByteArray MapSettings::serialize() const
s.writeBool(16, m_displayAllGroundTracks);
s.writeString(17, m_thunderforestAPIKey);
s.writeString(18, m_maptilerAPIKey);
s.writeBlob(19, m_rollupState);
if (m_rollupState) {
s.writeBlob(19, m_rollupState->serialize());
}
s.writeString(20, m_osmURL);
return s.final();
@@ -144,10 +149,15 @@ bool MapSettings::deserialize(const QByteArray& data)
m_reverseAPIFeatureIndex = utmp > 99 ? 99 : utmp;
d.readBool(15, &m_displaySelectedGroundTracks, true);
d.readBool(16, &m_displayAllGroundTracks, true);
d.readString(17, &m_thunderforestAPIKey, "");
d.readString(18, &m_maptilerAPIKey, "");
d.readBlob(19, &m_rollupState);
if (m_rollupState)
{
d.readBlob(19, &bytetmp);
m_rollupState->deserialize(bytetmp);
}
d.readString(20, &m_osmURL, "");
return true;