From 58a22a7e8a2d0438b89baa30ed61317f9c6c283e Mon Sep 17 00:00:00 2001 From: Christian Rauch Date: Sat, 14 Oct 2023 16:56:35 +0200 Subject: [PATCH] replace QVariantMap by Utils::Store in to/from mappings --- .../ros_build_configuration.cpp | 17 ++++---- src/project_manager/ros_build_configuration.h | 4 +- src/project_manager/ros_catkin_make_step.cpp | 25 ++++++----- src/project_manager/ros_catkin_make_step.h | 4 +- src/project_manager/ros_catkin_tools_step.cpp | 39 ++++++++--------- src/project_manager/ros_catkin_tools_step.h | 4 +- src/project_manager/ros_colcon_step.cpp | 25 ++++++----- src/project_manager/ros_colcon_step.h | 4 +- src/project_manager/ros_generic_run_step.cpp | 9 ++-- src/project_manager/ros_generic_run_step.h | 4 +- src/project_manager/ros_project.cpp | 2 +- src/project_manager/ros_project.h | 2 +- src/project_manager/ros_run_step.cpp | 43 +++++++++---------- src/project_manager/ros_run_step.h | 10 ++--- src/project_manager/ros_settings_page.cpp | 4 +- 15 files changed, 94 insertions(+), 102 deletions(-) diff --git a/src/project_manager/ros_build_configuration.cpp b/src/project_manager/ros_build_configuration.cpp index 4b01fb10..625cb60b 100644 --- a/src/project_manager/ros_build_configuration.cpp +++ b/src/project_manager/ros_build_configuration.cpp @@ -128,20 +128,19 @@ void ROSBuildConfiguration::initialize(const ProjectExplorer::BuildInfo &info) } } -QVariantMap ROSBuildConfiguration::toMap() const +void ROSBuildConfiguration::toMap(Utils::Store &map) const { - QVariantMap map(BuildConfiguration::toMap()); + BuildConfiguration::toMap(map); - map.insert(QLatin1String(ROS_BC_BUILD_SYSTEM), (int)m_buildSystem); - map.insert(QLatin1String(ROS_BC_CMAKE_BUILD_TYPE), (int)m_cmakeBuildType); - return map; + map.insert(ROS_BC_BUILD_SYSTEM, (int)m_buildSystem); + map.insert(ROS_BC_CMAKE_BUILD_TYPE, (int)m_cmakeBuildType); } -bool ROSBuildConfiguration::fromMap(const QVariantMap &map) +void ROSBuildConfiguration::fromMap(const Utils::Store &map) { - m_buildSystem = (ROSUtils::BuildSystem)map.value(QLatin1String(ROS_BC_BUILD_SYSTEM)).toInt(); - m_cmakeBuildType = (ROSUtils::BuildType)map.value(QLatin1String(ROS_BC_CMAKE_BUILD_TYPE)).toInt(); - return BuildConfiguration::fromMap(map); + m_buildSystem = (ROSUtils::BuildSystem)map.value(ROS_BC_BUILD_SYSTEM).toInt(); + m_cmakeBuildType = (ROSUtils::BuildType)map.value(ROS_BC_CMAKE_BUILD_TYPE).toInt(); + BuildConfiguration::fromMap(map); } ROSUtils::BuildSystem ROSBuildConfiguration::rosBuildSystem() const diff --git a/src/project_manager/ros_build_configuration.h b/src/project_manager/ros_build_configuration.h index 69d1eecc..8c2a95a4 100644 --- a/src/project_manager/ros_build_configuration.h +++ b/src/project_manager/ros_build_configuration.h @@ -68,7 +68,7 @@ class ROSBuildConfiguration : public ProjectExplorer::BuildConfiguration BuildType buildType() const override; - QVariantMap toMap() const override; + void toMap(Utils::Store &map) const override; ROSUtils::BuildSystem rosBuildSystem() const; void setBuildSystem(const ROSUtils::BuildSystem &buildSystem); @@ -87,7 +87,7 @@ class ROSBuildConfiguration : public ProjectExplorer::BuildConfiguration void cmakeBuildTypeChanged(const ROSUtils::BuildType &buildType); protected: - bool fromMap(const QVariantMap &map) override; + void fromMap(const Utils::Store &map) override; friend class ROSBuildSettingsWidget; diff --git a/src/project_manager/ros_catkin_make_step.cpp b/src/project_manager/ros_catkin_make_step.cpp index fd913694..04004fa6 100644 --- a/src/project_manager/ros_catkin_make_step.cpp +++ b/src/project_manager/ros_catkin_make_step.cpp @@ -140,25 +140,24 @@ void ROSCatkinMakeStep::setupOutputFormatter(Utils::OutputFormatter *formatter) AbstractProcessStep::setupOutputFormatter(formatter); } -QVariantMap ROSCatkinMakeStep::toMap() const +void ROSCatkinMakeStep::toMap(Utils::Store &map) const { - QVariantMap map(AbstractProcessStep::toMap()); + AbstractProcessStep::toMap(map); - map.insert(QLatin1String(ROS_CMS_TARGET_KEY), m_target); - map.insert(QLatin1String(ROS_CMS_CATKIN_MAKE_ARGUMENTS_KEY), m_catkinMakeArguments); - map.insert(QLatin1String(ROS_CMS_CMAKE_ARGUMENTS_KEY), m_cmakeArguments); - map.insert(QLatin1String(ROS_CMS_MAKE_ARGUMENTS_KEY), m_makeArguments); - return map; + map.insert(ROS_CMS_TARGET_KEY, m_target); + map.insert(ROS_CMS_CATKIN_MAKE_ARGUMENTS_KEY, m_catkinMakeArguments); + map.insert(ROS_CMS_CMAKE_ARGUMENTS_KEY, m_cmakeArguments); + map.insert(ROS_CMS_MAKE_ARGUMENTS_KEY, m_makeArguments); } -bool ROSCatkinMakeStep::fromMap(const QVariantMap &map) +void ROSCatkinMakeStep::fromMap(const Utils::Store &map) { - m_target = (BuildTargets)map.value(QLatin1String(ROS_CMS_TARGET_KEY)).toInt(); - m_catkinMakeArguments = map.value(QLatin1String(ROS_CMS_CATKIN_MAKE_ARGUMENTS_KEY)).toString(); - m_cmakeArguments = map.value(QLatin1String(ROS_CMS_CMAKE_ARGUMENTS_KEY)).toString(); - m_makeArguments = map.value(QLatin1String(ROS_CMS_MAKE_ARGUMENTS_KEY)).toString(); + m_target = (BuildTargets)map.value(ROS_CMS_TARGET_KEY).toInt(); + m_catkinMakeArguments = map.value(ROS_CMS_CATKIN_MAKE_ARGUMENTS_KEY).toString(); + m_cmakeArguments = map.value(ROS_CMS_CMAKE_ARGUMENTS_KEY).toString(); + m_makeArguments = map.value(ROS_CMS_MAKE_ARGUMENTS_KEY).toString(); - return BuildStep::fromMap(map); + BuildStep::fromMap(map); } QWidget *ROSCatkinMakeStep::createConfigWidget() diff --git a/src/project_manager/ros_catkin_make_step.h b/src/project_manager/ros_catkin_make_step.h index 0eb749a1..1b1fce9c 100644 --- a/src/project_manager/ros_catkin_make_step.h +++ b/src/project_manager/ros_catkin_make_step.h @@ -59,11 +59,11 @@ class ROSCatkinMakeStep : public ProjectExplorer::AbstractProcessStep QString allArguments(ROSUtils::BuildType buildType, bool includeDefault = true) const; Utils::CommandLine makeCommand(const QString &args) const; - QVariantMap toMap() const override; + void toMap(Utils::Store &map) const override; protected: QStringList automaticallyAddedArguments() const; - bool fromMap(const QVariantMap &map) override; + void fromMap(const Utils::Store &map) override; QWidget *createConfigWidget() override; private: diff --git a/src/project_manager/ros_catkin_tools_step.cpp b/src/project_manager/ros_catkin_tools_step.cpp index e5581720..9a63d128 100644 --- a/src/project_manager/ros_catkin_tools_step.cpp +++ b/src/project_manager/ros_catkin_tools_step.cpp @@ -152,34 +152,33 @@ void ROSCatkinToolsStep::setupOutputFormatter(Utils::OutputFormatter *formatter) AbstractProcessStep::setupOutputFormatter(formatter); } -QVariantMap ROSCatkinToolsStep::toMap() const +void ROSCatkinToolsStep::toMap(Utils::Store &map) const { - QVariantMap map(AbstractProcessStep::toMap()); + AbstractProcessStep::toMap(map); - map.insert(QLatin1String(ROS_CTS_TARGET_KEY), m_target); - map.insert(QLatin1String(ROS_CTS_ACTIVE_PROFILE_KEY), m_activeProfile); - map.insert(QLatin1String(ROS_CTS_CATKIN_TOOLS_ARGUMENTS_KEY), m_catkinToolsArguments); - map.insert(QLatin1String(ROS_CTS_CATKIN_MAKE_ARGUMENTS_KEY), m_catkinMakeArguments); - map.insert(QLatin1String(ROS_CTS_CMAKE_ARGUMENTS_KEY), m_cmakeArguments); - map.insert(QLatin1String(ROS_CTS_MAKE_ARGUMENTS_KEY), m_makeArguments); - map.insert(QLatin1String(ROS_CTS_CATKIN_TOOLS_WORKING_DIR_KEY), m_catkinToolsWorkingDir); - return map; + map.insert(ROS_CTS_TARGET_KEY, m_target); + map.insert(ROS_CTS_ACTIVE_PROFILE_KEY, m_activeProfile); + map.insert(ROS_CTS_CATKIN_TOOLS_ARGUMENTS_KEY, m_catkinToolsArguments); + map.insert(ROS_CTS_CATKIN_MAKE_ARGUMENTS_KEY, m_catkinMakeArguments); + map.insert(ROS_CTS_CMAKE_ARGUMENTS_KEY, m_cmakeArguments); + map.insert(ROS_CTS_MAKE_ARGUMENTS_KEY, m_makeArguments); + map.insert(ROS_CTS_CATKIN_TOOLS_WORKING_DIR_KEY, m_catkinToolsWorkingDir); } -bool ROSCatkinToolsStep::fromMap(const QVariantMap &map) +void ROSCatkinToolsStep::fromMap(const Utils::Store &map) { - m_target = (BuildTargets)map.value(QLatin1String(ROS_CTS_TARGET_KEY)).toInt(); - m_activeProfile = map.value(QLatin1String(ROS_CTS_ACTIVE_PROFILE_KEY)).toString(); - m_catkinToolsArguments = map.value(QLatin1String(ROS_CTS_CATKIN_TOOLS_ARGUMENTS_KEY)).toString(); - m_catkinMakeArguments = map.value(QLatin1String(ROS_CTS_CATKIN_MAKE_ARGUMENTS_KEY)).toString(); - m_cmakeArguments = map.value(QLatin1String(ROS_CTS_CMAKE_ARGUMENTS_KEY)).toString(); - m_makeArguments = map.value(QLatin1String(ROS_CTS_MAKE_ARGUMENTS_KEY)).toString(); - m_catkinToolsWorkingDir = map.value(QLatin1String(ROS_CTS_CATKIN_TOOLS_WORKING_DIR_KEY)).toString(); + m_target = (BuildTargets)map.value(ROS_CTS_TARGET_KEY).toInt(); + m_activeProfile = map.value(ROS_CTS_ACTIVE_PROFILE_KEY).toString(); + m_catkinToolsArguments = map.value(ROS_CTS_CATKIN_TOOLS_ARGUMENTS_KEY).toString(); + m_catkinMakeArguments = map.value(ROS_CTS_CATKIN_MAKE_ARGUMENTS_KEY).toString(); + m_cmakeArguments = map.value(ROS_CTS_CMAKE_ARGUMENTS_KEY).toString(); + m_makeArguments = map.value(ROS_CTS_MAKE_ARGUMENTS_KEY).toString(); + m_catkinToolsWorkingDir = map.value(ROS_CTS_CATKIN_TOOLS_WORKING_DIR_KEY).toString(); if (m_catkinToolsWorkingDir.isEmpty()) m_catkinToolsWorkingDir = Constants::ROS_DEFAULT_WORKING_DIR; - return BuildStep::fromMap(map); + BuildStep::fromMap(map); } QWidget *ROSCatkinToolsStep::createConfigWidget() @@ -280,7 +279,7 @@ ROSCatkinToolsStepWidget::ROSCatkinToolsStepWidget(ROSCatkinToolsStep *makeStep) m_ui->makeArgumentsLineEdit->setText(m_makeStep->m_makeArguments); m_ui->catkinToolsWorkingDirWidget->setPath(m_makeStep->m_catkinToolsWorkingDir); - m_ui->catkinToolsWorkingDirWidget->setHistoryCompleter(QLatin1String("Qt.WorkingDir.History")); + m_ui->catkinToolsWorkingDirWidget->setHistoryCompleter("Qt.WorkingDir.History"); m_ui->catkinToolsWorkingDirWidget->setExpectedKind(Utils::PathChooser::Directory); m_ui->catkinToolsWorkingDirWidget->setFilePath(makeStep->rosBuildConfiguration()->project()->projectDirectory()); diff --git a/src/project_manager/ros_catkin_tools_step.h b/src/project_manager/ros_catkin_tools_step.h index 844414fe..4ead08aa 100644 --- a/src/project_manager/ros_catkin_tools_step.h +++ b/src/project_manager/ros_catkin_tools_step.h @@ -71,11 +71,11 @@ class ROSCatkinToolsStep : public ProjectExplorer::AbstractProcessStep QString allArguments(ROSUtils::BuildType buildType, bool includeDefault = true) const; Utils::CommandLine makeCommand(const QString &args) const; - QVariantMap toMap() const override; + void toMap(Utils::Store &map) const override; protected: QStringList automaticallyAddedArguments() const; - bool fromMap(const QVariantMap &map) override; + void fromMap(const Utils::Store &map) override; QWidget *createConfigWidget() override; private: diff --git a/src/project_manager/ros_colcon_step.cpp b/src/project_manager/ros_colcon_step.cpp index a2666514..caf797ce 100644 --- a/src/project_manager/ros_colcon_step.cpp +++ b/src/project_manager/ros_colcon_step.cpp @@ -140,25 +140,24 @@ void ROSColconStep::setupOutputFormatter(Utils::OutputFormatter *formatter) AbstractProcessStep::setupOutputFormatter(formatter); } -QVariantMap ROSColconStep::toMap() const +void ROSColconStep::toMap(Utils::Store &map) const { - QVariantMap map(AbstractProcessStep::toMap()); + AbstractProcessStep::toMap(map); - map.insert(QLatin1String(ROS_COLCON_STEP), m_target); - map.insert(QLatin1String(ROS_COLCON_STEP_ARGUMENTS_KEY), m_colconArguments); - map.insert(QLatin1String(ROS_COLCON_STEP_CMAKE_ARGUMENTS_KEY), m_cmakeArguments); - map.insert(QLatin1String(ROS_COLCON_STEP_MAKE_ARGUMENTS_KEY), m_makeArguments); - return map; + map.insert(ROS_COLCON_STEP, m_target); + map.insert(ROS_COLCON_STEP_ARGUMENTS_KEY, m_colconArguments); + map.insert(ROS_COLCON_STEP_CMAKE_ARGUMENTS_KEY, m_cmakeArguments); + map.insert(ROS_COLCON_STEP_MAKE_ARGUMENTS_KEY, m_makeArguments); } -bool ROSColconStep::fromMap(const QVariantMap &map) +void ROSColconStep::fromMap(const Utils::Store &map) { - m_target = (BuildTargets)map.value(QLatin1String(ROS_COLCON_STEP)).toInt(); - m_colconArguments = map.value(QLatin1String(ROS_COLCON_STEP_ARGUMENTS_KEY)).toString(); - m_cmakeArguments = map.value(QLatin1String(ROS_COLCON_STEP_CMAKE_ARGUMENTS_KEY)).toString(); - m_makeArguments = map.value(QLatin1String(ROS_COLCON_STEP_MAKE_ARGUMENTS_KEY)).toString(); + m_target = (BuildTargets)map.value(ROS_COLCON_STEP).toInt(); + m_colconArguments = map.value(ROS_COLCON_STEP_ARGUMENTS_KEY).toString(); + m_cmakeArguments = map.value(ROS_COLCON_STEP_CMAKE_ARGUMENTS_KEY).toString(); + m_makeArguments = map.value(ROS_COLCON_STEP_MAKE_ARGUMENTS_KEY).toString(); - return BuildStep::fromMap(map); + BuildStep::fromMap(map); } QWidget *ROSColconStep::createConfigWidget() diff --git a/src/project_manager/ros_colcon_step.h b/src/project_manager/ros_colcon_step.h index 5478a81b..cc02c336 100644 --- a/src/project_manager/ros_colcon_step.h +++ b/src/project_manager/ros_colcon_step.h @@ -60,11 +60,11 @@ class ROSColconStep : public ProjectExplorer::AbstractProcessStep QString allArguments(ROSUtils::BuildType buildType, bool includeDefault = true) const; Utils::CommandLine makeCommand(const QString &args) const; - QVariantMap toMap() const override; + void toMap(Utils::Store &map) const override; protected: QStringList automaticallyAddedArguments() const; - bool fromMap(const QVariantMap &map) override; + void fromMap(const Utils::Store &map) override; QWidget *createConfigWidget() override; private: diff --git a/src/project_manager/ros_generic_run_step.cpp b/src/project_manager/ros_generic_run_step.cpp index 66161660..e56810e4 100644 --- a/src/project_manager/ros_generic_run_step.cpp +++ b/src/project_manager/ros_generic_run_step.cpp @@ -128,9 +128,9 @@ void ROSGenericRunStep::run() #endif } -QVariantMap ROSGenericRunStep::toMap() const +void ROSGenericRunStep::toMap(Utils::Store &map) const { - QVariantMap map(RunStep::toMap()); + RunStep::toMap(map); map.insert(ROS_GENERIC_COMMAND_KEY, m_command); map.insert(ROS_GENERIC_PACKAGE_KEY, m_package); @@ -139,10 +139,9 @@ QVariantMap ROSGenericRunStep::toMap() const map.insert(ROS_GENERIC_TARGET_PATH_KEY, m_targetPath); map.insert(ROS_GENERIC_ARGUMENTS_KEY, m_arguments); map.insert(ROS_GENERIC_DEBUG_CONTINUE_ON_ATTACH_KEY, m_debugContinueOnAttach); - return map; } -bool ROSGenericRunStep::fromMap(const QVariantMap &map) +void ROSGenericRunStep::fromMap(const Utils::Store &map) { m_command = map.value(ROS_GENERIC_COMMAND_KEY).toString(); m_package = map.value(ROS_GENERIC_PACKAGE_KEY).toString(); @@ -152,7 +151,7 @@ bool ROSGenericRunStep::fromMap(const QVariantMap &map) m_arguments = map.value(ROS_GENERIC_ARGUMENTS_KEY).toString(); m_debugContinueOnAttach = map.value(ROS_GENERIC_DEBUG_CONTINUE_ON_ATTACH_KEY).toBool(); - return RunStep::fromMap(map); + RunStep::fromMap(map); } ROSRunConfiguration *ROSGenericRunStep::rosRunConfiguration() const diff --git a/src/project_manager/ros_generic_run_step.h b/src/project_manager/ros_generic_run_step.h index f3911d73..6c6cfadc 100644 --- a/src/project_manager/ros_generic_run_step.h +++ b/src/project_manager/ros_generic_run_step.h @@ -45,7 +45,7 @@ class ROSGenericRunStep : public RunStep RunStepConfigWidget *createConfigWidget() override; - QVariantMap toMap() const override; + void toMap(Utils::Store &map) const override; ROSRunConfiguration *rosRunConfiguration() const; ROSRunConfiguration *targetsActiveRunConfiguration() const; @@ -67,7 +67,7 @@ class ROSGenericRunStep : public RunStep virtual void setDebugContinueOnAttach(const bool &contOnAttach); protected: - bool fromMap(const QVariantMap &map) override; + void fromMap(const Utils::Store &map) override; virtual QMap getAvailableTargets() { return QMap(); } diff --git a/src/project_manager/ros_project.cpp b/src/project_manager/ros_project.cpp index e6060bd9..f26f2cc0 100644 --- a/src/project_manager/ros_project.cpp +++ b/src/project_manager/ros_project.cpp @@ -562,7 +562,7 @@ void ROSProject::updateCppCodeModel() } -Project::RestoreResult ROSProject::fromMap(const QVariantMap &map, QString *errorMessage) +Project::RestoreResult ROSProject::fromMap(const Utils::Store &map, QString *errorMessage) { RestoreResult result = Project::fromMap(map, errorMessage); if (result != RestoreResult::Ok) diff --git a/src/project_manager/ros_project.h b/src/project_manager/ros_project.h index af72df8e..84bacd27 100644 --- a/src/project_manager/ros_project.h +++ b/src/project_manager/ros_project.h @@ -76,7 +76,7 @@ private slots: void updateCppCodeModel(); protected: - Project::RestoreResult fromMap(const QVariantMap &map, QString *errorMessage) override; + Project::RestoreResult fromMap(const Utils::Store &map, QString *errorMessage) override; private: void asyncUpdate(); diff --git a/src/project_manager/ros_run_step.cpp b/src/project_manager/ros_run_step.cpp index 9f2126b6..146990e2 100644 --- a/src/project_manager/ros_run_step.cpp +++ b/src/project_manager/ros_run_step.cpp @@ -147,16 +147,12 @@ RunStep *RunStepFactory::create(RunStepList *parent, Utils::Id id) return rs; } -RunStep *RunStepFactory::restore(RunStepList *parent, const QVariantMap &map) +RunStep *RunStepFactory::restore(RunStepList *parent, const Utils::Store &map) { RunStep *rs = m_info.creator(parent); if (!rs) return nullptr; - if (!rs->fromMap(map)) { - QTC_CHECK(false); - delete rs; - return nullptr; - } + rs->fromMap(map); return rs; } @@ -172,17 +168,16 @@ RunStep::RunStep(RunStepList *rsl, Utils::Id id) : // } -bool RunStep::fromMap(const QVariantMap &map) +void RunStep::fromMap(const Utils::Store &map) { m_enabled = map.value(runStepEnabledKey, true).toBool(); - return ProjectConfiguration::fromMap(map); + ProjectConfiguration::fromMap(map); } -QVariantMap RunStep::toMap() const +void RunStep::toMap(Utils::Store &map) const { - QVariantMap map = ProjectConfiguration::toMap(); + ProjectConfiguration::toMap(map); map.insert(runStepEnabledKey, m_enabled); - return map; } ProjectExplorer::RunConfiguration *RunStep::runConfiguration() const @@ -268,15 +263,18 @@ void RunStepList::clear() m_steps.clear(); } -QVariantMap RunStepList::toMap() const +void RunStepList::toMap(Utils::Store &map) const { - QVariantMap map(ProjectConfiguration::toMap()); + ProjectConfiguration::toMap(map); // Save run steps - map.insert(QString::fromLatin1(STEPS_COUNT_KEY), m_steps.count()); - for (int i = 0; i < m_steps.count(); ++i) - map.insert(QString::fromLatin1(STEPS_PREFIX) + QString::number(i), m_steps.at(i)->toMap()); + map.insert(STEPS_COUNT_KEY, m_steps.count()); + for (int i = 0; i < m_steps.count(); ++i) { + const Utils::Key key_step = (QString(STEPS_PREFIX) + QString::number(i)).toUtf8(); + Utils::Store map_step; + m_steps.at(i)->toMap(map_step); + map.insert(key_step, Utils::variantFromStore(map_step)); + } - return map; } int RunStepList::count() const @@ -305,18 +303,18 @@ bool RunStepList::enabled() const return false; } -bool RunStepList::fromMap(const QVariantMap &map) +void RunStepList::fromMap(const Utils::Store &map) { clear(); // We need the ID set before trying to restore the steps! - if (!ProjectConfiguration::fromMap(map)) - return false; + ProjectConfiguration::fromMap(map); const QList factories = RunStepFactory::allRunStepFactories(); - int maxSteps = map.value(QString::fromLatin1(STEPS_COUNT_KEY), 0).toInt(); + int maxSteps = map.value(STEPS_COUNT_KEY, 0).toInt(); for (int i = 0; i < maxSteps; ++i) { - QVariantMap rsData(map.value(QString::fromLatin1(STEPS_PREFIX) + QString::number(i)).toMap()); + const Utils::Key key_step = (QString(STEPS_PREFIX) + QString::number(i)).toUtf8(); + Utils::Store rsData = Utils::storeFromVariant(map.value(key_step).toMap()); if (rsData.isEmpty()) { Core::MessageManager::writeSilently(tr("[ROS Warning] No step data found for step %1 (continuing).").arg(i)); continue; @@ -337,7 +335,6 @@ bool RunStepList::fromMap(const QVariantMap &map) } QTC_ASSERT(handled, qDebug() << "No factory for run step" << stepId.toString() << "found."); } - return true; } void RunStepList::runStep_enabledChanged(RunStep *step) diff --git a/src/project_manager/ros_run_step.h b/src/project_manager/ros_run_step.h index 1c558a95..ea1bc10a 100644 --- a/src/project_manager/ros_run_step.h +++ b/src/project_manager/ros_run_step.h @@ -56,8 +56,8 @@ class RunStep : public ProjectExplorer::ProjectConfiguration virtual bool runInGuiThread() const; virtual void cancel(); - bool fromMap(const QVariantMap &map) override; - QVariantMap toMap() const override; + void fromMap(const Utils::Store &map) override; + void toMap(Utils::Store &map) const override; bool enabled() const; void setEnabled(bool b); @@ -102,7 +102,7 @@ class RunStepFactory RunStepInfo stepInfo() const; Utils::Id stepId() const; RunStep *create(RunStepList *parent, Utils::Id id); - RunStep *restore(RunStepList *parent, const QVariantMap &map); + RunStep *restore(RunStepList *parent, const Utils::Store &map); bool canHandle(RunStepList *rsl) const; @@ -182,8 +182,8 @@ class RunStepList : public ProjectExplorer::ProjectConfiguration ProjectExplorer::Target *target() const; - virtual QVariantMap toMap() const override; - bool fromMap(const QVariantMap &map) override; + virtual void toMap(Utils::Store &map) const override; + void fromMap(const Utils::Store &map) override; signals: void stepInserted(int position); diff --git a/src/project_manager/ros_settings_page.cpp b/src/project_manager/ros_settings_page.cpp index 3f6f2d85..4fc9a197 100644 --- a/src/project_manager/ros_settings_page.cpp +++ b/src/project_manager/ros_settings_page.cpp @@ -65,7 +65,7 @@ ROSSettings::ROSSettings() void ROSSettings::toSettings(Utils::QtcSettings *s) const { - s->beginGroup(QLatin1String(Constants::ROS_SETTINGS_GROUP_ID)); + s->beginGroup(Constants::ROS_SETTINGS_GROUP_ID); s->setValue(DEFAULT_DISTRIBUTION_ID, default_distribution); s->setValue(DEFAULT_BUILD_SYSTEM_ID, static_cast(default_build_system)); s->setValue(DEFAULT_CODE_STYLE_ID, default_code_style); @@ -82,7 +82,7 @@ void ROSSettings::toSettings(Utils::QtcSettings *s) const void ROSSettings::fromSettings(Utils::QtcSettings *s) { - s->beginGroup(QLatin1String(Constants::ROS_SETTINGS_GROUP_ID)); + s->beginGroup(Constants::ROS_SETTINGS_GROUP_ID); default_distribution = s->value(DEFAULT_DISTRIBUTION_ID, "").toString();