forked from qt-creator/qt-creator
CMake: Remove static defaultValue method from CMakeKitInformation
There is no need to expose this. Change-Id: I164f1e787b742d330282125320b54a5b2ecb6134 Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
This commit is contained in:
@@ -39,6 +39,15 @@ using namespace ProjectExplorer;
|
|||||||
|
|
||||||
namespace CMakeProjectManager {
|
namespace CMakeProjectManager {
|
||||||
|
|
||||||
|
static Core::Id defaultCMakeToolId()
|
||||||
|
{
|
||||||
|
CMakeTool *defaultTool = CMakeToolManager::defaultCMakeTool();
|
||||||
|
if (defaultTool)
|
||||||
|
return defaultTool->id();
|
||||||
|
|
||||||
|
return Core::Id();
|
||||||
|
}
|
||||||
|
|
||||||
CMakeKitInformation::CMakeKitInformation()
|
CMakeKitInformation::CMakeKitInformation()
|
||||||
{
|
{
|
||||||
setObjectName(QLatin1String("CMakeKitInformation"));
|
setObjectName(QLatin1String("CMakeKitInformation"));
|
||||||
@@ -78,22 +87,14 @@ void CMakeKitInformation::setCMakeTool(Kit *k, const Core::Id id)
|
|||||||
k->setValue(CMakeKitInformation::id(), id.toSetting());
|
k->setValue(CMakeKitInformation::id(), id.toSetting());
|
||||||
} else {
|
} else {
|
||||||
//setting a empty Core::Id will reset to the default value
|
//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()
|
QVariant CMakeKitInformation::defaultValue(const Kit *k) const
|
||||||
{
|
{
|
||||||
CMakeTool *defaultTool = CMakeToolManager::defaultCMakeTool();
|
Core::Id id = k ? defaultCMakeToolId() : Core::Id();
|
||||||
if (defaultTool)
|
return id.toSetting();
|
||||||
return defaultTool->id();
|
|
||||||
|
|
||||||
return Core::Id();
|
|
||||||
}
|
|
||||||
|
|
||||||
QVariant CMakeKitInformation::defaultValue(const Kit *) const
|
|
||||||
{
|
|
||||||
return defaultValue().toSetting();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<Task> CMakeKitInformation::validate(const Kit *k) const
|
QList<Task> CMakeKitInformation::validate(const Kit *k) const
|
||||||
@@ -108,7 +109,7 @@ void CMakeKitInformation::setup(Kit *k)
|
|||||||
if (tool)
|
if (tool)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
setCMakeTool(k, defaultValue());
|
setCMakeTool(k, defaultCMakeToolId());
|
||||||
}
|
}
|
||||||
|
|
||||||
void CMakeKitInformation::fix(Kit *k)
|
void CMakeKitInformation::fix(Kit *k)
|
||||||
|
|||||||
@@ -43,7 +43,6 @@ public:
|
|||||||
|
|
||||||
static CMakeTool *cmakeTool(const ProjectExplorer::Kit *k);
|
static CMakeTool *cmakeTool(const ProjectExplorer::Kit *k);
|
||||||
static void setCMakeTool(ProjectExplorer::Kit *k, const Core::Id id);
|
static void setCMakeTool(ProjectExplorer::Kit *k, const Core::Id id);
|
||||||
static Core::Id defaultValue();
|
|
||||||
|
|
||||||
// KitInformation interface
|
// KitInformation interface
|
||||||
QVariant defaultValue(const ProjectExplorer::Kit *k) const override;
|
QVariant defaultValue(const ProjectExplorer::Kit *k) const override;
|
||||||
|
|||||||
Reference in New Issue
Block a user