forked from qt-creator/qt-creator
Adds validate kit to toolchain
Change-Id: I5f10509698a8badafeee2295a16e3c2eb9b20fa7 Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
@@ -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 &);
|
||||
|
||||
Reference in New Issue
Block a user