diff --git a/src/MissionManager/ComplexMissionItem.cc b/src/MissionManager/ComplexMissionItem.cc index a53c0c27e8ded3124cf4ad7c5d8d53d8d18b1bfe..9cb0898d7ce299ffcb0ec1588f7dc50ef28dd8b2 100644 --- a/src/MissionManager/ComplexMissionItem.cc +++ b/src/MissionManager/ComplexMissionItem.cc @@ -80,22 +80,6 @@ void ComplexMissionItem::_savePresetJson(const QString& name, QJsonObject& prese // Use this to save a survey preset as a JSON file to be included in the build // as a built-in survey preset that cannot be deleted. #if 0 - _saveSettingsValueAsJson(settings, name); - #endif - - emit presetNamesChanged(); -} - -QJsonObject ComplexMissionItem::_loadPresetJson(const QString& name) -{ - QSettings settings; - settings.beginGroup(presetsSettingsGroup()); - settings.beginGroup(_presetSettingsKey); - return QJsonDocument::fromBinaryData(settings.value(name).toByteArray()).object(); -} - -void ComplexMissionItem::_saveSettingsValueAsJson(const QSettings& settings, const QString& name) -{ QString savePath = _settingsManager->appSettings()->missionSavePath(); QDir saveDir(savePath); @@ -108,8 +92,17 @@ void ComplexMissionItem::_saveSettingsValueAsJson(const QSettings& settings, con } qDebug() << "Saving survey preset to JSON"; - QJsonObject jsonObj = QJsonDocument::fromBinaryData(settings.value(name).toByteArray()).object(); auto jsonDoc = QJsonDocument(jsonObj); - jsonFile.write(jsonDoc.toJson()); + #endif + + emit presetNamesChanged(); +} + +QJsonObject ComplexMissionItem::_loadPresetJson(const QString& name) +{ + QSettings settings; + settings.beginGroup(presetsSettingsGroup()); + settings.beginGroup(_presetSettingsKey); + return QJsonDocument::fromBinaryData(settings.value(name).toByteArray()).object(); } diff --git a/src/MissionManager/ComplexMissionItem.h b/src/MissionManager/ComplexMissionItem.h index 782f80b296fe3eb70fdc9733cb0df5d11c25dd56..259d011116727bb374a9eda348954cbb6bf1e7a2 100644 --- a/src/MissionManager/ComplexMissionItem.h +++ b/src/MissionManager/ComplexMissionItem.h @@ -86,8 +86,6 @@ protected: void _savePresetJson (const QString& name, QJsonObject& presetObject); QJsonObject _loadPresetJson (const QString& name); - void _saveSettingsValueAsJson(const QSettings& settings, const QString& name); - bool _isIncomplete = true; QMap _metaDataMap;