diff options
author | Christian Kandeler <[email protected]> | 2025-02-13 14:23:23 +0100 |
---|---|---|
committer | Christian Kandeler <[email protected]> | 2025-02-17 09:20:43 +0000 |
commit | e72cb86fbd1abecd2b719d94268036aa155600bc (patch) | |
tree | 61e3dd671dd79315d3de999abaf3e0918983eb15 /src/plugins/nim | |
parent | 87fac7232e053b6a21d47ab6c1926eb1419a8524 (diff) |
ProjectExplorer: Allow to retrieve project-specific kit issues
... without a Project object.
Otherwise, we cannot show these issues in the wizard's target setup
page, which is an annoying inconsistency.
Task-number: QTCREATORBUG-32490
Change-Id: I1b654961ad92c44f7219af5c06fab773834b2667
Reviewed-by: Christian Stenger <[email protected]>
Diffstat (limited to 'src/plugins/nim')
-rw-r--r-- | src/plugins/nim/project/nimproject.cpp | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/src/plugins/nim/project/nimproject.cpp b/src/plugins/nim/project/nimproject.cpp index 3c2b1cf620d..ea45a25f4b1 100644 --- a/src/plugins/nim/project/nimproject.cpp +++ b/src/plugins/nim/project/nimproject.cpp @@ -337,8 +337,6 @@ class NimProject final : public Project public: explicit NimProject(const FilePath &filePath); - Tasks projectIssues(const Kit *k) const final; - // Keep for compatibility with Qt Creator 4.10 void toMap(Store &map) const final; @@ -361,20 +359,6 @@ NimProject::NimProject(const FilePath &filePath) : Project(Constants::C_NIM_MIME setBuildSystemCreator<NimBuildSystem>(); } -Tasks NimProject::projectIssues(const Kit *k) const -{ - Tasks result = Project::projectIssues(k); - auto tc = ToolchainKitAspect::toolchain(k, Constants::C_NIMLANGUAGE_ID); - if (!tc) { - result.append(createProjectTask(Task::TaskType::Error, Tr::tr("No Nim compiler set."))); - return result; - } - if (!tc->compilerCommand().exists()) - result.append(createProjectTask(Task::TaskType::Error, Tr::tr("Nim compiler does not exist."))); - - return result; -} - void NimProject::toMap(Store &map) const { Project::toMap(map); @@ -403,7 +387,21 @@ void NimProject::setExcludedFiles(const QStringList &excludedFiles) void setupNimProject() { static const NimBuildConfigurationFactory buildConfigFactory; - ProjectManager::registerProjectType<NimProject>(Constants::C_NIM_PROJECT_MIMETYPE); + const auto issuesGenerator = [](const Kit *k) { + Tasks result; + auto tc = ToolchainKitAspect::toolchain(k, Constants::C_NIMLANGUAGE_ID); + if (!tc) { + result.append( + Project::createTask(Task::TaskType::Error, Tr::tr("No Nim compiler set."))); + return result; + } + if (!tc->compilerCommand().exists()) + result.append( + Project::createTask(Task::TaskType::Error, Tr::tr("Nim compiler does not exist."))); + return result; + }; + ProjectManager::registerProjectType<NimProject>( + Constants::C_NIM_PROJECT_MIMETYPE, issuesGenerator); } } // Nim |