cmakesettingspage: Update model on add/remove CMake tool

Connected signals on add and remove CMake tool from CMake manager to the
appropriate slots of the view's model. Now, the view is updated when CMake
tool added or removed using CMake manager's API.

Task-number: QTCREATORBUG-16396
Change-Id: I913546f7554b6c9baa70237835e5a7e3d9137af7
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
Mashrab Kuvatov
2016-05-30 10:56:12 +02:00
committed by Tobias Hunger
parent 726b907cc3
commit 5ca8a921f6

View File

@@ -150,6 +150,11 @@ CMakeToolItemModel::CMakeToolItemModel()
CMakeTool *defTool = CMakeToolManager::defaultCMakeTool();
m_defaultItemId = defTool ? defTool->id() : Core::Id();
connect(CMakeToolManager::instance(), &CMakeToolManager::cmakeRemoved,
this, &CMakeToolItemModel::removeCMakeTool);
connect(CMakeToolManager::instance(), &CMakeToolManager::cmakeAdded,
this, [this](const Core::Id &id) { addCMakeTool(CMakeToolManager::findById(id), false); });
}
QModelIndex CMakeToolItemModel::addCMakeTool(const QString &name, const FileName &executable, const bool isAutoDetected)