diff --git a/src/project_manager/ros_build_configuration.cpp b/src/project_manager/ros_build_configuration.cpp index 7891eb15..7a980847 100644 --- a/src/project_manager/ros_build_configuration.cpp +++ b/src/project_manager/ros_build_configuration.cpp @@ -223,7 +223,7 @@ QList ROSBuildConfigurationFactory::availableSetups(const Kit *k, con // Need to create a ROS Setting widget where the user sets the default build system to use here. ROSUtils::ROSProjectFileContent projectFileContent; - ROSUtils::parseQtCreatorWorkspaceFile(Utils::FileName::fromString(projectPath), projectFileContent); + ROSUtils::parseQtCreatorWorkspaceFile(Utils::FilePath::fromString(projectPath), projectFileContent); for (int type = ROSUtils::BuildTypeDebug; type <= ROSUtils::BuildTypeUserDefined; ++type) { ProjectExplorer::BuildInfo info = createBuildInfo(k, projectFileContent.defaultBuildSystem, ROSUtils::BuildType(type)); @@ -333,7 +333,7 @@ ROSBuildEnvironmentWidget::ROSBuildEnvironmentWidget(BuildConfiguration *bc) m_clearSystemEnvironmentCheckBox = new QCheckBox(this); m_clearSystemEnvironmentCheckBox->setText(tr("Clear system environment")); - m_buildEnvironmentWidget = new EnvironmentWidget(this, m_clearSystemEnvironmentCheckBox); + m_buildEnvironmentWidget = new EnvironmentWidget(this, ProjectExplorer::EnvironmentWidget::TypeLocal, m_clearSystemEnvironmentCheckBox); vbox->addWidget(m_buildEnvironmentWidget); connect(m_buildEnvironmentWidget, SIGNAL(userChangesChanged()), diff --git a/src/project_manager/ros_build_configuration.h b/src/project_manager/ros_build_configuration.h index 146c2e36..fb6008d3 100644 --- a/src/project_manager/ros_build_configuration.h +++ b/src/project_manager/ros_build_configuration.h @@ -38,7 +38,6 @@ #include namespace Utils { -class FileName; class PathChooser; } // namespace Utils diff --git a/src/project_manager/ros_catkin_make_step.cpp b/src/project_manager/ros_catkin_make_step.cpp index 29cf56c4..30ff1d70 100644 --- a/src/project_manager/ros_catkin_make_step.cpp +++ b/src/project_manager/ros_catkin_make_step.cpp @@ -104,7 +104,7 @@ bool ROSCatkinMakeStep::init() emit addTask(Task::buildConfigurationMissingTask()); - ToolChain *tc = ToolChainKitInformation::toolChain(target()->kit(), ProjectExplorer::Constants::CXX_LANGUAGE_ID); + ToolChain *tc = ToolChainKitAspect::toolChain(target()->kit(), ProjectExplorer::Constants::CXX_LANGUAGE_ID); if (!tc) emit addTask(Task::compilerMissingTask()); @@ -119,7 +119,7 @@ bool ROSCatkinMakeStep::init() ProcessParameters *pp = processParameters(); pp->setMacroExpander(bc->macroExpander()); - pp->setWorkingDirectory(bc->project()->projectDirectory().toString()); + pp->setWorkingDirectory(bc->project()->projectDirectory()); Utils::Environment env(ROSUtils::getWorkspaceEnvironment(workspaceInfo, bc->environment()).toStringList()); bc->updateQtEnvironment(env); // TODO: Not sure if this is required here @@ -128,7 +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(makeCommand()); + pp->setCommand(Utils::FilePath::fromString(makeCommand())); pp->setArguments(allArguments(bc->cmakeBuildType())); pp->resolveAll(); @@ -300,9 +300,9 @@ void ROSCatkinMakeStepWidget::updateDetails() ProcessParameters param; param.setMacroExpander(bc->macroExpander()); - param.setWorkingDirectory(workspaceInfo.buildPath.toString()); + param.setWorkingDirectory(workspaceInfo.buildPath); param.setEnvironment(bc->environment()); - param.setCommand(m_makeStep->makeCommand()); + param.setCommand(Utils::FilePath::fromString(m_makeStep->makeCommand())); param.setArguments(m_makeStep->allArguments(bc->cmakeBuildType(), false)); m_summaryText = param.summary(displayName()); emit updateSummary(); diff --git a/src/project_manager/ros_catkin_tools_step.cpp b/src/project_manager/ros_catkin_tools_step.cpp index b52b2ba2..067c3728 100644 --- a/src/project_manager/ros_catkin_tools_step.cpp +++ b/src/project_manager/ros_catkin_tools_step.cpp @@ -115,7 +115,7 @@ bool ROSCatkinToolsStep::init() if (!bc) emit addTask(Task::buildConfigurationMissingTask()); - ToolChain *tc = ToolChainKitInformation::toolChain(target()->kit(), ProjectExplorer::Constants::CXX_LANGUAGE_ID); + ToolChain *tc = ToolChainKitAspect::toolChain(target()->kit(), ProjectExplorer::Constants::CXX_LANGUAGE_ID); if (!tc) emit addTask(Task::compilerMissingTask()); @@ -134,13 +134,13 @@ bool ROSCatkinToolsStep::init() ProcessParameters *pp = processParameters(); pp->setMacroExpander(bc->macroExpander()); - pp->setWorkingDirectory(m_catkinToolsWorkingDir); + pp->setWorkingDirectory(Utils::FilePath::fromString(m_catkinToolsWorkingDir)); // Force output to english for the parsers. Do this here and not in the toolchain's // addToEnvironment() to not screw up the users run environment. env.set(QLatin1String("LC_ALL"), QLatin1String("C")); pp->setEnvironment(env); - pp->setCommand(makeCommand()); + pp->setCommand(Utils::FilePath::fromString(makeCommand())); pp->setArguments(allArguments(bc->cmakeBuildType())); pp->resolveAll(); @@ -382,8 +382,8 @@ void ROSCatkinToolsStepWidget::updateDetails() ProcessParameters param; param.setMacroExpander(bc->macroExpander()); param.setEnvironment(bc->environment()); - param.setWorkingDirectory(m_makeStep->m_catkinToolsWorkingDir); - param.setCommand(m_makeStep->makeCommand()); + 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)); m_summaryText = param.summary(displayName()); emit updateSummary(); @@ -474,7 +474,7 @@ void ROSCatkinToolsStepWidget::renameProfile(const QString profileName) void ROSCatkinToolsStepWidget::editProfile(const QString profileName) { - Utils::FileName profile = ROSUtils::getCatkinToolsProfile(m_makeStep->rosBuildConfiguration()->project()->projectDirectory(), profileName); + Utils::FilePath profile = ROSUtils::getCatkinToolsProfile(m_makeStep->rosBuildConfiguration()->project()->projectDirectory(), profileName); ROSCatkinToolsProfileEditorDialog *editor = new ROSCatkinToolsProfileEditorDialog(profile); editor->show(); @@ -706,7 +706,7 @@ ROSCatkinToolsConfigEditorWidget::~ROSCatkinToolsConfigEditorWidget() delete m_editor; } -bool ROSCatkinToolsConfigEditorWidget::parseProfileConfig(Utils::FileName filePath) +bool ROSCatkinToolsConfigEditorWidget::parseProfileConfig(Utils::FilePath filePath) { m_profileConfigPath = filePath; if (!m_profileConfigPath.exists()) @@ -882,7 +882,7 @@ bool ROSCatkinToolsConfigEditorWidget::isValid() const // ROSCatkinToolsProfileEditorDialog // -ROSCatkinToolsProfileEditorDialog::ROSCatkinToolsProfileEditorDialog(Utils::FileName filePath) : QDialog() +ROSCatkinToolsProfileEditorDialog::ROSCatkinToolsProfileEditorDialog(Utils::FilePath filePath) : QDialog() { setWindowFlags(Qt::WindowStaysOnTopHint | Qt::Dialog); QVBoxLayout *vlayout = new QVBoxLayout(); diff --git a/src/project_manager/ros_catkin_tools_step.h b/src/project_manager/ros_catkin_tools_step.h index d221f750..75d5eed4 100644 --- a/src/project_manager/ros_catkin_tools_step.h +++ b/src/project_manager/ros_catkin_tools_step.h @@ -129,7 +129,7 @@ class ROSCatkinToolsProfileEditorDialog : public QDialog { Q_OBJECT public: - ROSCatkinToolsProfileEditorDialog(Utils::FileName filePath); + ROSCatkinToolsProfileEditorDialog(Utils::FilePath filePath); }; @@ -185,7 +185,7 @@ class ROSCatkinToolsConfigEditorWidget : public QWidget ROSCatkinToolsConfigEditorWidget(); ~ROSCatkinToolsConfigEditorWidget(); - bool parseProfileConfig(Utils::FileName filePath); + bool parseProfileConfig(Utils::FilePath filePath); bool saveProfileConfig(); bool isModified() const; bool isValid() const; @@ -204,7 +204,7 @@ public slots: ROSCatkinToolsListEditorWidget *m_editor; bool m_modified; bool m_parsing; - Utils::FileName m_profileConfigPath; + Utils::FilePath m_profileConfigPath; YAML::Node m_profile_original; YAML::Node m_profile_current; }; diff --git a/src/project_manager/ros_colcon_step.cpp b/src/project_manager/ros_colcon_step.cpp index 4671b046..0f6f131b 100644 --- a/src/project_manager/ros_colcon_step.cpp +++ b/src/project_manager/ros_colcon_step.cpp @@ -104,7 +104,7 @@ bool ROSColconStep::init() emit addTask(Task::buildConfigurationMissingTask()); - ToolChain *tc = ToolChainKitInformation::toolChain(target()->kit(), ProjectExplorer::Constants::CXX_LANGUAGE_ID); + ToolChain *tc = ToolChainKitAspect::toolChain(target()->kit(), ProjectExplorer::Constants::CXX_LANGUAGE_ID); if (!tc) emit addTask(Task::compilerMissingTask()); @@ -119,7 +119,7 @@ bool ROSColconStep::init() ProcessParameters *pp = processParameters(); pp->setMacroExpander(bc->macroExpander()); - pp->setWorkingDirectory(bc->project()->projectDirectory().toString()); + pp->setWorkingDirectory(bc->project()->projectDirectory()); Utils::Environment env(ROSUtils::getWorkspaceEnvironment(workspaceInfo, bc->environment()).toStringList()); bc->updateQtEnvironment(env); // TODO: Not sure if this is required here @@ -128,7 +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(makeCommand()); + pp->setCommand(Utils::FilePath::fromString(makeCommand())); pp->setArguments(allArguments(bc->cmakeBuildType())); pp->resolveAll(); @@ -303,9 +303,9 @@ void ROSColconStepWidget::updateDetails() ProcessParameters param; param.setMacroExpander(bc->macroExpander()); - param.setWorkingDirectory(workspaceInfo.buildPath.toString()); + param.setWorkingDirectory(workspaceInfo.buildPath); param.setEnvironment(bc->environment()); - param.setCommand(m_makeStep->makeCommand()); + param.setCommand(Utils::FilePath::fromString(m_makeStep->makeCommand())); param.setArguments(m_makeStep->allArguments(bc->cmakeBuildType(), false)); m_summaryText = param.summary(displayName()); emit updateSummary(); diff --git a/src/project_manager/ros_generic_run_step.cpp b/src/project_manager/ros_generic_run_step.cpp index 1cad86f6..caf7aa95 100644 --- a/src/project_manager/ros_generic_run_step.cpp +++ b/src/project_manager/ros_generic_run_step.cpp @@ -79,19 +79,19 @@ void ROSGenericRunStep::run() ROSUtils::WorkspaceInfo workspaceInfo = ROSUtils::getWorkspaceInfo(rp->projectDirectory(), rp->rosBuildConfiguration()->buildSystem(), rp->distribution()); ROSBuildConfiguration *bc = qobject_cast(target()->activeBuildConfiguration()); Utils::Environment env = bc->environment(); - Utils::FileName shell = Utils::FileName::fromString(env.value("SHELL")); + Utils::FilePath shell = Utils::FilePath::fromString(env.value("SHELL")); QString source_cmd; - Utils::FileName sourcePath(workspaceInfo.develPath); + Utils::FilePath sourcePath(workspaceInfo.develPath); if (workspaceInfo.install) - sourcePath = Utils::FileName(workspaceInfo.installPath); + sourcePath = Utils::FilePath(workspaceInfo.installPath); if (shell.fileName() == "bash") - source_cmd = QString("source %1\n").arg(sourcePath.appendPath("setup.bash").toString()); + source_cmd = QString("source %1\n").arg(sourcePath.pathAppended("setup.bash").toString()); else if (shell.fileName() == "sh") - source_cmd = QString("source %1\n").arg(sourcePath.appendPath("setup.sh").toString()); + source_cmd = QString("source %1\n").arg(sourcePath.pathAppended("setup.sh").toString()); else if (shell.fileName() == "zsh") - source_cmd = QString("source %1\n").arg(sourcePath.appendPath("setup.zsh").toString()); + source_cmd = QString("source %1\n").arg(sourcePath.pathAppended("setup.zsh").toString()); else Core::MessageManager::write(tr("[ROS Error] The shell: %1 is currently not supported (Use bash, sh, or zsh)!").arg(shell.toString())); diff --git a/src/project_manager/ros_package_wizard.cpp b/src/project_manager/ros_package_wizard.cpp index f116205c..174c1b7a 100644 --- a/src/project_manager/ros_package_wizard.cpp +++ b/src/project_manager/ros_package_wizard.cpp @@ -284,11 +284,11 @@ Core::GeneratedFiles ROSPackageWizard::generateFiles(const QWizard *w, Q_UNUSED(errorMessage); QString package; - Utils::FileName packagePath = Utils::FileName::fromString(m_wizard->packagePath()); - Utils::FileName cmakelistPath = Utils::FileName::fromString(m_wizard->packagePath()); + Utils::FilePath packagePath = Utils::FilePath::fromString(m_wizard->packagePath()); + Utils::FilePath cmakelistPath = Utils::FilePath::fromString(m_wizard->packagePath()); - packagePath.appendPath(m_wizard->packageName()).appendPath(QLatin1String("package.xml")); - cmakelistPath.appendPath(m_wizard->packageName()).appendPath(QLatin1String("CMakeLists.txt")); + packagePath = packagePath.pathAppended(m_wizard->packageName()).pathAppended(QLatin1String("package.xml")); + cmakelistPath = cmakelistPath.pathAppended(m_wizard->packageName()).pathAppended(QLatin1String("CMakeLists.txt")); Core::GeneratedFile generatedPackageFile(packagePath.toString()); generatedPackageFile.setAttributes(Core::GeneratedFile::CustomGeneratorAttribute); @@ -343,7 +343,7 @@ bool ROSPackageWizard::writeFiles(const Core::GeneratedFiles &files, QString *er cmd += QString::fromLatin1(" --rosdistro \"%1\"").arg(project->distribution().fileName()); // create package using ros command catkin_create_pkg - Utils::FileName packagePath = Utils::FileName::fromString(m_wizard->packagePath()); + Utils::FilePath packagePath = Utils::FilePath::fromString(m_wizard->packagePath()); catkin_create_pkg->setWorkingDirectory(packagePath.toString()); ROSUtils::sourceROS(catkin_create_pkg, project->distribution()); diff --git a/src/project_manager/ros_package_wizard.h b/src/project_manager/ros_package_wizard.h index eb17af2b..9da1252d 100644 --- a/src/project_manager/ros_package_wizard.h +++ b/src/project_manager/ros_package_wizard.h @@ -30,10 +30,6 @@ #include -namespace Utils { -class FileName; -} // namespace Utils - namespace ROSProjectManager { namespace Internal { diff --git a/src/project_manager/ros_packagexml_parser.cpp b/src/project_manager/ros_packagexml_parser.cpp index 17f08eae..7a755de5 100644 --- a/src/project_manager/ros_packagexml_parser.cpp +++ b/src/project_manager/ros_packagexml_parser.cpp @@ -27,12 +27,11 @@ namespace ROSProjectManager { namespace Internal { -bool ROSPackageXmlParser::parsePackageXml(const Utils::FileName &filepath) +bool ROSPackageXmlParser::parsePackageXml(const Utils::FilePath &filepath) { m_packageInfo.path = filepath.parentDir(); m_packageInfo.filepath = filepath; - m_packageInfo.buildFile = m_packageInfo.path; - m_packageInfo.buildFile.appendPath("CMakeLists.txt"); + m_packageInfo.buildFile = m_packageInfo.path.pathAppended("CMakeLists.txt"); QFile pkgFile(filepath.toString()); if (pkgFile.exists() && pkgFile.open(QFile::ReadOnly)) { @@ -54,7 +53,7 @@ bool ROSPackageXmlParser::parsePackageXml(const Utils::FileName &filepath) return false; } -bool ROSPackageXmlParser::parsePackageXml(const Utils::FileName &filepath, ROSUtils::PackageInfo &packageInfo) +bool ROSPackageXmlParser::parsePackageXml(const Utils::FilePath &filepath, ROSUtils::PackageInfo &packageInfo) { bool result = parsePackageXml(filepath); packageInfo = m_packageInfo; diff --git a/src/project_manager/ros_packagexml_parser.h b/src/project_manager/ros_packagexml_parser.h index eabcd102..5ae8f51e 100644 --- a/src/project_manager/ros_packagexml_parser.h +++ b/src/project_manager/ros_packagexml_parser.h @@ -34,9 +34,9 @@ class ROSPackageXmlParser : public QXmlStreamReader public: ROSPackageXmlParser() {} - bool parsePackageXml(const Utils::FileName &filepath); + bool parsePackageXml(const Utils::FilePath &filepath); - bool parsePackageXml(const Utils::FileName &filepath, + bool parsePackageXml(const Utils::FilePath &filepath, ROSUtils::PackageInfo &packageInfo); ROSUtils::PackageInfo getInfo() const; diff --git a/src/project_manager/ros_project.cpp b/src/project_manager/ros_project.cpp index 4eb30c51..8af23ebb 100644 --- a/src/project_manager/ros_project.cpp +++ b/src/project_manager/ros_project.cpp @@ -66,7 +66,7 @@ using namespace ProjectExplorer; namespace ROSProjectManager { namespace Internal { -static FolderNode *folderNode(const FolderNode *folder, const Utils::FileName &directory) +static FolderNode *folderNode(const FolderNode *folder, const Utils::FilePath &directory) { return static_cast(Utils::findOrDefault(folder->folderNodes(), [&directory](const FolderNode *fn) { @@ -75,13 +75,13 @@ static FolderNode *folderNode(const FolderNode *folder, const Utils::FileName &d } static FolderNode *recursiveFindOrCreateFolderNode(FolderNode *folder, - const Utils::FileName &directory, - const Utils::FileName &overrideBaseDir, + const Utils::FilePath &directory, + const Utils::FilePath &overrideBaseDir, const FolderNode::FolderNodeFactory &factory) { - Utils::FileName path = overrideBaseDir.isEmpty() ? folder->filePath() : overrideBaseDir; + Utils::FilePath path = overrideBaseDir.isEmpty() ? folder->filePath() : overrideBaseDir; - Utils::FileName directoryWithoutPrefix; + Utils::FilePath directoryWithoutPrefix; bool isRelative = false; if (path.isEmpty() || path.toFileInfo().isRoot()) { @@ -103,7 +103,7 @@ static FolderNode *recursiveFindOrCreateFolderNode(FolderNode *folder, ProjectExplorer::FolderNode *parent = folder; foreach (const QString &part, parts) { - path.appendPath(part); + path = path.pathAppended(part); // Find folder in subFolders FolderNode *next = folderNode(parent, path); if (!next) { @@ -125,7 +125,7 @@ static FolderNode *recursiveFindOrCreateFolderNode(FolderNode *folder, //////////////////////////////////////////////////////////////////////////////////// const int UPDATE_INTERVAL = 300; -ROSProject::ROSProject(const Utils::FileName &fileName) : +ROSProject::ROSProject(const Utils::FilePath &fileName) : ProjectExplorer::Project(Constants::ROS_MIME_TYPE, fileName, [this]() { refresh(); }), m_cppCodeModelUpdater(new CppTools::CppProjectUpdater), m_project_loaded(false), @@ -195,7 +195,7 @@ bool ROSProject::saveProjectFile() return result; } -Utils::FileName ROSProject::distribution() const +Utils::FilePath ROSProject::distribution() const { return m_projectFileContent.distribution; } @@ -273,23 +273,23 @@ void ROSProject::updateProjectTree() emitParsingFinished(true); } -void ROSProject::buildProjectTree(const Utils::FileName projectFilePath, const QStringList watchDirectories, QFutureInterface &fi) +void ROSProject::buildProjectTree(const Utils::FilePath projectFilePath, const QStringList watchDirectories, QFutureInterface &fi) { fi.reportStarted(); FutureWatcherResults results; for (const QString& dir : watchDirectories) { - Utils::FileName addedDir = projectFilePath.parentDir().appendPath(dir); + Utils::FilePath addedDir = projectFilePath.parentDir().pathAppended(dir); QHash newDirContent = ROSUtils::getFolderContentRecurisve(addedDir, results.files, results.directories); results.workspaceContent.unite(newDirContent); } ROSProjectNode* project_node(new ROSProjectNode(projectFilePath.parentDir())); - std::unique_ptr root_node(new FileNode(projectFilePath, FileType::Project, false)); + std::unique_ptr root_node(new FileNode(projectFilePath, ProjectExplorer::FileType::Project)); project_node->addNode(std::move(root_node)); - const ProjectExplorer::FolderNode::FolderNodeFactory &factory = [](const Utils::FileName &fn) { return std::make_unique(fn, fn.fileName()); }; + const ProjectExplorer::FolderNode::FolderNodeFactory &factory = [](const Utils::FilePath &fn) { return std::make_unique(fn); }; std::vector> childNodes; QHashIterator item(results.workspaceContent); @@ -301,8 +301,8 @@ void ROSProject::buildProjectTree(const Utils::FileName projectFilePath, const Q if (item.value().files.empty()) { // This is required so empty directories show up in project tree - Utils::FileName empty_directory = Utils::FileName::fromString(item.key()); - recursiveFindOrCreateFolderNode(project_node, empty_directory, Utils::FileName(), factory); + Utils::FilePath empty_directory = Utils::FilePath::fromString(item.key()); + recursiveFindOrCreateFolderNode(project_node, empty_directory, Utils::FilePath(), factory); } else { // Add all files in the directory node @@ -315,7 +315,7 @@ void ROSProject::buildProjectTree(const Utils::FileName projectFilePath, const Q if (Constants::HEADER_FILE_EXTENSIONS.contains(fileInfo.suffix())) fileType = ProjectExplorer::FileType::Header; - std::unique_ptr fileNode(new ProjectExplorer::FileNode(Utils::FileName::fromString(fileInfo.absoluteFilePath()), fileType, /*generated = */ false)); + std::unique_ptr fileNode(new ProjectExplorer::FileNode(Utils::FilePath::fromString(fileInfo.absoluteFilePath()), fileType)); childNodes.emplace_back(std::move(fileNode)); } } @@ -324,7 +324,7 @@ void ROSProject::buildProjectTree(const Utils::FileName projectFilePath, const Q fi.setProgressValue(static_cast(100.0 * static_cast(cnt) / max)); } - project_node->addNestedNodes(std::move(childNodes), Utils::FileName(), factory); + project_node->addNestedNodes(std::move(childNodes), Utils::FilePath(), factory); results.node = project_node; fi.setProgressValue(fi.progressMaximum()); @@ -443,7 +443,7 @@ void ROSProject::asyncUpdateCppCodeModel(bool success) } void ROSProject::buildCppCodeModel(const ROSUtils::WorkspaceInfo workspaceInfo, - const Utils::FileName projectFilePath, + const Utils::FilePath projectFilePath, const QStringList workspaceFiles, const Kit *k, const ROSUtils::PackageInfoMap wsPackageInfo, @@ -454,10 +454,10 @@ void ROSProject::buildCppCodeModel(const ROSUtils::WorkspaceInfo workspaceInfo, results.wsPackageInfo = ROSUtils::getWorkspacePackageInfo(workspaceInfo, &wsPackageInfo); results.wsPackageBuildInfo = ROSUtils::getWorkspacePackageBuildInfo(workspaceInfo, results.wsPackageInfo, &wsPackageBuildInfo); - const Utils::FileName sysRoot = SysRootKitInformation::sysRoot(k); + const Utils::FilePath sysRoot = SysRootKitAspect::sysRoot(k); CppTools::ProjectPart::QtVersion activeQtVersion = CppTools::ProjectPart::NoQt; - if (QtSupport::BaseQtVersion *qtVersion = QtSupport::QtKitInformation::qtVersion(k)) { + if (QtSupport::BaseQtVersion *qtVersion = QtSupport::QtKitAspect::qtVersion(k)) { if (qtVersion->qtVersion() < QtSupport::QtVersionNumber(5,0,0)) activeQtVersion = CppTools::ProjectPart::Qt4; else @@ -468,8 +468,8 @@ void ROSProject::buildCppCodeModel(const ROSUtils::WorkspaceInfo workspaceInfo, QStringList workspace_includes; // This should be the same as workspace_header_paths used for checking for duplicates ProjectExplorer::HeaderPaths workspace_header_paths; for (const auto& package : results.wsPackageInfo) { - Utils::FileName include_path = Utils::FileName::fromString(package.path.toString()); - include_path.appendPath("include"); + Utils::FilePath include_path = Utils::FilePath::fromString(package.path.toString()); + include_path = include_path.pathAppended("include"); if (!workspace_includes.contains(include_path.toString())) { workspace_includes.append(include_path.toString()); workspace_header_paths.append(ProjectExplorer::HeaderPath(include_path.toString(), ProjectExplorer::HeaderPathType::User)); @@ -478,7 +478,7 @@ void ROSProject::buildCppCodeModel(const ROSUtils::WorkspaceInfo workspaceInfo, CppTools::RawProjectParts rpps; - ToolChain *cxxToolChain = ToolChainKitInformation::toolChain(k, ProjectExplorer::Constants::CXX_LANGUAGE_ID); + ToolChain *cxxToolChain = ToolChainKitAspect::toolChain(k, ProjectExplorer::Constants::CXX_LANGUAGE_ID); QString pattern = "^.*\\.(" + QRegularExpression::escape("c") + "|" + QRegularExpression::escape("cc") + diff --git a/src/project_manager/ros_project.h b/src/project_manager/ros_project.h index 36faaf50..d176302c 100644 --- a/src/project_manager/ros_project.h +++ b/src/project_manager/ros_project.h @@ -54,12 +54,12 @@ class ROSProject : public ProjectExplorer::Project friend class ROSProjectPlugin; public: - ROSProject(const Utils::FileName &filename); + ROSProject(const Utils::FilePath &filename); ~ROSProject() override; void refresh(); - Utils::FileName distribution() const; + Utils::FilePath distribution() const; ROSUtils::BuildSystem defaultBuildSystem() const; ROSBuildConfiguration* rosBuildConfiguration() const; @@ -119,12 +119,12 @@ private slots: QFutureInterface *m_asyncBuildCodeModelFutureInterface; QFutureWatcher m_futureBuildCodeModelWatcher; - static void buildProjectTree(const Utils::FileName projectFilePath, + static void buildProjectTree(const Utils::FilePath projectFilePath, const QStringList watchDirectories, QFutureInterface &fi); static void buildCppCodeModel(const ROSUtils::WorkspaceInfo workspaceInfo, - const Utils::FileName projectFilePath, + const Utils::FilePath projectFilePath, const QStringList workspaceFiles, const ProjectExplorer::Kit *k, const ROSUtils::PackageInfoMap wsPackageInfo, diff --git a/src/project_manager/ros_project_nodes.cpp b/src/project_manager/ros_project_nodes.cpp index eb8630bd..3776b71b 100644 --- a/src/project_manager/ros_project_nodes.cpp +++ b/src/project_manager/ros_project_nodes.cpp @@ -32,12 +32,12 @@ using namespace ProjectExplorer; namespace ROSProjectManager { namespace Internal { -ROSProjectNode::ROSProjectNode(const Utils::FileName &projectFilePath) : ProjectNode(projectFilePath) +ROSProjectNode::ROSProjectNode(const Utils::FilePath &projectFilePath) : ProjectNode(projectFilePath) { setDisplayName(projectFilePath.toFileInfo().completeBaseName()); } -FileNode *ROSProjectNode::findFileNode(FolderNode *folder_node, const Utils::FileName &filePaths) +FileNode *ROSProjectNode::findFileNode(FolderNode *folder_node, const Utils::FilePath &filePaths) { FileNode* file_node = folder_node->fileNode(filePaths); if (file_node) @@ -60,19 +60,19 @@ bool ROSProjectNode::showInSimpleTree() const bool ROSProjectNode::supportsAction(ProjectExplorer::ProjectAction action, const Node *node) const { - switch (node->nodeType()) + if(node->isProjectNodeType()) { - case NodeType::File: - return action == ProjectAction::Rename - || action == ProjectAction::RemoveFile; - case NodeType::Folder: - case NodeType::Project: - return action == ProjectAction::AddNewFile - || action == ProjectAction::RemoveFile - || action == ProjectAction::AddExistingFile; - default: - return ProjectNode::supportsAction(action, node); + return action == ProjectAction::AddNewFile + || action == ProjectAction::RemoveFile + || action == ProjectAction::AddExistingFile; } + else if(!node->isFolderNodeType() && !node->isProjectNodeType() && !node->isVirtualFolderType()) + { + return action == ProjectAction::Rename + || action == ProjectAction::RemoveFile; + } + + return ProjectNode::supportsAction(action, node); } bool ROSProjectNode::addFiles(const QStringList &filePaths, QStringList *notAdded) @@ -99,7 +99,7 @@ bool ROSProjectNode::renameFile(const QString &filePath, const QString &newFileP return true; } -ROSFolderNode::ROSFolderNode(const Utils::FileName &folderPath, const QString &displayName) : FolderNode(folderPath, ProjectExplorer::NodeType::Folder, displayName), m_repository(nullptr) +ROSFolderNode::ROSFolderNode(const Utils::FilePath &folderPath) : FolderNode(folderPath), m_repository(nullptr) { QString path = this->filePath().toString(); @@ -117,7 +117,7 @@ QString ROSFolderNode::displayName() const if (m_repository) { QString path = this->filePath().toString(); - QString name = Utils::FileName::fromString(path).fileName(); + QString name = Utils::FilePath::fromString(path).fileName(); return QString::fromLatin1("%1 [%2]").arg(name, m_repository->vcsTopic(path)); } else diff --git a/src/project_manager/ros_project_nodes.h b/src/project_manager/ros_project_nodes.h index 9a649443..e4621e09 100644 --- a/src/project_manager/ros_project_nodes.h +++ b/src/project_manager/ros_project_nodes.h @@ -39,7 +39,7 @@ namespace Internal { class ROSProjectNode : public ProjectExplorer::ProjectNode { public: - explicit ROSProjectNode(const Utils::FileName &projectFilePath); + explicit ROSProjectNode(const Utils::FilePath &projectFilePath); bool showInSimpleTree() const override; @@ -54,14 +54,14 @@ class ROSProjectNode : public ProjectExplorer::ProjectNode bool renameFile(const QString &filePath, const QString &newFilePath) override; private: - static ProjectExplorer::FileNode *findFileNode(FolderNode *folder_node, const Utils::FileName &filePaths); + static ProjectExplorer::FileNode *findFileNode(FolderNode *folder_node, const Utils::FilePath &filePaths); }; typedef std::unique_ptr ROSProjectNodeUPtr; class ROSFolderNode: public ProjectExplorer::FolderNode { public: - explicit ROSFolderNode(const Utils::FileName &folderPath, const QString &displayName); + explicit ROSFolderNode(const Utils::FilePath &folderPath); QString displayName() const override; diff --git a/src/project_manager/ros_project_plugin.cpp b/src/project_manager/ros_project_plugin.cpp index 7f10eb47..c85cf410 100644 --- a/src/project_manager/ros_project_plugin.cpp +++ b/src/project_manager/ros_project_plugin.cpp @@ -95,6 +95,8 @@ class ROSProjectPluginPrivate settingsPage(new ROSSettingsPage(settings)) { settings->fromSettings(ICore::settings()); + + runDebugWorkerFactory.addSupportedRunMode(ProjectExplorer::Constants::DEBUG_RUN_MODE); } ROSRunConfigurationFactory runConfigFactory; @@ -104,6 +106,9 @@ class ROSProjectPluginPrivate ROSTestStepFactory rosTestStepFactory; ROSCatkinTestResultsStepFactory rosCatkinTestResultsStepFactory; + SimpleRunWorkerFactory runWorkerFactory; + SimpleRunWorkerFactory runDebugWorkerFactory; + ROSBuildConfigurationFactory buildConfigFactory; ROSCatkinMakeStepFactory catkinMakeStepFactory; ROSCatkinToolsStepFactory catkinToolsStepFactory; @@ -256,9 +261,9 @@ void ROSProjectPlugin::reloadProjectBuildInfo() void ROSProjectPlugin::removeProjectDirectory() { - ProjectExplorer::Node *currentNode = ProjectExplorer::ProjectTree::findCurrentNode(); + ProjectExplorer::Node *currentNode = ProjectExplorer::ProjectTree::currentNode(); - QTC_ASSERT(currentNode && currentNode->nodeType() == ProjectExplorer::NodeType::Folder, return); + QTC_ASSERT(currentNode && currentNode->isFolderNodeType(), return); QString filePath = currentNode->filePath().toString(); RemoveDirectoryDialog removeDirectoryDialog(filePath, ICore::mainWindow()); diff --git a/src/project_manager/ros_project_wizard.cpp b/src/project_manager/ros_project_wizard.cpp index b8578401..f513666b 100644 --- a/src/project_manager/ros_project_wizard.cpp +++ b/src/project_manager/ros_project_wizard.cpp @@ -84,7 +84,7 @@ QString ROSProjectWizardDialog::projectName() const return m_firstPage->projectName(); } -Utils::FileName ROSProjectWizardDialog::distribution() const +Utils::FilePath ROSProjectWizardDialog::distribution() const { return m_firstPage->distribution(); } @@ -94,7 +94,7 @@ ROSUtils::BuildSystem ROSProjectWizardDialog::buildSystem() const return m_firstPage->buildSystem(); } -Utils::FileName ROSProjectWizardDialog::workspaceDirectory() const +Utils::FilePath ROSProjectWizardDialog::workspaceDirectory() const { return m_firstPage->workspaceDirectory(); } @@ -159,9 +159,9 @@ QString ROSImportWizardPage::projectName() const return d->m_ui.nameLineEdit->text(); } -Utils::FileName ROSImportWizardPage::distribution() const +Utils::FilePath ROSImportWizardPage::distribution() const { - return Utils::FileName::fromString(d->m_ui.distributionComboBox->currentText()); + return Utils::FilePath::fromString(d->m_ui.distributionComboBox->currentText()); } ROSUtils::BuildSystem ROSImportWizardPage::buildSystem() const @@ -184,9 +184,9 @@ void ROSImportWizardPage::setForceFirstCapitalLetterForFileName(bool b) d->m_ui.nameLineEdit->setForceFirstCapitalLetter(b); } -Utils::FileName ROSImportWizardPage::workspaceDirectory() const +Utils::FilePath ROSImportWizardPage::workspaceDirectory() const { - return Utils::FileName::fromString(d->m_ui.pathChooser->path()); + return Utils::FilePath::fromString(d->m_ui.pathChooser->path()); } void ROSImportWizardPage::slotProjectNameValidChanged() diff --git a/src/project_manager/ros_project_wizard.h b/src/project_manager/ros_project_wizard.h index 674ba3df..4b797194 100644 --- a/src/project_manager/ros_project_wizard.h +++ b/src/project_manager/ros_project_wizard.h @@ -31,10 +31,6 @@ #include -namespace Utils { -class FileName; -} // namespace Utils - namespace ROSProjectManager { namespace Internal { class ROSImportWizardPage; @@ -48,9 +44,9 @@ class ROSProjectWizardDialog : public Core::BaseFileWizard explicit ROSProjectWizardDialog(const Core::BaseFileWizardFactory *factory, QWidget *parent = 0); QString projectName() const; - Utils::FileName distribution() const; + Utils::FilePath distribution() const; ROSUtils::BuildSystem buildSystem() const; - Utils::FileName workspaceDirectory() const; + Utils::FilePath workspaceDirectory() const; ROSImportWizardPage *m_firstPage; }; @@ -69,9 +65,9 @@ class ROSImportWizardPage : public Utils::WizardPage void setForceFirstCapitalLetterForFileName(bool b); QString projectName() const; - Utils::FileName distribution() const; + Utils::FilePath distribution() const; ROSUtils::BuildSystem buildSystem() const; - Utils::FileName workspaceDirectory() const; + Utils::FilePath workspaceDirectory() const; // Validate a base name entry field (potentially containing extension) static bool validateBaseName(const QString &name, QString *errorMessage = 0); diff --git a/src/project_manager/ros_run_configuration.cpp b/src/project_manager/ros_run_configuration.cpp index 7583aceb..36e27845 100644 --- a/src/project_manager/ros_run_configuration.cpp +++ b/src/project_manager/ros_run_configuration.cpp @@ -133,10 +133,6 @@ ROSRunConfigurationFactory::ROSRunConfigurationFactory() : registerRunConfiguration(ROS_RC_ID); addSupportedProjectType(Constants::ROS_PROJECT_ID); addSupportedTargetDeviceType(ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE); - -// addRunWorkerFactory(ProjectExplorer::Constants::NORMAL_RUN_MODE); - addRunWorkerFactory(ProjectExplorer::Constants::NORMAL_RUN_MODE); - addRunWorkerFactory(ProjectExplorer::Constants::DEBUG_RUN_MODE); } ROSRunConfigurationFactory::~ROSRunConfigurationFactory() diff --git a/src/project_manager/ros_run_step.cpp b/src/project_manager/ros_run_step.cpp index 1ac0c71a..fcd97a3f 100644 --- a/src/project_manager/ros_run_step.cpp +++ b/src/project_manager/ros_run_step.cpp @@ -62,7 +62,7 @@ bool RunStepFactory::canHandle(RunStepList *rsl) const if (!m_supportedDeviceTypes.isEmpty()) { ProjectExplorer::Target *target = rsl->target(); QTC_ASSERT(target, return false); - Core::Id deviceType = ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(target->kit()); + Core::Id deviceType = ProjectExplorer::DeviceTypeKitAspect::deviceTypeId(target->kit()); if (!m_supportedDeviceTypes.contains(deviceType)) return false; } diff --git a/src/project_manager/ros_settings_page.cpp b/src/project_manager/ros_settings_page.cpp index 0b0e3862..e7a9c383 100644 --- a/src/project_manager/ros_settings_page.cpp +++ b/src/project_manager/ros_settings_page.cpp @@ -47,15 +47,15 @@ namespace Internal { ROSSettings::ROSSettings() { m_system_distributions.clear(); - Utils::FileName ros_path = Utils::FileName::fromString(Constants::ROS_INSTALL_DIRECTORY); + Utils::FilePath ros_path = Utils::FilePath::fromString(Constants::ROS_INSTALL_DIRECTORY); if (ros_path.exists()) { QDir ros_opt(ros_path.toString()); ros_opt.setFilter(QDir::NoDotAndDotDot | QDir::Dirs); for (auto entry : ros_opt.entryList()) { - Utils::FileName path = Utils::FileName::fromString(QLatin1String(ROSProjectManager::Constants::ROS_INSTALL_DIRECTORY)); - path.appendPath(entry); + Utils::FilePath path = Utils::FilePath::fromString(QLatin1String(ROSProjectManager::Constants::ROS_INSTALL_DIRECTORY)); + path = path.pathAppended(entry); m_system_distributions.append(path); } } diff --git a/src/project_manager/ros_settings_page.h b/src/project_manager/ros_settings_page.h index 4af7159a..044f56a0 100644 --- a/src/project_manager/ros_settings_page.h +++ b/src/project_manager/ros_settings_page.h @@ -58,7 +58,7 @@ struct ROSSettings bool operator!=(const ROSSettings &s) const { return !equals(s); } private: - QList m_system_distributions; + QList m_system_distributions; }; class ROSSettingsWidget : public QWidget diff --git a/src/project_manager/ros_utils.cpp b/src/project_manager/ros_utils.cpp index 889220a3..79d0f8bb 100644 --- a/src/project_manager/ros_utils.cpp +++ b/src/project_manager/ros_utils.cpp @@ -59,9 +59,9 @@ QString ROSUtils::buildTypeName(const ROSUtils::BuildType &buildType) } } -bool ROSUtils::sourceROS(QProcess *process, const Utils::FileName &rosDistribution) +bool ROSUtils::sourceROS(QProcess *process, const Utils::FilePath &rosDistribution) { - bool results = sourceWorkspaceHelper(process, Utils::FileName(rosDistribution).appendPath(QLatin1String("setup.bash")).toString()); + bool results = sourceWorkspaceHelper(process, Utils::FilePath(rosDistribution).pathAppended(QLatin1String("setup.bash")).toString()); if (!results) Core::MessageManager::write(QObject::tr("[ROS Warning] Faild to source ROS Distribution: %1.").arg(rosDistribution.toString())); @@ -73,11 +73,11 @@ bool ROSUtils::sourceWorkspace(QProcess *process, const WorkspaceInfo &workspace if (!initializeWorkspace(process, workspaceInfo)) return false; - Utils::FileName bash(workspaceInfo.develPath); + Utils::FilePath bash(workspaceInfo.develPath); if (workspaceInfo.install) - bash = Utils::FileName(workspaceInfo.installPath); + bash = Utils::FilePath(workspaceInfo.installPath); - bash.appendPath(QLatin1String("setup.bash")); + bash = bash.pathAppended(QLatin1String("setup.bash")); if (bash.exists()) { Core::MessageManager::write(QObject::tr("[ROS Debug] Sourced workspace: %1.").arg(bash.toString())); @@ -99,10 +99,10 @@ bool ROSUtils::isWorkspaceInitialized(const WorkspaceInfo &workspaceInfo) switch (workspaceInfo.buildSystem) { case ROSUtils::CatkinMake: { - Utils::FileName topCMake(workspaceInfo.sourcePath); - topCMake.appendPath(QLatin1String("CMakeLists.txt")); - Utils::FileName catkin_workspace(workspaceInfo.path); - catkin_workspace.appendPath(QLatin1String(".catkin_workspace")); + Utils::FilePath topCMake(workspaceInfo.sourcePath); + topCMake = topCMake.pathAppended(QLatin1String("CMakeLists.txt")); + Utils::FilePath catkin_workspace(workspaceInfo.path); + catkin_workspace = catkin_workspace.pathAppended(QLatin1String(".catkin_workspace")); if (topCMake.exists() && catkin_workspace.exists() && workspaceInfo.sourcePath.exists()) return true; @@ -111,8 +111,8 @@ bool ROSUtils::isWorkspaceInitialized(const WorkspaceInfo &workspaceInfo) } case ROSUtils::CatkinTools: { - Utils::FileName catkin_tools(workspaceInfo.path); - catkin_tools.appendPath(QLatin1String(".catkin_tools")); + Utils::FilePath catkin_tools(workspaceInfo.path); + catkin_tools = catkin_tools.pathAppended(QLatin1String(".catkin_tools")); if (catkin_tools.exists() && workspaceInfo.sourcePath.exists()) return true; @@ -261,11 +261,11 @@ bool ROSUtils::buildWorkspace(QProcess *process, const WorkspaceInfo &workspaceI return false; } -QList ROSUtils::installedDistributions() +QList ROSUtils::installedDistributions() { QSharedPointer ros_settings = ROSProjectPlugin::instance()->settings(); - Utils::FileName custom_ros_path = Utils::FileName::fromString(ros_settings->custom_dist_path); - QList distributions; + Utils::FilePath custom_ros_path = Utils::FilePath::fromString(ros_settings->custom_dist_path); + QList distributions; if(custom_ros_path.exists()) { QDir custom_dir(custom_ros_path.toString()); @@ -273,11 +273,10 @@ QList ROSUtils::installedDistributions() custom_dir.setFilter(QDir::NoDotAndDotDot | QDir::Dirs); for (auto entry : custom_dir.entryList()) { - Utils::FileName path(custom_ros_path); - path.appendPath(entry); + Utils::FilePath path(custom_ros_path); + path = path.pathAppended(entry); - Utils::FileName setup_file = path; - setup_file.appendString(QString("/setup.bash")); + Utils::FilePath setup_file = path.pathAppended(QLatin1String("setup.bash")); if (setup_file.exists()) { @@ -286,7 +285,7 @@ QList ROSUtils::installedDistributions() } } - Utils::FileName default_ros_path = Utils::FileName::fromString(ros_settings->default_dist_path); + Utils::FilePath default_ros_path = Utils::FilePath::fromString(ros_settings->default_dist_path); if (default_ros_path.exists()) { QDir ros_opt(default_ros_path.toString()); @@ -294,11 +293,10 @@ QList ROSUtils::installedDistributions() ros_opt.setFilter(QDir::NoDotAndDotDot | QDir::Dirs); for (auto entry : ros_opt.entryList()) { - Utils::FileName path = Utils::FileName::fromString(QLatin1String(ROSProjectManager::Constants::ROS_INSTALL_DIRECTORY)); - path.appendPath(entry); + Utils::FilePath path = Utils::FilePath::fromString(QLatin1String(ROSProjectManager::Constants::ROS_INSTALL_DIRECTORY)); + path = path.pathAppended(entry); - Utils::FileName setup_file = path; - setup_file.appendString(QString("/setup.bash")); + Utils::FilePath setup_file = path.pathAppended(QLatin1String("setup.bash")); if (setup_file.exists()) { @@ -361,7 +359,7 @@ bool ROSUtils::gererateQtCreatorWorkspaceFile(QXmlStreamWriter &xmlFile, const R return xmlFile.hasError(); } -bool ROSUtils::parseQtCreatorWorkspaceFile(const Utils::FileName &filePath, ROSProjectFileContent &content) +bool ROSUtils::parseQtCreatorWorkspaceFile(const Utils::FilePath &filePath, ROSProjectFileContent &content) { QXmlStreamReader workspaceXml; QFile workspaceFile(filePath.toString()); @@ -374,11 +372,11 @@ bool ROSUtils::parseQtCreatorWorkspaceFile(const Utils::FileName &filePath, ROSP { if (workspaceXml.name() == QLatin1String("Distribution")) { - QList distributions = ROSUtils::installedDistributions(); + QList distributions = ROSUtils::installedDistributions(); QXmlStreamAttributes attributes = workspaceXml.attributes(); if (attributes.hasAttribute(QLatin1String("path"))) { - content.distribution = Utils::FileName::fromString(attributes.value(QLatin1String("path")).toString()); + content.distribution = Utils::FilePath::fromString(attributes.value(QLatin1String("path")).toString()); if (!distributions.empty() && !distributions.contains(content.distribution)) { Core::MessageManager::write(QObject::tr("[ROS Error] Project file distribution [%1] is not installed. Setting to [%2], if incorrect modify project file [%3].").arg(content.distribution.toString(), distributions.first().toString(), filePath.fileName())); @@ -454,7 +452,7 @@ ROSUtils::FolderContent ROSUtils::getFolderContent(const QString &folder, const return content; } -QHash ROSUtils::getFolderContentRecurisve(const Utils::FileName &folderPath, QStringList &fileList, QStringList& directoryList) +QHash ROSUtils::getFolderContentRecurisve(const Utils::FilePath &folderPath, QStringList &fileList, QStringList& directoryList) { QHash workspaceFiles; @@ -482,7 +480,7 @@ QHash ROSUtils::getFolderContentRecurisve(cons { folder = itSrc.next(); - QString folder_name = Utils::FileName::fromString(folder).fileName(); + QString folder_name = Utils::FilePath::fromString(folder).fileName(); bool found = false; for (auto filter : folderNameFilters) { @@ -533,7 +531,7 @@ ROSUtils::PackageInfoMap ROSUtils::getWorkspacePackageInfo(const WorkspaceInfo & while (it.hasNext()) { it.next(); - Utils::FileName pkgXml = Utils::FileName::fromString(it.value()).appendPath("package.xml"); + Utils::FilePath pkgXml = Utils::FilePath::fromString(it.value()).pathAppended("package.xml"); ROSUtils::PackageInfo packageInfo; ROSPackageXmlParser pkgParser; if (pkgParser.parsePackageXml(pkgXml, packageInfo)) @@ -570,14 +568,12 @@ ROSUtils::PackageBuildInfoMap ROSUtils::getWorkspacePackageBuildInfo(const Works if (findPackageBuildDirectory(workspaceInfo, package, buildInfo.path)) { // Get package's code block file - buildInfo.cbpFile = buildInfo.path; - buildInfo.cbpFile.appendPath(QString("%1.cbp").arg(package.name)); + buildInfo.cbpFile = buildInfo.path.pathAppended(QString("%1.cbp").arg(package.name)); // If does not exist for default Project.cbp file if (!buildInfo.cbpFile.exists()) { - Utils::FileName temp = buildInfo.path; - temp.appendPath("Project.cbp"); + Utils::FilePath temp = buildInfo.path.pathAppended("Project.cbp"); if (temp.exists()) buildInfo.cbpFile = temp; } @@ -639,11 +635,11 @@ bool ROSUtils::parseCodeBlocksFile(const WorkspaceInfo &workspaceInfo, ROSUtils: buildInfo.targets.clear(); // build time include directory - Utils::FileName buildtimeInclude(workspaceInfo.develPath); + Utils::FilePath buildtimeInclude(workspaceInfo.develPath); if (workspaceInfo.install) - buildtimeInclude = Utils::FileName(workspaceInfo.installPath); + buildtimeInclude = Utils::FilePath(workspaceInfo.installPath); - buildtimeInclude = buildtimeInclude.appendPath(QLatin1String("include")); + buildtimeInclude = buildtimeInclude.pathAppended(QLatin1String("include")); cbpXml.setDevice(&cbpFile); cbpXml.readNext(); @@ -731,13 +727,13 @@ bool ROSUtils::parseCodeBlocksFile(const WorkspaceInfo &workspaceInfo, ROSUtils: PackageTargetInfo targetInfo; targetInfo.name = targetName; targetInfo.type = targetType; - targetInfo.flagsFile = Utils::FileName::fromString(targetWorkingDir).appendPath("CMakeFiles").appendPath(QString("%1.dir").arg(targetName)).appendPath("flags.make"); + targetInfo.flagsFile = Utils::FilePath::fromString(targetWorkingDir).pathAppended("CMakeFiles").pathAppended(QString("%1.dir").arg(targetName)).pathAppended("flags.make"); if (!targetInfo.flagsFile.exists()) { QDirIterator it(buildInfo.path.toString(), QStringList() << QString("%1.dir").arg(targetName), QDir::NoFilter, QDirIterator::Subdirectories); while (it.hasNext()) { - Utils::FileName found_path = Utils::FileName::fromString(it.next()).appendPath("flags.make"); + Utils::FilePath found_path = Utils::FilePath::fromString(it.next()).pathAppended("flags.make"); if (found_path.exists()) { targetInfo.flagsFile = found_path; @@ -939,27 +935,27 @@ QMap ROSUtils::getROSPackageExecutables(const QString &package return QMap(); } -Utils::FileName ROSUtils::getCatkinToolsProfilesPath(const Utils::FileName &workspaceDir) +Utils::FilePath ROSUtils::getCatkinToolsProfilesPath(const Utils::FilePath &workspaceDir) { - Utils::FileName profiles(workspaceDir); - profiles.appendPath(QLatin1String(".catkin_tools")); - profiles.appendPath(QLatin1String("profiles")); + Utils::FilePath profiles(workspaceDir); + profiles = profiles.pathAppended(QLatin1String(".catkin_tools")); + profiles = profiles.pathAppended(QLatin1String("profiles")); return profiles; } -Utils::FileName ROSUtils::getCatkinToolsProfilesYamlFile(const Utils::FileName &workspaceDir) +Utils::FilePath ROSUtils::getCatkinToolsProfilesYamlFile(const Utils::FilePath &workspaceDir) { - Utils::FileName profiles = getCatkinToolsProfilesPath(workspaceDir); - profiles.appendPath(QLatin1String("profiles.yaml")); + Utils::FilePath profiles = getCatkinToolsProfilesPath(workspaceDir); + profiles = profiles.pathAppended(QLatin1String("profiles.yaml")); return profiles; } -bool ROSUtils::setCatkinToolsProfilesYamlFile(const Utils::FileName &workspaceDir, +bool ROSUtils::setCatkinToolsProfilesYamlFile(const Utils::FilePath &workspaceDir, const QString &profileName) { YAML::Node config; - Utils::FileName profiles = getCatkinToolsProfilesYamlFile(workspaceDir); + Utils::FilePath profiles = getCatkinToolsProfilesYamlFile(workspaceDir); if (profiles.exists()) config = YAML::LoadFile(profiles.toString().toStdString()); @@ -976,21 +972,21 @@ bool ROSUtils::setCatkinToolsProfilesYamlFile(const Utils::FileName &workspaceDi return true; } -Utils::FileName ROSUtils::getCatkinToolsProfilePath(const Utils::FileName &workspaceDir, const QString &profileName) +Utils::FilePath ROSUtils::getCatkinToolsProfilePath(const Utils::FilePath &workspaceDir, const QString &profileName) { - Utils::FileName profile = getCatkinToolsProfilesPath(workspaceDir); - profile.appendPath(profileName); + Utils::FilePath profile = getCatkinToolsProfilesPath(workspaceDir); + profile = profile.pathAppended(profileName); return profile; } -Utils::FileName ROSUtils::getCatkinToolsProfileConfigFile(const Utils::FileName &workspaceDir, const QString &profileName) +Utils::FilePath ROSUtils::getCatkinToolsProfileConfigFile(const Utils::FilePath &workspaceDir, const QString &profileName) { - Utils::FileName profile = getCatkinToolsProfilePath(workspaceDir, profileName); - profile.appendPath("config.yaml"); + Utils::FilePath profile = getCatkinToolsProfilePath(workspaceDir, profileName); + profile = profile.pathAppended("config.yaml"); return profile; } -bool ROSUtils::isCatkinToolsProfileConfigValid(const Utils::FileName& configPath) +bool ROSUtils::isCatkinToolsProfileConfigValid(const Utils::FilePath& configPath) { if (!configPath.exists()) return false; @@ -1020,13 +1016,13 @@ bool ROSUtils::isCatkinToolsProfileConfigValid(const Utils::FileName& configPath return true; } -bool ROSUtils::removeCatkinToolsProfile(const Utils::FileName &workspaceDir, const QString &profileName) +bool ROSUtils::removeCatkinToolsProfile(const Utils::FilePath &workspaceDir, const QString &profileName) { QString activeProfile = getCatkinToolsActiveProfile(workspaceDir); if( activeProfile.length() ) { - Utils::FileName profiles = getCatkinToolsProfilePath(workspaceDir, profileName); + Utils::FilePath profiles = getCatkinToolsProfilePath(workspaceDir, profileName); QDir d(profiles.toString()); if (d.exists()) { @@ -1041,9 +1037,9 @@ bool ROSUtils::removeCatkinToolsProfile(const Utils::FileName &workspaceDir, con return true; } -bool ROSUtils::renameCatkinToolsProfile(const Utils::FileName &workspaceDir, const QString &oldProfileName, const QString &newProfileName) +bool ROSUtils::renameCatkinToolsProfile(const Utils::FilePath &workspaceDir, const QString &oldProfileName, const QString &newProfileName) { - Utils::FileName profile = getCatkinToolsProfilePath(workspaceDir, oldProfileName); + Utils::FilePath profile = getCatkinToolsProfilePath(workspaceDir, oldProfileName); QDir d(profile.toString()); if (d.exists()) return d.rename(oldProfileName, newProfileName); @@ -1051,9 +1047,9 @@ bool ROSUtils::renameCatkinToolsProfile(const Utils::FileName &workspaceDir, con return createCatkinToolsProfile(workspaceDir, newProfileName, true); } -bool ROSUtils::createCatkinToolsProfile(const Utils::FileName &workspaceDir, const QString profileName, bool overwrite) +bool ROSUtils::createCatkinToolsProfile(const Utils::FilePath &workspaceDir, const QString profileName, bool overwrite) { - Utils::FileName config = getCatkinToolsProfileConfigFile(workspaceDir, profileName); + Utils::FilePath config = getCatkinToolsProfileConfigFile(workspaceDir, profileName); QDir().mkpath(getCatkinToolsProfilePath(workspaceDir, profileName).toString()); if (overwrite) @@ -1067,10 +1063,10 @@ bool ROSUtils::createCatkinToolsProfile(const Utils::FileName &workspaceDir, con QFile::WriteGroup)); } -bool ROSUtils::cloneCatkinToolsProfile(const Utils::FileName &workspaceDir, const QString &profileName, const QString &newProfileName) +bool ROSUtils::cloneCatkinToolsProfile(const Utils::FilePath &workspaceDir, const QString &profileName, const QString &newProfileName) { - Utils::FileName copyConfig = getCatkinToolsProfileConfigFile(workspaceDir, profileName); - Utils::FileName newConfig = getCatkinToolsProfileConfigFile(workspaceDir, newProfileName); + Utils::FilePath copyConfig = getCatkinToolsProfileConfigFile(workspaceDir, profileName); + Utils::FilePath newConfig = getCatkinToolsProfileConfigFile(workspaceDir, newProfileName); if (!isCatkinToolsProfileConfigValid(copyConfig)) return createCatkinToolsProfile(workspaceDir, profileName, true); @@ -1079,10 +1075,10 @@ bool ROSUtils::cloneCatkinToolsProfile(const Utils::FileName &workspaceDir, cons return QFile::copy(copyConfig.toString(), newConfig.toString()); } -QString ROSUtils::getCatkinToolsActiveProfile(const Utils::FileName &workspaceDir) +QString ROSUtils::getCatkinToolsActiveProfile(const Utils::FilePath &workspaceDir) { QString activeProfile; - Utils::FileName profiles = getCatkinToolsProfilesYamlFile(workspaceDir); + Utils::FilePath profiles = getCatkinToolsProfilesYamlFile(workspaceDir); if (profiles.exists()) { YAML::Node config = YAML::LoadFile(profiles.toString().toStdString()); @@ -1094,7 +1090,7 @@ QString ROSUtils::getCatkinToolsActiveProfile(const Utils::FileName &workspaceDi return activeProfile; } -QString ROSUtils::setCatkinToolsDefaultProfile(const Utils::FileName &workspaceDir) +QString ROSUtils::setCatkinToolsDefaultProfile(const Utils::FilePath &workspaceDir) { QString defaultProfile("default"); @@ -1104,7 +1100,7 @@ QString ROSUtils::setCatkinToolsDefaultProfile(const Utils::FileName &workspaceD return defaultProfile; } -bool ROSUtils::setCatkinToolsActiveProfile(const Utils::FileName &workspaceDir, const QString &profileName) +bool ROSUtils::setCatkinToolsActiveProfile(const Utils::FilePath &workspaceDir, const QString &profileName) { // Create profiles directory if it does not exist QDir().mkpath(getCatkinToolsProfilesPath(workspaceDir).toString()); @@ -1118,9 +1114,9 @@ bool ROSUtils::setCatkinToolsActiveProfile(const Utils::FileName &workspaceDir, return true; } -QStringList ROSUtils::getCatkinToolsProfileNames(const Utils::FileName &workspaceDir) +QStringList ROSUtils::getCatkinToolsProfileNames(const Utils::FilePath &workspaceDir) { - Utils::FileName profiles = getCatkinToolsProfilesPath(workspaceDir); + Utils::FilePath profiles = getCatkinToolsProfilesPath(workspaceDir); if (profiles.exists()) { QDir d(profiles.toString()); @@ -1134,9 +1130,9 @@ QStringList ROSUtils::getCatkinToolsProfileNames(const Utils::FileName &workspac return QStringList() << QLatin1String("default"); } -Utils::FileName ROSUtils::getCatkinToolsProfile(const Utils::FileName &workspaceDir, const QString &profileName) +Utils::FilePath ROSUtils::getCatkinToolsProfile(const Utils::FilePath &workspaceDir, const QString &profileName) { - Utils::FileName profile = ROSUtils::getCatkinToolsProfileConfigFile(workspaceDir, profileName); + Utils::FilePath profile = ROSUtils::getCatkinToolsProfileConfigFile(workspaceDir, profileName); if(!isCatkinToolsProfileConfigValid(profile)) createCatkinToolsProfile(workspaceDir, profileName, true); @@ -1159,9 +1155,9 @@ QString ROSUtils::getCMakeBuildTypeArgument(ROSUtils::BuildType &buildType) } } -ROSUtils::WorkspaceInfo ROSUtils::getWorkspaceInfo(const Utils::FileName &workspaceDir, +ROSUtils::WorkspaceInfo ROSUtils::getWorkspaceInfo(const Utils::FilePath &workspaceDir, const BuildSystem &buildSystem, - const Utils::FileName &rosDistribution) + const Utils::FilePath &rosDistribution) { WorkspaceInfo space; space.path = workspaceDir; @@ -1171,11 +1167,11 @@ ROSUtils::WorkspaceInfo ROSUtils::getWorkspaceInfo(const Utils::FileName &worksp switch(buildSystem) { case CatkinMake: { - space.sourcePath = Utils::FileName(workspaceDir).appendPath("src"); - space.buildPath = Utils::FileName(workspaceDir).appendPath("build"); - space.develPath = Utils::FileName(workspaceDir).appendPath("devel"); - space.installPath = Utils::FileName(workspaceDir).appendPath("install"); - space.logPath = Utils::FileName(workspaceDir).appendPath("logs"); + space.sourcePath = Utils::FilePath(workspaceDir).pathAppended("src"); + space.buildPath = Utils::FilePath(workspaceDir).pathAppended("build"); + space.develPath = Utils::FilePath(workspaceDir).pathAppended("devel"); + space.installPath = Utils::FilePath(workspaceDir).pathAppended("install"); + space.logPath = Utils::FilePath(workspaceDir).pathAppended("logs"); space.install = false; //TODO: Need to find how best to determine if installing break; } @@ -1186,16 +1182,16 @@ ROSUtils::WorkspaceInfo ROSUtils::getWorkspaceInfo(const Utils::FileName &worksp if( activeProfile.length() ) { - Utils::FileName configPath = getCatkinToolsProfileConfigFile(workspaceDir, activeProfile); + Utils::FilePath configPath = getCatkinToolsProfileConfigFile(workspaceDir, activeProfile); if (!isCatkinToolsProfileConfigValid(configPath)) createCatkinToolsProfile(workspaceDir, activeProfile, true); config = YAML::LoadFile(configPath.toString().toStdString()); - space.sourcePath = Utils::FileName(workspaceDir).appendPath(QString::fromStdString(config["source_space"].as())); - space.buildPath = Utils::FileName(workspaceDir).appendPath(QString::fromStdString(config["build_space"].as())); - space.develPath = Utils::FileName(workspaceDir).appendPath(QString::fromStdString(config["devel_space"].as())); - space.installPath = Utils::FileName(workspaceDir).appendPath(QString::fromStdString(config["install_space"].as())); - space.logPath = Utils::FileName(workspaceDir).appendPath(QString::fromStdString(config["log_space"].as())); + space.sourcePath = Utils::FilePath(workspaceDir).pathAppended(QString::fromStdString(config["source_space"].as())); + space.buildPath = Utils::FilePath(workspaceDir).pathAppended(QString::fromStdString(config["build_space"].as())); + space.develPath = Utils::FilePath(workspaceDir).pathAppended(QString::fromStdString(config["devel_space"].as())); + space.installPath = Utils::FilePath(workspaceDir).pathAppended(QString::fromStdString(config["install_space"].as())); + space.logPath = Utils::FilePath(workspaceDir).pathAppended(QString::fromStdString(config["log_space"].as())); space.install = config["install"].as(); } else @@ -1203,17 +1199,17 @@ ROSUtils::WorkspaceInfo ROSUtils::getWorkspaceInfo(const Utils::FileName &worksp // TODO: This is temporary fix since at time of CatkinTools.workspace creation // . is created instead of src // which causes random crash in file watcher reading "." instead of "src" - space.sourcePath = Utils::FileName(workspaceDir).appendPath(QString::fromStdString("src")); + space.sourcePath = Utils::FilePath(workspaceDir).pathAppended(QString::fromStdString("src")); } break; } case Colcon: { - space.sourcePath = Utils::FileName(workspaceDir).appendPath("src"); - space.buildPath = Utils::FileName(workspaceDir).appendPath("build"); - space.develPath = Utils::FileName(workspaceDir).appendPath("install"); // Colcon does not have devel space setting to install - space.installPath = Utils::FileName(workspaceDir).appendPath("install"); - space.logPath = Utils::FileName(workspaceDir).appendPath("log"); + space.sourcePath = Utils::FilePath(workspaceDir).pathAppended("src"); + space.buildPath = Utils::FilePath(workspaceDir).pathAppended("build"); + space.develPath = Utils::FilePath(workspaceDir).pathAppended("install"); // Colcon does not have devel space setting to install + space.installPath = Utils::FilePath(workspaceDir).pathAppended("install"); + space.logPath = Utils::FilePath(workspaceDir).pathAppended("log"); space.install = true; // Calcon always uses the install space. break; } @@ -1237,7 +1233,7 @@ QProcessEnvironment ROSUtils::getWorkspaceEnvironment(const WorkspaceInfo &works return env; } -bool ROSUtils::findPackageBuildDirectory(const WorkspaceInfo &workspaceInfo, const PackageInfo &packageInfo, Utils::FileName &packageBuildPath) +bool ROSUtils::findPackageBuildDirectory(const WorkspaceInfo &workspaceInfo, const PackageInfo &packageInfo, Utils::FilePath &packageBuildPath) { packageBuildPath = workspaceInfo.buildPath; switch(workspaceInfo.buildSystem) { @@ -1245,19 +1241,17 @@ bool ROSUtils::findPackageBuildDirectory(const WorkspaceInfo &workspaceInfo, con { QString diff = packageInfo.path.toString(); diff.remove(workspaceInfo.sourcePath.toString()); - packageBuildPath.appendString(diff); + packageBuildPath = packageBuildPath.stringAppended(diff); break; } case CatkinTools: { - packageBuildPath = workspaceInfo.buildPath; - packageBuildPath.appendPath(packageInfo.name); + packageBuildPath = workspaceInfo.buildPath.pathAppended(packageInfo.name); break; } case Colcon: { - packageBuildPath = workspaceInfo.buildPath; - packageBuildPath.appendPath(packageInfo.name); + packageBuildPath = workspaceInfo.buildPath.pathAppended(packageInfo.name); break; } } diff --git a/src/project_manager/ros_utils.h b/src/project_manager/ros_utils.h index 11aaea63..941a6ff6 100644 --- a/src/project_manager/ros_utils.h +++ b/src/project_manager/ros_utils.h @@ -81,22 +81,22 @@ class ROSUtils { /** @brief Contains relavent workspace information */ struct WorkspaceInfo { - Utils::FileName path; - Utils::FileName sourcePath; - Utils::FileName buildPath; - Utils::FileName develPath; - Utils::FileName installPath; - Utils::FileName logPath; + Utils::FilePath path; + Utils::FilePath sourcePath; + Utils::FilePath buildPath; + Utils::FilePath develPath; + Utils::FilePath installPath; + Utils::FilePath logPath; bool install = false; - Utils::FileName rosDistribution; + Utils::FilePath rosDistribution; BuildSystem buildSystem; }; struct PackageTargetInfo { QString name; /**< @brief Target name */ TargetType type; /**< @brief Target type */ - Utils::FileName flagsFile; /**< @brief Path to the Target's flags.cmake file */ + Utils::FilePath flagsFile; /**< @brief Path to the Target's flags.cmake file */ QStringList includes; /**< @brief Target's include directories */ QStringList source_files; /**< @brief Target's source files */ QStringList flags; /**< @brief Target's cxx build flags */ @@ -106,9 +106,9 @@ class ROSUtils { /** @brief Contains all relavent package information */ struct PackageInfo { - Utils::FileName path; /**< @brief Package directory path */ - Utils::FileName filepath; /**< @brief Package package.xml filepath */ - Utils::FileName buildFile; /**< @brief Package CMakeLists.txt filepath */ + Utils::FilePath path; /**< @brief Package directory path */ + Utils::FilePath filepath; /**< @brief Package package.xml filepath */ + Utils::FilePath buildFile; /**< @brief Package CMakeLists.txt filepath */ QString name; /**< @brief Package Name */ QString version; /**< @brief Package Version */ @@ -140,8 +140,8 @@ class ROSUtils { parent = packageInfo; } - Utils::FileName path; /**< @brief Path to the Package's build directory */ - Utils::FileName cbpFile; /**< @brief Path to the Package's CodeBlocks file */ + Utils::FilePath path; /**< @brief Path to the Package's build directory */ + Utils::FilePath cbpFile; /**< @brief Path to the Package's CodeBlocks file */ PackageTargetInfoList targets; /**< @brief List of packages target's */ PackageInfo parent; /**< @brief Package information */ @@ -157,7 +157,7 @@ class ROSUtils { /** @brief Contains project file information */ struct ROSProjectFileContent { - Utils::FileName distribution; /**< @brief ROS Distribution */ + Utils::FilePath distribution; /**< @brief ROS Distribution */ ROSUtils::BuildSystem defaultBuildSystem; /**< @brief Default build system */ QStringList watchDirectories; /**< @brief Watch directories */ }; @@ -175,7 +175,7 @@ class ROSUtils { * @param rosDistribution ROS distribution * @return True if successful, otherwise false */ - static bool sourceROS(QProcess *process, const Utils::FileName &rosDistribution); + static bool sourceROS(QProcess *process, const Utils::FilePath &rosDistribution); /** * @brief Source Workspace @@ -222,7 +222,7 @@ class ROSUtils { * @brief Gets a list of installed ROS Distributions * @return QStringList List of installed ROS distribution names */ - static QList installedDistributions(); + static QList installedDistributions(); /** * @brief Generates/Updates the Qt ROS Project File @@ -238,7 +238,7 @@ class ROSUtils { * @param content Item to populate with data from file * @return True if Qt ROS Project file was succesfully parsed, otherwise false */ - static bool parseQtCreatorWorkspaceFile(const Utils::FileName &filePath, + static bool parseQtCreatorWorkspaceFile(const Utils::FilePath &filePath, ROSProjectFileContent &content); @@ -268,7 +268,7 @@ class ROSUtils { * @param recursive Process sub directoires * @return QHash Directory, FolderContent */ - static QHash getFolderContentRecurisve(const Utils::FileName &folderPath, + static QHash getFolderContentRecurisve(const Utils::FilePath &folderPath, QStringList &fileList, QStringList &directoryList); @@ -278,9 +278,9 @@ class ROSUtils { * @param buildSystem Workspace build system * @return Workspace information */ - static WorkspaceInfo getWorkspaceInfo(const Utils::FileName &workspaceDir, + static WorkspaceInfo getWorkspaceInfo(const Utils::FilePath &workspaceDir, const BuildSystem &buildSystem, - const Utils::FileName &rosDistribution); + const Utils::FilePath &rosDistribution); /** * @brief Get all of the workspace packages and its neccessary information. @@ -338,7 +338,7 @@ class ROSUtils { * @param profileName Profile name * @return True if successful, otherwise false */ - static bool removeCatkinToolsProfile(const Utils::FileName &workspaceDir, + static bool removeCatkinToolsProfile(const Utils::FilePath &workspaceDir, const QString &profileName); /** @@ -348,7 +348,7 @@ class ROSUtils { * @param newProfileName New profile name * @return True if successful, otherwise false */ - static bool renameCatkinToolsProfile(const Utils::FileName &workspaceDir, + static bool renameCatkinToolsProfile(const Utils::FilePath &workspaceDir, const QString &oldProfileName, const QString &newProfileName); @@ -359,7 +359,7 @@ class ROSUtils { * @param newProfileName New profile name. * @return True if successful, otherwise false */ - static bool cloneCatkinToolsProfile(const Utils::FileName &workspaceDir, + static bool cloneCatkinToolsProfile(const Utils::FilePath &workspaceDir, const QString &profileName, const QString &newProfileName); @@ -370,7 +370,7 @@ class ROSUtils { * @param overwrite Indicate if profile should be overwritten if already exists * @return True if successful, otherwise false */ - static bool createCatkinToolsProfile(const Utils::FileName &workspaceDir, + static bool createCatkinToolsProfile(const Utils::FilePath &workspaceDir, const QString profileName, bool overwrite); @@ -379,14 +379,14 @@ class ROSUtils { * @param workspaceDir Workspace directory path * @return True if successful, otherwise false */ - static QString getCatkinToolsActiveProfile(const Utils::FileName &workspaceDir); + static QString getCatkinToolsActiveProfile(const Utils::FilePath &workspaceDir); /** * @brief Set default catkin tools profile * @param workspaceDir Workspace directory path * @return True if successful, otherwise false */ - static QString setCatkinToolsDefaultProfile(const Utils::FileName &workspaceDir); + static QString setCatkinToolsDefaultProfile(const Utils::FilePath &workspaceDir); /** * @brief Set the catkin tools active profile @@ -394,7 +394,7 @@ class ROSUtils { * @param profileName Profile name * @return True if successful, otherwise false */ - static bool setCatkinToolsActiveProfile(const Utils::FileName &workspaceDir, + static bool setCatkinToolsActiveProfile(const Utils::FilePath &workspaceDir, const QString &profileName); /** @@ -402,15 +402,15 @@ class ROSUtils { * @param workspaceDir Workspace directory path * @return QStringList of profile names */ - static QStringList getCatkinToolsProfileNames(const Utils::FileName &workspaceDir); + static QStringList getCatkinToolsProfileNames(const Utils::FilePath &workspaceDir); /** * @brief Get file path to a catkin tools profile * @param workspaceDir Workspace directory path * @param profileName Profile name - * @return Utils::FileName Path to profile + * @return Utils::FilePath Path to profile */ - static Utils::FileName getCatkinToolsProfile(const Utils::FileName &workspaceDir, + static Utils::FilePath getCatkinToolsProfile(const Utils::FilePath &workspaceDir, const QString &profileName); /** @@ -450,9 +450,9 @@ class ROSUtils { /** * @brief Get path to the profiles directory * @param workspaceDir Workspace directory path - * @return Utils::FileName Path to the profiles directory + * @return Utils::FilePath Path to the profiles directory */ - static Utils::FileName getCatkinToolsProfilesPath(const Utils::FileName &workspaceDir); + static Utils::FilePath getCatkinToolsProfilesPath(const Utils::FilePath &workspaceDir); /** * @brief Get the file path for the catkin tools profiles yaml file @@ -460,9 +460,9 @@ class ROSUtils { * This file contains the active profile. * * @param workspaceDir Workspace directory path - * @return Utils::FileName Path to the profiles yaml file + * @return Utils::FilePath Path to the profiles yaml file */ - static Utils::FileName getCatkinToolsProfilesYamlFile(const Utils::FileName &workspaceDir); + static Utils::FilePath getCatkinToolsProfilesYamlFile(const Utils::FilePath &workspaceDir); /** * @brief Set curent profile for the catkin tools profiles yaml file @@ -471,24 +471,24 @@ class ROSUtils { * @param profileName Profile name * @return True if successful, otherwise false. */ - static bool setCatkinToolsProfilesYamlFile(const Utils::FileName &workspaceDir, + static bool setCatkinToolsProfilesYamlFile(const Utils::FilePath &workspaceDir, const QString &profileName); /** * @brief Get the directory path to given profile * @param workspaceDir Workspace directory path * @param profileName Profile name - * @return Utils::FileName Profile directory path + * @return Utils::FilePath Profile directory path */ - static Utils::FileName getCatkinToolsProfilePath(const Utils::FileName &workspaceDir, + static Utils::FilePath getCatkinToolsProfilePath(const Utils::FilePath &workspaceDir, const QString &profileName); /** * @brief Get the file path to given profile's config.yaml file * @param workspaceDir Workspace directory path * @param profileName Profile name - * @return Utils::FileName Path the profile's config.yaml file + * @return Utils::FilePath Path the profile's config.yaml file */ - static Utils::FileName getCatkinToolsProfileConfigFile(const Utils::FileName &workspaceDir, + static Utils::FilePath getCatkinToolsProfileConfigFile(const Utils::FilePath &workspaceDir, const QString &profileName); /** @@ -496,7 +496,7 @@ class ROSUtils { * @param configPath Path to profiles config.yaml file * @return False if the file does not exist or if the contents of the yaml file are not valid. */ - static bool isCatkinToolsProfileConfigValid(const Utils::FileName& configPath); + static bool isCatkinToolsProfileConfigValid(const Utils::FilePath& configPath); /** * @brief Find a given packages build directory @@ -506,7 +506,7 @@ class ROSUtils { */ static bool findPackageBuildDirectory(const WorkspaceInfo &workspaceInfo, const PackageInfo &packageInfo, - Utils::FileName &packageBuildPath); + Utils::FilePath &packageBuildPath); }; } // namespace Internal } // namespace ROSProjectManager