diff options
author | hjk <[email protected]> | 2024-07-19 14:50:13 +0200 |
---|---|---|
committer | hjk <[email protected]> | 2024-07-22 13:27:32 +0000 |
commit | a9ee4ed5e83cfb383c0a44ca0e4bb20aff7aff9a (patch) | |
tree | 045e9275b53ed6064d03af5680ccf9cd9ef61fe6 /src/plugins/nim | |
parent | 750e9c3b6bf761ad76f6035b4428d5b22840b9ba (diff) |
Nim: Hide NimBuildSystem definition in .cpp
Change-Id: Ib6fe898ccb0c58725c336819e4a02a441a304c3a
Reviewed-by: Jarek Kobus <[email protected]>
Diffstat (limited to 'src/plugins/nim')
-rw-r--r-- | src/plugins/nim/project/nimbuildsystem.cpp | 28 | ||||
-rw-r--r-- | src/plugins/nim/project/nimbuildsystem.h | 27 | ||||
-rw-r--r-- | src/plugins/nim/project/nimproject.cpp | 2 |
3 files changed, 30 insertions, 27 deletions
diff --git a/src/plugins/nim/project/nimbuildsystem.cpp b/src/plugins/nim/project/nimbuildsystem.cpp index 373a263ba27..39acc8635d0 100644 --- a/src/plugins/nim/project/nimbuildsystem.cpp +++ b/src/plugins/nim/project/nimbuildsystem.cpp @@ -139,6 +139,29 @@ bool NimProjectScanner::renameFile(const QString &, const QString &to) return true; } +// NimBuildSystem + +class NimBuildSystem final : public BuildSystem +{ +public: + explicit NimBuildSystem(Target *target); + + bool supportsAction(Node *, ProjectAction action, const Node *node) const final; + bool addFiles(Node *node, const FilePaths &filePaths, FilePaths *) final; + RemovedFilesFromProject removeFiles(Node *node, + const FilePaths &filePaths, + FilePaths *) final; + bool deleteFiles(Node *, const FilePaths &) final; + bool renameFile(Node *, const FilePath &oldFilePath, const FilePath &newFilePath) final; + QString name() const final { return QLatin1String("nim"); } + + void triggerParsing() final; + +protected: + ParseGuard m_guard; + NimProjectScanner m_projectScanner; +}; + NimBuildSystem::NimBuildSystem(Target *target) : BuildSystem(target), m_projectScanner(target->project()) { @@ -219,4 +242,9 @@ bool NimBuildSystem::renameFile(Node *, const FilePath &oldFilePath, const FileP return m_projectScanner.renameFile(oldFilePath.toString(), newFilePath.toString()); } +BuildSystem *createNimBuildSystem(Target *target) +{ + return new NimBuildSystem(target); +} + } // namespace Nim diff --git a/src/plugins/nim/project/nimbuildsystem.h b/src/plugins/nim/project/nimbuildsystem.h index f38d067bcd6..8eefbee50f2 100644 --- a/src/plugins/nim/project/nimbuildsystem.h +++ b/src/plugins/nim/project/nimbuildsystem.h @@ -47,31 +47,6 @@ private: Utils::FileSystemWatcher m_directoryWatcher; }; -class NimBuildSystem final : public ProjectExplorer::BuildSystem -{ - Q_OBJECT - -public: - explicit NimBuildSystem(ProjectExplorer::Target *target); - - bool supportsAction(ProjectExplorer::Node *, - ProjectExplorer::ProjectAction action, - const ProjectExplorer::Node *node) const final; - bool addFiles(ProjectExplorer::Node *node, - const Utils::FilePaths &filePaths, Utils::FilePaths *) final; - ProjectExplorer::RemovedFilesFromProject removeFiles(ProjectExplorer::Node *node, - const Utils::FilePaths &filePaths, - Utils::FilePaths *) override; - bool deleteFiles(ProjectExplorer::Node *, const Utils::FilePaths &) final; - bool renameFile(ProjectExplorer::Node *, - const Utils::FilePath &oldFilePath, const Utils::FilePath &newFilePath) final; - QString name() const final { return QLatin1String("nim"); } - - void triggerParsing() override; - -protected: - ParseGuard m_guard; - NimProjectScanner m_projectScanner; -}; +ProjectExplorer::BuildSystem *createNimBuildSystem(ProjectExplorer::Target *target); } // namespace Nim diff --git a/src/plugins/nim/project/nimproject.cpp b/src/plugins/nim/project/nimproject.cpp index 4c97393dc74..33f09d19328 100644 --- a/src/plugins/nim/project/nimproject.cpp +++ b/src/plugins/nim/project/nimproject.cpp @@ -46,7 +46,7 @@ NimProject::NimProject(const FilePath &filePath) : Project(Constants::C_NIM_MIME // ensure debugging is enabled (Nim plugin translates nim code to C code) setProjectLanguages(Core::Context(ProjectExplorer::Constants::CXX_LANGUAGE_ID)); - setBuildSystemCreator<NimBuildSystem>(); + setBuildSystemCreator(&createNimBuildSystem); } Tasks NimProject::projectIssues(const Kit *k) const |