From cf74719278fcb013a82f448791ccd2703fa58ce8 Mon Sep 17 00:00:00 2001 From: Philippe Renon Date: Sun, 10 Dec 2017 16:06:49 +0100 Subject: [PATCH] LP-565 pfd gadget: simplify insert/removeDataPath related code --- .../src/plugins/pfdqml/pfdqmlgadgetconfiguration.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/ground/gcs/src/plugins/pfdqml/pfdqmlgadgetconfiguration.cpp b/ground/gcs/src/plugins/pfdqml/pfdqmlgadgetconfiguration.cpp index f5d371d5f..4298a9b4f 100644 --- a/ground/gcs/src/plugins/pfdqml/pfdqmlgadgetconfiguration.cpp +++ b/ground/gcs/src/plugins/pfdqml/pfdqmlgadgetconfiguration.cpp @@ -68,12 +68,10 @@ PfdQmlGadgetConfiguration::PfdQmlGadgetConfiguration(QString classId, QSettings // model m_modelEnabled = settings.value("modelEnabled").toBool(); m_modelSelectionMode = static_cast(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(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);