aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/nim
diff options
context:
space:
mode:
authorhjk <[email protected]>2024-07-22 13:59:55 +0200
committerhjk <[email protected]>2024-07-22 12:07:44 +0000
commit750e9c3b6bf761ad76f6035b4428d5b22840b9ba (patch)
treee36fd4b2273174cf4883bdf9e400540e4344387f /src/plugins/nim
parent0982613a7357822315419b7d60aa43722acabba1 (diff)
Nim: Standardize Project classes setup
Change-Id: If95e98e406c1a9bacd75ccf3b58416185e6152a2 Reviewed-by: Jarek Kobus <[email protected]>
Diffstat (limited to 'src/plugins/nim')
-rw-r--r--src/plugins/nim/nimplugin.cpp6
-rw-r--r--src/plugins/nim/project/nimbleproject.cpp8
-rw-r--r--src/plugins/nim/project/nimbleproject.h11
-rw-r--r--src/plugins/nim/project/nimproject.cpp6
-rw-r--r--src/plugins/nim/project/nimproject.h6
5 files changed, 13 insertions, 24 deletions
diff --git a/src/plugins/nim/nimplugin.cpp b/src/plugins/nim/nimplugin.cpp
index eb1266b6637..10ac5567bdb 100644
--- a/src/plugins/nim/nimplugin.cpp
+++ b/src/plugins/nim/nimplugin.cpp
@@ -61,9 +61,6 @@ public:
NimCodeStyleSettingsPage codeStyleSettingsPage;
NimCodeStylePreferencesFactory codeStylePreferencesPage;
NimToolchainFactory toolChainFactory;
-
- NimProjectFactory nimProjectFactory;
- NimbleProjectFactory nimbleProjectFactory;
};
class NimPlugin final : public ExtensionSystem::IPlugin
@@ -80,6 +77,9 @@ class NimPlugin final : public ExtensionSystem::IPlugin
{
d = new NimPluginPrivate;
+ setupNimProject();
+ setupNimbleProject();
+
#ifdef WITH_TESTS
addTest<NimParserTest>();
#endif
diff --git a/src/plugins/nim/project/nimbleproject.cpp b/src/plugins/nim/project/nimbleproject.cpp
index 5d9d431d688..982ca06514f 100644
--- a/src/plugins/nim/project/nimbleproject.cpp
+++ b/src/plugins/nim/project/nimbleproject.cpp
@@ -17,8 +17,8 @@ using namespace Utils;
namespace Nim {
-NimbleProject::NimbleProject(const Utils::FilePath &fileName)
- : ProjectExplorer::Project(Constants::C_NIMBLE_MIMETYPE, fileName)
+NimbleProject::NimbleProject(const FilePath &fileName)
+ : Project(Constants::C_NIMBLE_MIMETYPE, fileName)
{
setId(Constants::C_NIMBLEPROJECT_ID);
setDisplayName(fileName.completeBaseName());
@@ -50,9 +50,9 @@ void NimbleProject::setExcludedFiles(const QStringList &excludedFiles)
m_excludedFiles = excludedFiles;
}
-// Factory
+// Setup
-NimbleProjectFactory::NimbleProjectFactory()
+void setupNimbleProject()
{
ProjectManager::registerProjectType<NimbleProject>(Constants::C_NIMBLE_MIMETYPE);
}
diff --git a/src/plugins/nim/project/nimbleproject.h b/src/plugins/nim/project/nimbleproject.h
index 7664152c3f4..03d7fb3299a 100644
--- a/src/plugins/nim/project/nimbleproject.h
+++ b/src/plugins/nim/project/nimbleproject.h
@@ -3,15 +3,12 @@
#pragma once
-#include <projectexplorer/buildsystem.h>
#include <projectexplorer/project.h>
namespace Nim {
-class NimbleProject : public ProjectExplorer::Project
+class NimbleProject final : public ProjectExplorer::Project
{
- Q_OBJECT
-
public:
NimbleProject(const Utils::FilePath &filename);
@@ -28,10 +25,6 @@ protected:
QStringList m_excludedFiles;
};
-class NimbleProjectFactory
-{
-public:
- NimbleProjectFactory();
-};
+void setupNimbleProject();
} // Nim
diff --git a/src/plugins/nim/project/nimproject.cpp b/src/plugins/nim/project/nimproject.cpp
index 7773fa36817..4c97393dc74 100644
--- a/src/plugins/nim/project/nimproject.cpp
+++ b/src/plugins/nim/project/nimproject.cpp
@@ -19,7 +19,7 @@ using namespace Utils;
namespace Nim {
-class NimProject : public Project
+class NimProject final : public Project
{
public:
explicit NimProject(const FilePath &filePath);
@@ -86,9 +86,9 @@ void NimProject::setExcludedFiles(const QStringList &excludedFiles)
m_excludedFiles = excludedFiles;
}
-// Factory
+// Setup
-NimProjectFactory::NimProjectFactory()
+void setupNimProject()
{
ProjectManager::registerProjectType<NimProject>(Constants::C_NIM_PROJECT_MIMETYPE);
}
diff --git a/src/plugins/nim/project/nimproject.h b/src/plugins/nim/project/nimproject.h
index 5bdc12f1d58..48e104f7ba3 100644
--- a/src/plugins/nim/project/nimproject.h
+++ b/src/plugins/nim/project/nimproject.h
@@ -5,10 +5,6 @@
namespace Nim {
-class NimProjectFactory
-{
-public:
- NimProjectFactory();
-};
+void setupNimProject();
} // Nim