diff options
author | hjk <hjk@qt.io> | 2020-01-15 08:56:11 +0100 |
---|---|---|
committer | hjk <hjk@qt.io> | 2020-01-20 10:11:59 +0000 |
commit | 0334b6e491a3688f2455e075595afde87b8f76af (patch) | |
tree | cc63a1fae976a46ea6ddc5d2cb956d1d7ac37516 /src/plugins/cmakeprojectmanager/cmakebuildstep.cpp | |
parent | 7e19d1af7c356dae703e110f9d24b75429ef8fb5 (diff) |
ProjectManager: Add convenience Task subclasses
For Compile, BuildSystem and Deployment. Unclutters user code and reduces
binary size.
Change-Id: Ia18e917bb411754162e9f4ec6056d752a020bb50
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/plugins/cmakeprojectmanager/cmakebuildstep.cpp')
-rw-r--r-- | src/plugins/cmakeprojectmanager/cmakebuildstep.cpp | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp b/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp index 7e61373c617..cd899d1070d 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp @@ -141,32 +141,26 @@ bool CMakeBuildStep::init() canInit = false; } if (bc && !bc->isEnabled()) { - emit addTask(Task(Task::Error, - QCoreApplication::translate("CMakeProjectManager::CMakeBuildStep", - "The build configuration is currently disabled."), - Utils::FilePath(), -1, ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)); + emit addTask(BuildSystemTask(Task::Error, + tr("CMakeProjectManager::CMakeBuildStep"))); canInit = false; } CMakeTool *tool = CMakeKitAspect::cmakeTool(target()->kit()); if (!tool || !tool->isValid()) { - emit addTask(Task(Task::Error, + emit addTask(BuildSystemTask(Task::Error, tr("A CMake tool must be set up for building. " - "Configure a CMake tool in the kit options."), - Utils::FilePath(), -1, - ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)); + "Configure a CMake tool in the kit options."))); canInit = false; } RunConfiguration *rc = target()->activeRunConfiguration(); if (isCurrentExecutableTarget(m_buildTarget) && (!rc || rc->buildKey().isEmpty())) { - emit addTask(Task(Task::Error, + emit addTask(BuildSystemTask(Task::Error, QCoreApplication::translate("ProjectExplorer::Task", "You asked to build the current Run Configuration's build target only, " "but it is not associated with a build target. " - "Update the Make Step in your build settings."), - Utils::FilePath(), -1, - ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)); + "Update the Make Step in your build settings."))); canInit = false; } @@ -179,13 +173,11 @@ bool CMakeBuildStep::init() const Utils::FilePath projectDirectory = bc->target()->project()->projectDirectory(); if (bc->buildDirectory() != projectDirectory) { if (projectDirectory.pathAppended("CMakeCache.txt").exists()) { - emit addTask(Task(Task::Warning, + emit addTask(BuildSystemTask(Task::Warning, tr("There is a CMakeCache.txt file in \"%1\", which suggest an " "in-source build was done before. You are now building in \"%2\", " "and the CMakeCache.txt file might confuse CMake.") - .arg(projectDirectory.toUserOutput(), bc->buildDirectory().toUserOutput()), - Utils::FilePath(), -1, - ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)); + .arg(projectDirectory.toUserOutput(), bc->buildDirectory().toUserOutput()))); } } |