Commit 03398ff8 authored by Michal Klocek's avatar Michal Klocek

Adds validate kit to toolchain

Change-Id: I5f10509698a8badafeee2295a16e3c2eb9b20fa7
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent 2cea4c6f
......@@ -162,9 +162,13 @@ QVariant ToolChainKitInformation::defaultValue(Kit *k) const
QList<Task> ToolChainKitInformation::validate(const Kit *k) const
{
QList<Task> result;
if (!toolChain(k)) {
const ToolChain* toolchain = toolChain(k);
if (!toolchain) {
result << Task(Task::Error, ToolChainKitInformation::msgNoToolChainInTarget(),
Utils::FileName(), -1, Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM));
} else {
result << toolchain->validateKit(k);
}
return result;
}
......
......@@ -31,6 +31,7 @@
#include "abi.h"
#include "toolchainmanager.h"
#include "task.h"
#include <extensionsystem/pluginmanager.h>
#include <utils/environment.h>
......@@ -190,6 +191,15 @@ bool ToolChain::fromMap(const QVariantMap &data)
return true;
}
/*!
\brief Used by the toolchainkitinformation to validate the kit.
*/
QList<Task> ToolChain::validateKit(const Kit */*k*/) const
{
return QList<Task>();
}
/*!
\class ProjectExplorer::ToolChainFactory
\brief Creates toolchains from settings or autodetects them.
......
......@@ -55,6 +55,8 @@ class IOutputParser;
class ToolChainConfigWidget;
class ToolChainFactory;
class ToolChainManager;
class Task;
class Kit;
// --------------------------------------------------------------------------
// ToolChain (documentation inside)
......@@ -104,7 +106,7 @@ public:
// Used by the toolchainmanager to save user-generated tool chains.
// Make sure to call this method when deriving!
virtual QVariantMap toMap() const;
virtual QList<Task> validateKit(const Kit *k) const;
protected:
ToolChain(const QString &id, bool autoDetect);
explicit ToolChain(const ToolChain &);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment