Commit 6b50da59 authored by Jacob Dahl's avatar Jacob Dahl

updated from reviewer feedback

parent 4be6d929
...@@ -80,22 +80,6 @@ void ComplexMissionItem::_savePresetJson(const QString& name, QJsonObject& prese ...@@ -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 // 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. // as a built-in survey preset that cannot be deleted.
#if 0 #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(); QString savePath = _settingsManager->appSettings()->missionSavePath();
QDir saveDir(savePath); QDir saveDir(savePath);
...@@ -108,8 +92,17 @@ void ComplexMissionItem::_saveSettingsValueAsJson(const QSettings& settings, con ...@@ -108,8 +92,17 @@ void ComplexMissionItem::_saveSettingsValueAsJson(const QSettings& settings, con
} }
qDebug() << "Saving survey preset to JSON"; qDebug() << "Saving survey preset to JSON";
QJsonObject jsonObj = QJsonDocument::fromBinaryData(settings.value(name).toByteArray()).object();
auto jsonDoc = QJsonDocument(jsonObj); auto jsonDoc = QJsonDocument(jsonObj);
jsonFile.write(jsonDoc.toJson()); 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();
} }
...@@ -86,8 +86,6 @@ protected: ...@@ -86,8 +86,6 @@ protected:
void _savePresetJson (const QString& name, QJsonObject& presetObject); void _savePresetJson (const QString& name, QJsonObject& presetObject);
QJsonObject _loadPresetJson (const QString& name); QJsonObject _loadPresetJson (const QString& name);
void _saveSettingsValueAsJson(const QSettings& settings, const QString& name);
bool _isIncomplete = true; bool _isIncomplete = true;
QMap<QString, FactMetaData*> _metaDataMap; QMap<QString, FactMetaData*> _metaDataMap;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment