forked from qt-creator/qt-creator
CMake: Do not crash when deleting cmake tools
Do not crash when the cmake tool that was used to parse the project gets removed. Change-Id: Ieda3ae2025dbcfb1f90d9bd01c5f0ed960756c6a Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This commit is contained in:
@@ -83,13 +83,16 @@ Core::Id CMakeKitInformation::id()
|
||||
return TOOL_ID;
|
||||
}
|
||||
|
||||
CMakeTool *CMakeKitInformation::cmakeTool(const Kit *k)
|
||||
Core::Id CMakeKitInformation::cmakeToolId(const Kit *k)
|
||||
{
|
||||
if (!k)
|
||||
return nullptr;
|
||||
return {};
|
||||
return Core::Id::fromSetting(k->value(TOOL_ID));
|
||||
}
|
||||
|
||||
const QVariant id = k->value(TOOL_ID);
|
||||
return CMakeToolManager::findById(Core::Id::fromSetting(id));
|
||||
CMakeTool *CMakeKitInformation::cmakeTool(const Kit *k)
|
||||
{
|
||||
return CMakeToolManager::findById(cmakeToolId(k));
|
||||
}
|
||||
|
||||
void CMakeKitInformation::setCMakeTool(Kit *k, const Core::Id id)
|
||||
|
||||
Reference in New Issue
Block a user