Skip to content

Commit

Permalink
implement file I/O flags in build system
Browse files Browse the repository at this point in the history
  • Loading branch information
christian-rauch committed Jan 22, 2021
1 parent b277c34 commit 1d52d60
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
44 changes: 44 additions & 0 deletions src/project_manager/ros_build_system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,49 @@ void ROSBuildSystem::triggerParsing()
guardParsingRun().markAsSuccess();
}

bool ROSBuildSystem::addFiles(ProjectExplorer::Node *context, const QStringList &filePaths, QStringList *notAdded)
{
return true;
}

ProjectExplorer::RemovedFilesFromProject ROSBuildSystem::removeFiles(ProjectExplorer::Node *context, const QStringList &filePaths, QStringList *notRemoved)
{
return ProjectExplorer::RemovedFilesFromProject::Ok;
}

bool ROSBuildSystem::deleteFiles(ProjectExplorer::Node *context, const QStringList &filePaths)
{
return true;
}

bool ROSBuildSystem::canRenameFile(ProjectExplorer::Node *context, const QString &filePath, const QString &newFilePath)
{
return true;
}

bool ROSBuildSystem::renameFile(ProjectExplorer::Node *context, const QString &filePath, const QString &newFilePath)
{
return true;
}

bool ROSBuildSystem::addDependencies(ProjectExplorer::Node *context, const QStringList &dependencies)
{
return true;
}

bool ROSBuildSystem::supportsAction(ProjectExplorer::Node *context, ProjectExplorer::ProjectAction action, const ProjectExplorer::Node *node) const
{
static const std::set<ProjectAction> possible_actions = {
ProjectAction::AddNewFile,
ProjectAction::AddExistingFile,
ProjectAction::AddExistingDirectory,
ProjectAction::RemoveFile,
ProjectAction::EraseFile,
ProjectAction::Rename,
};

return possible_actions.count(action);
}

} // namespace Internal
} // namespace ROSProjectManager
10 changes: 10 additions & 0 deletions src/project_manager/ros_build_system.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once

#include <projectexplorer/buildsystem.h>
#include <projectexplorer/projectnodes.h>

namespace ROSProjectManager {
namespace Internal {
Expand All @@ -19,6 +20,15 @@ class ROSBuildSystem : public ProjectExplorer::BuildSystem
explicit ROSBuildSystem(ROSBuildConfiguration *bc);

void triggerParsing() final;

virtual bool addFiles(ProjectExplorer::Node *context, const QStringList &filePaths, QStringList *notAdded = nullptr) final;
virtual ProjectExplorer::RemovedFilesFromProject removeFiles(ProjectExplorer::Node *context, const QStringList &filePaths,
QStringList *notRemoved = nullptr) final;
virtual bool deleteFiles(ProjectExplorer::Node *context, const QStringList &filePaths) final;
virtual bool canRenameFile(ProjectExplorer::Node *context, const QString &filePath, const QString &newFilePath) final;
virtual bool renameFile(ProjectExplorer::Node *context, const QString &filePath, const QString &newFilePath) final;
virtual bool addDependencies(ProjectExplorer::Node *context, const QStringList &dependencies) final;
virtual bool supportsAction(ProjectExplorer::Node *context, ProjectExplorer::ProjectAction action, const ProjectExplorer::Node *node) const final;
};

} // namespace Internal
Expand Down

0 comments on commit 1d52d60

Please sign in to comment.