diff --git a/src/project_manager/ros_build_configuration.cpp b/src/project_manager/ros_build_configuration.cpp index 7a980847..9d609d50 100644 --- a/src/project_manager/ros_build_configuration.cpp +++ b/src/project_manager/ros_build_configuration.cpp @@ -69,24 +69,21 @@ ROSBuildConfiguration::ROSBuildConfiguration(Target *parent, Core::Id id) { } -void ROSBuildConfiguration::initialize(const ProjectExplorer::BuildInfo &info) +void ROSBuildConfiguration::initialize() { - BuildConfiguration::initialize(info); + BuildConfiguration::initialize(); - auto extraInfo = info.extraInfo.value(); + const ROSExtraBuildInfo extra_info = extraInfo().value(); - setDisplayName(info.displayName); - setDefaultDisplayName(info.displayName); - setBuildDirectory(info.buildDirectory); - setBuildSystem(extraInfo.buildSystem); - setCMakeBuildType(extraInfo.cmakeBuildType); + setBuildSystem(extra_info.buildSystem); + setCMakeBuildType(extra_info.cmakeBuildType); BuildStepList *buildSteps = stepList(ProjectExplorer::Constants::BUILDSTEPS_BUILD); BuildStepList *cleanSteps = stepList(ProjectExplorer::Constants::BUILDSTEPS_CLEAN); Q_ASSERT(buildSteps); Q_ASSERT(cleanSteps); - switch (extraInfo.buildSystem) + switch (extra_info.buildSystem) { case ROSUtils::CatkinMake: { @@ -169,7 +166,7 @@ ROSProject *ROSBuildConfiguration::project() void ROSBuildConfiguration::updateQtEnvironment(const Utils::Environment &env) { - QList diff = baseEnvironment().diff(env); + const Utils::NameValueItems diff = baseEnvironment().diff(env); if (!diff.isEmpty()) setUserEnvironmentChanges(diff); } @@ -201,29 +198,17 @@ ROSBuildConfigurationFactory::~ROSBuildConfigurationFactory() { } -QList ROSBuildConfigurationFactory::availableBuilds(const Target *parent) const +QList ROSBuildConfigurationFactory::availableBuilds(const Kit *k, + const Utils::FilePath &projectPath, + bool forSetup) const { - QList result; - - // Need to create a ROS Setting widget where the user sets the default build system to use here. - ROSUtils::BuildSystem buildSystem = static_cast(parent->project())->defaultBuildSystem(); + Q_UNUSED(forSetup); - for (int type = ROSUtils::BuildTypeDebug; type <= ROSUtils::BuildTypeUserDefined; ++type) - { - ProjectExplorer::BuildInfo info = createBuildInfo(parent->kit(), buildSystem, ROSUtils::BuildType(type)); - result << info; - } - - return result; -} - -QList ROSBuildConfigurationFactory::availableSetups(const Kit *k, const QString &projectPath) const -{ QList result; // Need to create a ROS Setting widget where the user sets the default build system to use here. ROSUtils::ROSProjectFileContent projectFileContent; - ROSUtils::parseQtCreatorWorkspaceFile(Utils::FilePath::fromString(projectPath), projectFileContent); + ROSUtils::parseQtCreatorWorkspaceFile(projectPath, projectFileContent); for (int type = ROSUtils::BuildTypeDebug; type <= ROSUtils::BuildTypeUserDefined; ++type) { ProjectExplorer::BuildInfo info = createBuildInfo(k, projectFileContent.defaultBuildSystem, ROSUtils::BuildType(type)); diff --git a/src/project_manager/ros_build_configuration.h b/src/project_manager/ros_build_configuration.h index fb6008d3..1a43ab07 100644 --- a/src/project_manager/ros_build_configuration.h +++ b/src/project_manager/ros_build_configuration.h @@ -57,7 +57,7 @@ class ROSBuildConfiguration : public ProjectExplorer::BuildConfiguration public: ROSBuildConfiguration(ProjectExplorer::Target *parent, Core::Id id); - void initialize(const ProjectExplorer::BuildInfo &info) override; + void initialize() override; ProjectExplorer::NamedWidget *createConfigWidget() override; QList createSubConfigWidgets() override; @@ -100,9 +100,9 @@ class ROSBuildConfigurationFactory : public ProjectExplorer::BuildConfigurationF explicit ROSBuildConfigurationFactory(); ~ROSBuildConfigurationFactory(); - QList availableBuilds(const ProjectExplorer::Target *parent) const override; - QList availableSetups(const ProjectExplorer::Kit *k, - const QString &projectPath) const override; + QList availableBuilds(const ProjectExplorer::Kit *k, + const Utils::FilePath &projectPath, + bool forSetup) const override; private: ProjectExplorer::BuildInfo createBuildInfo(const ProjectExplorer::Kit *k, const ROSUtils::BuildSystem &build_system, const ROSUtils::BuildType &type) const; diff --git a/src/project_manager/ros_build_system.cpp b/src/project_manager/ros_build_system.cpp new file mode 100644 index 00000000..2f00bc86 --- /dev/null +++ b/src/project_manager/ros_build_system.cpp @@ -0,0 +1,31 @@ +#include "ros_build_system.h" + +#include "ros_build_configuration.h" + +using namespace ProjectExplorer; + +namespace ROSProjectManager { +namespace Internal { + +// -------------------------------------------------------------------- +// ROSBuildSystem: +// -------------------------------------------------------------------- + +ROSBuildSystem::ROSBuildSystem(ROSProject *p) + : BuildSystem(p) +{ + // +} + +bool ROSBuildSystem::validateParsingContext(const ParsingContext &ctx) +{ + return ctx.project && qobject_cast(ctx.buildConfiguration); +} + +void ROSBuildSystem::parseProject(ParsingContext &&ctx) +{ + ctx.guard.markAsSuccess(); +} + +} // namespace Internal +} // namespace ROSProjectManager diff --git a/src/project_manager/ros_build_system.h b/src/project_manager/ros_build_system.h new file mode 100644 index 00000000..9a4f4e3f --- /dev/null +++ b/src/project_manager/ros_build_system.h @@ -0,0 +1,27 @@ +#pragma once + +#include + +namespace ROSProjectManager { +namespace Internal { + +class ROSProject; + +// -------------------------------------------------------------------- +// ROSBuildSystem: +// -------------------------------------------------------------------- + +class ROSBuildSystem : public ProjectExplorer::BuildSystem +{ + Q_OBJECT + +public: + explicit ROSBuildSystem(ROSProject *project); + +protected: + bool validateParsingContext(const ParsingContext &ctx) final; + void parseProject(ParsingContext &&ctx) final; +}; + +} // namespace Internal +} // namespace ROSProjectManager diff --git a/src/project_manager/ros_catkin_make_step.cpp b/src/project_manager/ros_catkin_make_step.cpp index 30ff1d70..a9b7c410 100644 --- a/src/project_manager/ros_catkin_make_step.cpp +++ b/src/project_manager/ros_catkin_make_step.cpp @@ -128,8 +128,7 @@ bool ROSCatkinMakeStep::init() // addToEnvironment() to not screw up the users run environment. env.set(QLatin1String("LC_ALL"), QLatin1String("C")); pp->setEnvironment(env); - pp->setCommand(Utils::FilePath::fromString(makeCommand())); - pp->setArguments(allArguments(bc->cmakeBuildType())); + pp->setCommandLine(makeCommand(allArguments(bc->cmakeBuildType()))); pp->resolveAll(); // If we are cleaning, then make can fail with an error code, but that doesn't mean @@ -202,9 +201,11 @@ QString ROSCatkinMakeStep::allArguments(ROSUtils::BuildType buildType, bool incl return args; } -QString ROSCatkinMakeStep::makeCommand() const +Utils::CommandLine ROSCatkinMakeStep::makeCommand(const QString &args) const { - return QLatin1String("catkin_make"); + Utils::CommandLine cmd(QLatin1String("catkin_make")); + cmd.addArgs(args, Utils::CommandLine::RawType::Raw); + return cmd; } void ROSCatkinMakeStep::stdOutput(const QString &line) @@ -302,8 +303,7 @@ void ROSCatkinMakeStepWidget::updateDetails() param.setMacroExpander(bc->macroExpander()); param.setWorkingDirectory(workspaceInfo.buildPath); param.setEnvironment(bc->environment()); - param.setCommand(Utils::FilePath::fromString(m_makeStep->makeCommand())); - param.setArguments(m_makeStep->allArguments(bc->cmakeBuildType(), false)); + param.setCommandLine(m_makeStep->makeCommand(m_makeStep->allArguments(bc->cmakeBuildType(), false))); m_summaryText = param.summary(displayName()); emit updateSummary(); } diff --git a/src/project_manager/ros_catkin_make_step.h b/src/project_manager/ros_catkin_make_step.h index 4dce229f..6901570e 100644 --- a/src/project_manager/ros_catkin_make_step.h +++ b/src/project_manager/ros_catkin_make_step.h @@ -55,7 +55,7 @@ class ROSCatkinMakeStep : public ProjectExplorer::AbstractProcessStep BuildTargets buildTarget() const; void setBuildTarget(const BuildTargets &target); QString allArguments(ROSUtils::BuildType buildType, bool includeDefault = true) const; - QString makeCommand() const; + Utils::CommandLine makeCommand(const QString &args) const; void stdOutput(const QString &line) override; QVariantMap toMap() const override; diff --git a/src/project_manager/ros_catkin_tools_step.cpp b/src/project_manager/ros_catkin_tools_step.cpp index 067c3728..c035cb32 100644 --- a/src/project_manager/ros_catkin_tools_step.cpp +++ b/src/project_manager/ros_catkin_tools_step.cpp @@ -140,8 +140,7 @@ bool ROSCatkinToolsStep::init() // addToEnvironment() to not screw up the users run environment. env.set(QLatin1String("LC_ALL"), QLatin1String("C")); pp->setEnvironment(env); - pp->setCommand(Utils::FilePath::fromString(makeCommand())); - pp->setArguments(allArguments(bc->cmakeBuildType())); + pp->setCommandLine(makeCommand(allArguments(bc->cmakeBuildType()))); pp->resolveAll(); // If we are cleaning, then make can fail with an error code, but that doesn't mean @@ -229,9 +228,11 @@ QString ROSCatkinToolsStep::allArguments(ROSUtils::BuildType buildType, bool inc return args; } -QString ROSCatkinToolsStep::makeCommand() const +Utils::CommandLine ROSCatkinToolsStep::makeCommand(const QString &args) const { - return QLatin1String("catkin"); + Utils::CommandLine cmd(QLatin1String("catkin")); + cmd.addArgs(args, Utils::CommandLine::RawType::Raw); + return cmd; } void ROSCatkinToolsStep::stdOutput(const QString &line) @@ -383,8 +384,7 @@ void ROSCatkinToolsStepWidget::updateDetails() param.setMacroExpander(bc->macroExpander()); param.setEnvironment(bc->environment()); param.setWorkingDirectory(Utils::FilePath::fromString(m_makeStep->m_catkinToolsWorkingDir)); - param.setCommand(Utils::FilePath::fromString(m_makeStep->makeCommand())); - param.setArguments(m_makeStep->allArguments(bc->cmakeBuildType(), false)); + param.setCommandLine(m_makeStep->makeCommand(m_makeStep->allArguments(bc->cmakeBuildType(), false))); m_summaryText = param.summary(displayName()); emit updateSummary(); } diff --git a/src/project_manager/ros_catkin_tools_step.h b/src/project_manager/ros_catkin_tools_step.h index 75d5eed4..eb991ba3 100644 --- a/src/project_manager/ros_catkin_tools_step.h +++ b/src/project_manager/ros_catkin_tools_step.h @@ -67,7 +67,7 @@ class ROSCatkinToolsStep : public ProjectExplorer::AbstractProcessStep void setActiveProfile(const QString &profileName); QString allArguments(ROSUtils::BuildType buildType, bool includeDefault = true) const; - QString makeCommand() const; + Utils::CommandLine makeCommand(const QString &args) const; void stdOutput(const QString &line) override; QVariantMap toMap() const override; diff --git a/src/project_manager/ros_colcon_step.cpp b/src/project_manager/ros_colcon_step.cpp index 0f6f131b..3a5d6a17 100644 --- a/src/project_manager/ros_colcon_step.cpp +++ b/src/project_manager/ros_colcon_step.cpp @@ -128,8 +128,7 @@ bool ROSColconStep::init() // addToEnvironment() to not screw up the users run environment. env.set(QLatin1String("LC_ALL"), QLatin1String("C")); pp->setEnvironment(env); - pp->setCommand(Utils::FilePath::fromString(makeCommand())); - pp->setArguments(allArguments(bc->cmakeBuildType())); + pp->setCommandLine(makeCommand(allArguments(bc->cmakeBuildType()))); pp->resolveAll(); // If we are cleaning, then make can fail with an error code, but that doesn't mean @@ -200,16 +199,24 @@ QString ROSColconStep::allArguments(ROSUtils::BuildType buildType, bool includeD return args; } -QString ROSColconStep::makeCommand() const +Utils::CommandLine ROSColconStep::makeCommand(const QString &args) const { + QLatin1String exec; switch(m_target) { case BUILD: - return QLatin1String("colcon"); + exec = QLatin1String("colcon"); + break; case CLEAN: - return QLatin1String("rm"); + exec = QLatin1String("rm"); + break; default: - return QLatin1String("colcon"); + exec = QLatin1String("colcon"); + break; } + + Utils::CommandLine cmd(exec); + cmd.addArgs(args, Utils::CommandLine::RawType::Raw); + return cmd; } void ROSColconStep::stdOutput(const QString &line) @@ -305,8 +312,7 @@ void ROSColconStepWidget::updateDetails() param.setMacroExpander(bc->macroExpander()); param.setWorkingDirectory(workspaceInfo.buildPath); param.setEnvironment(bc->environment()); - param.setCommand(Utils::FilePath::fromString(m_makeStep->makeCommand())); - param.setArguments(m_makeStep->allArguments(bc->cmakeBuildType(), false)); + param.setCommandLine(m_makeStep->makeCommand(m_makeStep->allArguments(bc->cmakeBuildType(), false))); m_summaryText = param.summary(displayName()); emit updateSummary(); } diff --git a/src/project_manager/ros_colcon_step.h b/src/project_manager/ros_colcon_step.h index c9acea82..215f9469 100644 --- a/src/project_manager/ros_colcon_step.h +++ b/src/project_manager/ros_colcon_step.h @@ -56,7 +56,7 @@ class ROSColconStep : public ProjectExplorer::AbstractProcessStep void setBuildTarget(const BuildTargets &target); QString allArguments(ROSUtils::BuildType buildType, bool includeDefault = true) const; - QString makeCommand() const; + Utils::CommandLine makeCommand(const QString &args) const; void stdOutput(const QString &line) override; QVariantMap toMap() const override; diff --git a/src/project_manager/ros_project.cpp b/src/project_manager/ros_project.cpp index 8af23ebb..2365c8c2 100644 --- a/src/project_manager/ros_project.cpp +++ b/src/project_manager/ros_project.cpp @@ -126,9 +126,10 @@ static FolderNode *recursiveFindOrCreateFolderNode(FolderNode *folder, const int UPDATE_INTERVAL = 300; ROSProject::ROSProject(const Utils::FilePath &fileName) : - ProjectExplorer::Project(Constants::ROS_MIME_TYPE, fileName, [this]() { refresh(); }), + ProjectExplorer::Project(Constants::ROS_MIME_TYPE, fileName), m_cppCodeModelUpdater(new CppTools::CppProjectUpdater), m_project_loaded(false), + m_build_system(nullptr), m_asyncUpdateFutureInterface(nullptr), m_asyncBuildCodeModelFutureInterface(nullptr) { @@ -270,7 +271,9 @@ void ROSProject::updateProjectTree() } } - emitParsingFinished(true); + // delete the build system and its parse guard to notify that parsing finished + delete m_build_system; + m_build_system = nullptr; } void ROSProject::buildProjectTree(const Utils::FilePath projectFilePath, const QStringList watchDirectories, QFutureInterface &fi) @@ -292,13 +295,11 @@ void ROSProject::buildProjectTree(const Utils::FilePath projectFilePath, const Q const ProjectExplorer::FolderNode::FolderNodeFactory &factory = [](const Utils::FilePath &fn) { return std::make_unique(fn); }; std::vector> childNodes; - QHashIterator item(results.workspaceContent); + QHash::const_iterator item = results.workspaceContent.constBegin(); int cnt = 0; double max = results.workspaceContent.size(); - while (item.hasNext()) + while(item != results.workspaceContent.constEnd()) { - item.next(); - if (item.value().files.empty()) { // This is required so empty directories show up in project tree Utils::FilePath empty_directory = Utils::FilePath::fromString(item.key()); @@ -322,6 +323,7 @@ void ROSProject::buildProjectTree(const Utils::FilePath projectFilePath, const Q cnt += 1; fi.setProgressValue(static_cast(100.0 * static_cast(cnt) / max)); + ++item; } project_node->addNestedNodes(std::move(childNodes), Utils::FilePath(), factory); @@ -373,8 +375,10 @@ void ROSProject::fileSystemChanged(const QString &path) void ROSProject::asyncUpdate() { - if (!isParsing()) - emitParsingStarted(); + if (!m_build_system) { + m_build_system = new ROSBuildSystem(this); + m_build_system->requestParse(); + } m_futureWatcher.waitForFinished(); @@ -433,11 +437,11 @@ void ROSProject::asyncUpdateCppCodeModel(bool success) // TODO: Figure out why running this async causes segfaults if (async) { - Utils::runAsync(ProjectExplorer::ProjectExplorerPlugin::sharedThreadPool(), QThread::LowestPriority, [this, workspaceInfo, k]() { ROSProject::buildCppCodeModel(workspaceInfo, projectFilePath(), m_workspaceFiles, k, m_wsPackageInfo, m_wsPackageBuildInfo, *m_asyncBuildCodeModelFutureInterface); }); + Utils::runAsync(ProjectExplorer::ProjectExplorerPlugin::sharedThreadPool(), QThread::LowestPriority, [this, workspaceInfo, k, current_environment]() { ROSProject::buildCppCodeModel(workspaceInfo, projectFilePath(), m_workspaceFiles, k, current_environment, m_wsPackageInfo, m_wsPackageBuildInfo, *m_asyncBuildCodeModelFutureInterface); }); } else { - ROSProject::buildCppCodeModel(workspaceInfo, projectFilePath(), m_workspaceFiles, k, m_wsPackageInfo, m_wsPackageBuildInfo, *m_asyncBuildCodeModelFutureInterface); + ROSProject::buildCppCodeModel(workspaceInfo, projectFilePath(), m_workspaceFiles, k, current_environment, m_wsPackageInfo, m_wsPackageBuildInfo, *m_asyncBuildCodeModelFutureInterface); } } } @@ -446,6 +450,7 @@ void ROSProject::buildCppCodeModel(const ROSUtils::WorkspaceInfo workspaceInfo, const Utils::FilePath projectFilePath, const QStringList workspaceFiles, const Kit *k, + const Utils::Environment &env, const ROSUtils::PackageInfoMap wsPackageInfo, const ROSUtils::PackageBuildInfoMap wsPackageBuildInfo, QFutureInterface &fi) @@ -456,12 +461,12 @@ void ROSProject::buildCppCodeModel(const ROSUtils::WorkspaceInfo workspaceInfo, const Utils::FilePath sysRoot = SysRootKitAspect::sysRoot(k); - CppTools::ProjectPart::QtVersion activeQtVersion = CppTools::ProjectPart::NoQt; + Utils::QtVersion activeQtVersion = Utils::QtVersion::None; if (QtSupport::BaseQtVersion *qtVersion = QtSupport::QtKitAspect::qtVersion(k)) { if (qtVersion->qtVersion() < QtSupport::QtVersionNumber(5,0,0)) - activeQtVersion = CppTools::ProjectPart::Qt4; + activeQtVersion = Utils::QtVersion::Qt4; else - activeQtVersion = CppTools::ProjectPart::Qt5; + activeQtVersion = Utils::QtVersion::Qt5; } // Get all of the workspace includes directories @@ -476,7 +481,7 @@ void ROSProject::buildCppCodeModel(const ROSUtils::WorkspaceInfo workspaceInfo, } } - CppTools::RawProjectParts rpps; + ProjectExplorer::RawProjectParts rpps; ToolChain *cxxToolChain = ToolChainKitAspect::toolChain(k, ProjectExplorer::Constants::CXX_LANGUAGE_ID); @@ -506,7 +511,7 @@ void ROSProject::buildCppCodeModel(const ROSUtils::WorkspaceInfo workspaceInfo, for (const ROSUtils::PackageTargetInfo& targetInfo : buildInfo.targets) { - CppTools::RawProjectPart rpp; + ProjectExplorer::RawProjectPart rpp; const QString defineArg = Utils::transform(targetInfo.defines, [](const QString &s) -> QString { QString result = QString::fromLatin1("#define ") + s; @@ -523,7 +528,7 @@ void ROSProject::buildCppCodeModel(const ROSUtils::WorkspaceInfo workspaceInfo, rpp.setMacros(ProjectExplorer::Macro::toMacros(defineArg.toUtf8())); QSet toolChainIncludes; - for (const HeaderPath &hp : cxxToolChain->builtInHeaderPaths(targetInfo.flags, sysRoot)) { + for (const HeaderPath &hp : cxxToolChain->builtInHeaderPaths(targetInfo.flags, sysRoot, env)) { toolChainIncludes.insert(hp.path); } @@ -559,7 +564,7 @@ void ROSProject::updateCppCodeModel() QtSupport::CppKitInfo kitInfo(this); QTC_ASSERT(kitInfo.isValid(), return); - m_cppCodeModelUpdater->update({this, kitInfo, std::move(m_futureBuildCodeModelWatcher.result().parts)}); + m_cppCodeModelUpdater->update({this, kitInfo, rosBuildConfiguration()->environment(), m_futureBuildCodeModelWatcher.result().parts}); m_asyncBuildCodeModelFutureInterface->reportFinished(); delete m_asyncBuildCodeModelFutureInterface; @@ -578,7 +583,7 @@ Project::RestoreResult ROSProject::fromMap(const QVariantMap &map, QString *erro Kit *defaultKit = KitManager::defaultKit(); if (!activeTarget() && defaultKit) - addTarget(createTarget(defaultKit)); + addTargetForKit(defaultKit); // Sanity check: We need both a buildconfiguration and a runconfiguration! QList targetList = targets(); diff --git a/src/project_manager/ros_project.h b/src/project_manager/ros_project.h index d176302c..61259636 100644 --- a/src/project_manager/ros_project.h +++ b/src/project_manager/ros_project.h @@ -23,6 +23,7 @@ #include "ros_project_plugin.h" #include "ros_utils.h" +#include "ros_build_system.h" #include #include @@ -30,7 +31,7 @@ #include #include #include -#include +#include #include #include @@ -96,6 +97,7 @@ private slots: QStringList m_workspaceFiles; QStringList m_workspaceDirectories; bool m_project_loaded; + ROSBuildSystem *m_build_system; struct FutureWatcherResults @@ -108,7 +110,7 @@ private slots: struct CppToolsFutureResults { - CppTools::RawProjectParts parts; + ProjectExplorer::RawProjectParts parts; ROSUtils::PackageInfoMap wsPackageInfo; ROSUtils::PackageBuildInfoMap wsPackageBuildInfo; }; @@ -127,6 +129,7 @@ private slots: const Utils::FilePath projectFilePath, const QStringList workspaceFiles, const ProjectExplorer::Kit *k, + const Utils::Environment &env, const ROSUtils::PackageInfoMap wsPackageInfo, const ROSUtils::PackageBuildInfoMap wsPackageBuildInfo, QFutureInterface &fi); diff --git a/src/project_manager/ros_project_nodes.cpp b/src/project_manager/ros_project_nodes.cpp index 3776b71b..ced5b68e 100644 --- a/src/project_manager/ros_project_nodes.cpp +++ b/src/project_manager/ros_project_nodes.cpp @@ -81,12 +81,6 @@ bool ROSProjectNode::addFiles(const QStringList &filePaths, QStringList *notAdde return true; } -bool ROSProjectNode::removeFiles(const QStringList &filePaths, QStringList *notRemoved) -{ - ProjectExplorer::ProjectNode::removeFiles(filePaths, notRemoved); - return true; -} - bool ROSProjectNode::deleteFiles(const QStringList &filePaths) { ProjectExplorer::ProjectNode::deleteFiles(filePaths); diff --git a/src/project_manager/ros_project_nodes.h b/src/project_manager/ros_project_nodes.h index e4621e09..d04304a6 100644 --- a/src/project_manager/ros_project_nodes.h +++ b/src/project_manager/ros_project_nodes.h @@ -47,8 +47,6 @@ class ROSProjectNode : public ProjectExplorer::ProjectNode bool addFiles(const QStringList &filePaths, QStringList *notAdded = nullptr) override; - bool removeFiles(const QStringList &filePaths, QStringList *notRemoved = nullptr) override; - bool deleteFiles(const QStringList &filePaths) override; bool renameFile(const QString &filePath, const QString &newFilePath) override; diff --git a/src/project_manager/ros_project_plugin.cpp b/src/project_manager/ros_project_plugin.cpp index c85cf410..b8839528 100644 --- a/src/project_manager/ros_project_plugin.cpp +++ b/src/project_manager/ros_project_plugin.cpp @@ -95,8 +95,6 @@ class ROSProjectPluginPrivate settingsPage(new ROSSettingsPage(settings)) { settings->fromSettings(ICore::settings()); - - runDebugWorkerFactory.addSupportedRunMode(ProjectExplorer::Constants::DEBUG_RUN_MODE); } ROSRunConfigurationFactory runConfigFactory; @@ -106,9 +104,6 @@ class ROSProjectPluginPrivate ROSTestStepFactory rosTestStepFactory; ROSCatkinTestResultsStepFactory rosCatkinTestResultsStepFactory; - SimpleRunWorkerFactory runWorkerFactory; - SimpleRunWorkerFactory runDebugWorkerFactory; - ROSBuildConfigurationFactory buildConfigFactory; ROSCatkinMakeStepFactory catkinMakeStepFactory; ROSCatkinToolsStepFactory catkinToolsStepFactory; diff --git a/src/project_manager/ros_run_configuration.cpp b/src/project_manager/ros_run_configuration.cpp index 36e27845..6ef59db7 100644 --- a/src/project_manager/ros_run_configuration.cpp +++ b/src/project_manager/ros_run_configuration.cpp @@ -244,7 +244,7 @@ void ROSDebugRunWorker::pidFound(ProjectExplorer::DeviceProcessItem process) m_timer.stop(); setAttachPid(Utils::ProcessHandle(process.pid)); setId(tr("Process %1").arg(process.pid)); - setInferiorExecutable(process.exe); + setInferiorExecutable(Utils::FilePath::fromString(process.exe)); setStartMode(Debugger::AttachExternal); setCloseMode(Debugger::DetachAtClose); setContinueAfterAttach(m_debugContinueOnAttach); diff --git a/src/project_manager/ros_run_step.cpp b/src/project_manager/ros_run_step.cpp index fcd97a3f..cf4c45a1 100644 --- a/src/project_manager/ros_run_step.cpp +++ b/src/project_manager/ros_run_step.cpp @@ -430,10 +430,5 @@ ProjectExplorer::Target *RunStepList::target() const return 0; } -ProjectExplorer::Project *RunStepList::project() const -{ - return target()->project(); -} - } // namespace Internal } // namespace ROSProjectManager diff --git a/src/project_manager/ros_run_step.h b/src/project_manager/ros_run_step.h index 195fbb0f..7742c4f4 100644 --- a/src/project_manager/ros_run_step.h +++ b/src/project_manager/ros_run_step.h @@ -182,7 +182,6 @@ class RunStepList : public ProjectExplorer::ProjectConfiguration RunStep *at(int position); ProjectExplorer::Target *target() const; - ProjectExplorer::Project *project() const override; virtual QVariantMap toMap() const override; bool fromMap(const QVariantMap &map) override; diff --git a/src/project_manager/ros_utils.cpp b/src/project_manager/ros_utils.cpp index 79d0f8bb..b2a41d7c 100644 --- a/src/project_manager/ros_utils.cpp +++ b/src/project_manager/ros_utils.cpp @@ -527,11 +527,9 @@ ROSUtils::PackageInfoMap ROSUtils::getWorkspacePackageInfo(const WorkspaceInfo & PackageInfoMap wsPackageInfo; QMap packages = ROSUtils::getWorkspacePackagePaths(workspaceInfo); - QMapIterator it(packages); - while (it.hasNext()) + for(const auto& it : packages) { - it.next(); - Utils::FilePath pkgXml = Utils::FilePath::fromString(it.value()).pathAppended("package.xml"); + Utils::FilePath pkgXml = Utils::FilePath::fromString(it).pathAppended("package.xml"); ROSUtils::PackageInfo packageInfo; ROSPackageXmlParser pkgParser; if (pkgParser.parsePackageXml(pkgXml, packageInfo))