1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-11-29 07:24:13 +01:00

LP-565 pfd gadget: simplify insert/removeDataPath related code

This commit is contained in:
Philippe Renon 2017-12-10 16:06:49 +01:00
parent 01c87ce56b
commit cf74719278

View File

@ -68,12 +68,10 @@ PfdQmlGadgetConfiguration::PfdQmlGadgetConfiguration(QString classId, QSettings
// model // model
m_modelEnabled = settings.value("modelEnabled").toBool(); m_modelEnabled = settings.value("modelEnabled").toBool();
m_modelSelectionMode = static_cast<ModelSelectionMode::Enum>(settings.value("modelSelectionMode", ModelSelectionMode::Auto).toUInt()); m_modelSelectionMode = static_cast<ModelSelectionMode::Enum>(settings.value("modelSelectionMode", ModelSelectionMode::Auto).toUInt());
m_modelFile = settings.value("modelFile", "Unknown").toString(); m_modelFile = Utils::InsertDataPath(settings.value("modelFile", "Unknown").toString());
m_modelFile = Utils::InsertDataPath(m_modelFile);
// background image // background image
m_backgroundImageFile = settings.value("backgroundImageFile", "Unknown").toString(); m_backgroundImageFile = Utils::InsertDataPath(settings.value("backgroundImageFile", "Unknown").toString());
m_backgroundImageFile = Utils::InsertDataPath(m_backgroundImageFile);
// gstreamer pipeline // gstreamer pipeline
m_gstPipeline = settings.value("gstPipeline").toString(); m_gstPipeline = settings.value("gstPipeline").toString();
@ -153,12 +151,10 @@ void PfdQmlGadgetConfiguration::saveConfig(QSettings &settings) const
// model // model
settings.setValue("modelEnabled", m_modelEnabled); settings.setValue("modelEnabled", m_modelEnabled);
settings.setValue("modelSelectionMode", static_cast<uint>(m_modelSelectionMode)); settings.setValue("modelSelectionMode", static_cast<uint>(m_modelSelectionMode));
QString modelFile = Utils::RemoveDataPath(m_modelFile); settings.setValue("modelFile", Utils::RemoveDataPath(m_modelFile));
settings.setValue("modelFile", modelFile);
// background image // background image
QString backgroundImageFile = Utils::RemoveDataPath(m_backgroundImageFile); settings.setValue("backgroundImageFile", Utils::RemoveDataPath(m_backgroundImageFile));
settings.setValue("backgroundImageFile", backgroundImageFile);
// gstreamer pipeline // gstreamer pipeline
settings.setValue("gstPipeline", m_gstPipeline); settings.setValue("gstPipeline", m_gstPipeline);