forked from qt-creator/qt-creator
ProjectExplorer: Refactor KitManager::registerKit()
The interface of this function was rather unfortunate. In particluar, the fact that it took ownership of the std::unique_ptr that was passed in required some weird boiler plate code at all the calling sites. Instead, it now becomes a proper factory function. Change-Id: Iecdc6f6345232fc0f0a08bffaf8f1780edb57201 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -44,14 +44,13 @@ namespace Internal {
|
||||
|
||||
void QmlProfilerToolTest::testAttachToWaitingApplication()
|
||||
{
|
||||
auto newKit = std::make_unique<ProjectExplorer::Kit>("fookit");
|
||||
ProjectExplorer::Kit * newKitPtr = newKit.get();
|
||||
ProjectExplorer::KitManager *kitManager = ProjectExplorer::KitManager::instance();
|
||||
QVERIFY(kitManager);
|
||||
QVERIFY(kitManager->registerKit(std::move(newKit)));
|
||||
ProjectExplorer::Kit * const newKit = kitManager->registerKit({}, "fookit");
|
||||
QVERIFY(newKit);
|
||||
QSettings *settings = Core::ICore::settings();
|
||||
QVERIFY(settings);
|
||||
settings->setValue(QLatin1String("AnalyzerQmlAttachDialog/kitId"), newKitPtr->id().toSetting());
|
||||
settings->setValue(QLatin1String("AnalyzerQmlAttachDialog/kitId"), newKit->id().toSetting());
|
||||
|
||||
QmlProfilerTool profilerTool;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user