Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qt Creator 12 #486

Merged
merged 10 commits into from
Nov 23, 2023
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.10)

project(ROSProjectManager VERSION 11.0)
project(ROSProjectManager VERSION 12.0)

if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
add_link_options("-Wl,-z,relro,-z,now,-z,defs")
Expand Down
32 changes: 16 additions & 16 deletions src/project_manager/ROSProjectManager.json.in
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
\"Name\" : \"ROSProjectManager\",
\"Version\" : \"$$QTCREATOR_VERSION\",
\"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\",
\"Vendor\" : \"ROS Industrial\",
\"Copyright\" : \"(C) 2015 ROS Industrial\",
\"License\" : [ \"Commercial Usage\",
\"\",
\"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\",
\"\",
\"GNU Lesser General Public License Usage\",
\"\",
\"Alternatively, this plugin may be used under the terms of the GNU Lesser General Public License version 2.1 or version 3 as published by the Free Software Foundation. Please review the following information to ensure the GNU Lesser General Public License requirements will be met: https://www.gnu.org/licenses/lgpl.html and http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\"
"Name" : "ROSProjectManager",
"Version" : "${IDE_VERSION}",
"CompatVersion" : "${IDE_VERSION_COMPAT}",
"Vendor" : "ROS Industrial",
"Copyright" : "(C) 2015 ROS Industrial",
"License" : [ "Commercial Usage",
"",
"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.",
"",
"GNU Lesser General Public License Usage",
"",
"Alternatively, this plugin may be used under the terms of the GNU Lesser General Public License version 2.1 or version 3 as published by the Free Software Foundation. Please review the following information to ensure the GNU Lesser General Public License requirements will be met: https://www.gnu.org/licenses/lgpl.html and http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html."
],
\"Category\" : \"Build Systems\",
\"Description\" : \"ROS Support.\",
\"Url\" : \"http://www.qt.io\",
$$dependencyList
"Category" : "Build Systems",
"Description" : "ROS Support.",
"Url" : "http://www.qt.io",
${IDE_PLUGIN_DEPENDENCIES}
}
18 changes: 8 additions & 10 deletions src/project_manager/ros_build_configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
#include <coreplugin/icore.h>
#include <projectexplorer/buildinfo.h>
#include <projectexplorer/buildsteplist.h>
#include <projectexplorer/kitinformation.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/toolchain.h>
#include <utils/pathchooser.h>
Expand Down Expand Up @@ -129,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
Expand Down
4 changes: 2 additions & 2 deletions src/project_manager/ros_build_configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;

Expand Down
28 changes: 13 additions & 15 deletions src/project_manager/ros_catkin_make_step.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,11 @@
#include <extensionsystem/pluginmanager.h>
#include <projectexplorer/buildsteplist.h>
#include <projectexplorer/gnumakeparser.h>
#include <projectexplorer/kitinformation.h>
#include <projectexplorer/kitaspects.h>
#include <projectexplorer/processparameters.h>
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/toolchain.h>
#include <qtsupport/qtkitinformation.h>
#include <qtsupport/qtparser.h>
#include <utils/stringutils.h>
#include <utils/qtcassert.h>
Expand Down Expand Up @@ -141,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()
Expand Down
4 changes: 2 additions & 2 deletions src/project_manager/ros_catkin_make_step.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
42 changes: 20 additions & 22 deletions src/project_manager/ros_catkin_tools_step.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,11 @@
#include <extensionsystem/pluginmanager.h>
#include <projectexplorer/buildsteplist.h>
#include <projectexplorer/gnumakeparser.h>
#include <projectexplorer/kitinformation.h>
#include <projectexplorer/kitaspects.h>
#include <projectexplorer/processparameters.h>
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/toolchain.h>
#include <qtsupport/qtkitinformation.h>
#include <qtsupport/qtparser.h>
#include <utils/stringutils.h>
#include <utils/qtcassert.h>
Expand Down Expand Up @@ -153,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()
Expand Down Expand Up @@ -281,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());

Expand Down
4 changes: 2 additions & 2 deletions src/project_manager/ros_catkin_tools_step.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
28 changes: 13 additions & 15 deletions src/project_manager/ros_colcon_step.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,11 @@
#include <extensionsystem/pluginmanager.h>
#include <projectexplorer/buildsteplist.h>
#include <projectexplorer/gnumakeparser.h>
#include <projectexplorer/kitinformation.h>
#include <projectexplorer/kitaspects.h>
#include <projectexplorer/processparameters.h>
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/toolchain.h>
#include <qtsupport/qtkitinformation.h>
#include <qtsupport/qtparser.h>
#include <utils/stringutils.h>
#include <utils/qtcassert.h>
Expand Down Expand Up @@ -141,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()
Expand Down
4 changes: 2 additions & 2 deletions src/project_manager/ros_colcon_step.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
9 changes: 4 additions & 5 deletions src/project_manager/ros_generic_run_step.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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();
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/project_manager/ros_generic_run_step.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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<QString, QString> getAvailableTargets() { return QMap<QString, QString>(); }

Expand Down
Loading