forked from qt-creator/qt-creator
ProjectExplorer: Use a lambda for DeviceFactory::create()
Somewhat slimmer interface on the user code side and follows existing practice. Change-Id: I20ed8f5a00591265d32ea9ce93e1f1bbc76d2437 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -754,17 +754,15 @@ LinuxDeviceFactory::LinuxDeviceFactory()
|
||||
{
|
||||
setDisplayName(LinuxDevice::tr("Generic Linux Device"));
|
||||
setIcon(QIcon());
|
||||
setCanCreate(true);
|
||||
setConstructionFunction(&LinuxDevice::create);
|
||||
setCanCreate(true);
|
||||
setCreator([] {
|
||||
GenericLinuxDeviceConfigurationWizard wizard(Core::ICore::dialogParent());
|
||||
if (wizard.exec() != QDialog::Accepted)
|
||||
return IDevice::Ptr();
|
||||
return wizard.device();
|
||||
});
|
||||
}
|
||||
|
||||
IDevice::Ptr LinuxDeviceFactory::create() const
|
||||
{
|
||||
GenericLinuxDeviceConfigurationWizard wizard(Core::ICore::dialogParent());
|
||||
if (wizard.exec() != QDialog::Accepted)
|
||||
return IDevice::Ptr();
|
||||
return wizard.device();
|
||||
}
|
||||
|
||||
}
|
||||
} // namespace Internal
|
||||
} // namespace RemoteLinux
|
||||
|
||||
Reference in New Issue
Block a user