Docker: Dont create the device twice

wizard.device() should be called wizard.createDevice()

Change-Id: I0cfd6a392cb66a07d0b2e1340b06e73be715104f
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Marcus Tillmanns
2025-04-25 07:51:59 +02:00
parent c1603c2e75
commit c2fff26f3c

View File

@@ -1332,9 +1332,9 @@ DockerDeviceFactory::DockerDeviceFactory()
DockerDeviceSetupWizard wizard;
if (wizard.exec() != QDialog::Accepted)
return IDevice::Ptr();
m_existingDevices.writeLocked()->push_back(
std::static_pointer_cast<DockerDevice>(wizard.device()));
return wizard.device();
auto device = std::static_pointer_cast<DockerDevice>(wizard.device());
m_existingDevices.writeLocked()->push_back(device);
return std::static_pointer_cast<IDevice>(device);
});
setConstructionFunction([this] {
auto device = DockerDevice::create();