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:
hjk
2022-01-26 09:05:35 +01:00
parent f6cb638345
commit 2b6f26dee2
20 changed files with 96 additions and 125 deletions

View File

@@ -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