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:
parent
01c87ce56b
commit
cf74719278
@ -68,12 +68,10 @@ PfdQmlGadgetConfiguration::PfdQmlGadgetConfiguration(QString classId, QSettings
|
||||
// model
|
||||
m_modelEnabled = settings.value("modelEnabled").toBool();
|
||||
m_modelSelectionMode = static_cast<ModelSelectionMode::Enum>(settings.value("modelSelectionMode", ModelSelectionMode::Auto).toUInt());
|
||||
m_modelFile = settings.value("modelFile", "Unknown").toString();
|
||||
m_modelFile = Utils::InsertDataPath(m_modelFile);
|
||||
m_modelFile = Utils::InsertDataPath(settings.value("modelFile", "Unknown").toString());
|
||||
|
||||
// background image
|
||||
m_backgroundImageFile = settings.value("backgroundImageFile", "Unknown").toString();
|
||||
m_backgroundImageFile = Utils::InsertDataPath(m_backgroundImageFile);
|
||||
m_backgroundImageFile = Utils::InsertDataPath(settings.value("backgroundImageFile", "Unknown").toString());
|
||||
|
||||
// gstreamer pipeline
|
||||
m_gstPipeline = settings.value("gstPipeline").toString();
|
||||
@ -153,12 +151,10 @@ void PfdQmlGadgetConfiguration::saveConfig(QSettings &settings) const
|
||||
// model
|
||||
settings.setValue("modelEnabled", m_modelEnabled);
|
||||
settings.setValue("modelSelectionMode", static_cast<uint>(m_modelSelectionMode));
|
||||
QString modelFile = Utils::RemoveDataPath(m_modelFile);
|
||||
settings.setValue("modelFile", modelFile);
|
||||
settings.setValue("modelFile", Utils::RemoveDataPath(m_modelFile));
|
||||
|
||||
// background image
|
||||
QString backgroundImageFile = Utils::RemoveDataPath(m_backgroundImageFile);
|
||||
settings.setValue("backgroundImageFile", backgroundImageFile);
|
||||
settings.setValue("backgroundImageFile", Utils::RemoveDataPath(m_backgroundImageFile));
|
||||
|
||||
// gstreamer pipeline
|
||||
settings.setValue("gstPipeline", m_gstPipeline);
|
||||
|
Loading…
Reference in New Issue
Block a user