Commit 5404f9c4 authored by Tobias Hunger's avatar Tobias Hunger
Browse files

CMake: Remove static defaultValue method from CMakeKitInformation



There is no need to expose this.

Change-Id: I164f1e787b742d330282125320b54a5b2ecb6134
Reviewed-by: default avatarTobias Hunger <tobias.hunger@theqtcompany.com>
parent eafb6670
......@@ -39,6 +39,15 @@ using namespace ProjectExplorer;
namespace CMakeProjectManager {
static Core::Id defaultCMakeToolId()
{
CMakeTool *defaultTool = CMakeToolManager::defaultCMakeTool();
if (defaultTool)
return defaultTool->id();
return Core::Id();
}
CMakeKitInformation::CMakeKitInformation()
{
setObjectName(QLatin1String("CMakeKitInformation"));
......@@ -78,22 +87,14 @@ void CMakeKitInformation::setCMakeTool(Kit *k, const Core::Id id)
k->setValue(CMakeKitInformation::id(), id.toSetting());
} else {
//setting a empty Core::Id will reset to the default value
k->setValue(CMakeKitInformation::id(),defaultValue().toSetting());
k->setValue(CMakeKitInformation::id(), defaultCMakeToolId().toSetting());
}
}
Core::Id CMakeKitInformation::defaultValue()
{
CMakeTool *defaultTool = CMakeToolManager::defaultCMakeTool();
if (defaultTool)
return defaultTool->id();
return Core::Id();
}
QVariant CMakeKitInformation::defaultValue(const Kit *) const
QVariant CMakeKitInformation::defaultValue(const Kit *k) const
{
return defaultValue().toSetting();
Core::Id id = k ? defaultCMakeToolId() : Core::Id();
return id.toSetting();
}
QList<Task> CMakeKitInformation::validate(const Kit *k) const
......@@ -108,7 +109,7 @@ void CMakeKitInformation::setup(Kit *k)
if (tool)
return;
setCMakeTool(k, defaultValue());
setCMakeTool(k, defaultCMakeToolId());
}
void CMakeKitInformation::fix(Kit *k)
......
......@@ -43,7 +43,6 @@ public:
static CMakeTool *cmakeTool(const ProjectExplorer::Kit *k);
static void setCMakeTool(ProjectExplorer::Kit *k, const Core::Id id);
static Core::Id defaultValue();
// KitInformation interface
QVariant defaultValue(const ProjectExplorer::Kit *k) const override;
......
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