Skip to content
Snippets Groups Projects
Commit 5bf0280b authored by Christian Kandeler's avatar Christian Kandeler
Browse files

Device support: Copy device object when adding to device manager.


Otherwise the caller might (inadvertantly) keep a non-const object
around and change it behind the device manager's back.

Change-Id: I71b3e83e94397416b843006e74dcc1924abed77b
Reviewed-by: default avatarTobias Hunger <tobias.hunger@nokia.com>
parent b3a3072e
No related branches found
No related tags found
No related merge requests found
......@@ -218,9 +218,10 @@ QString DeviceManager::settingsFilePath()
return QFileInfo(pm->settings()->fileName()).absolutePath() + QLatin1String("/devices.xml");
}
void DeviceManager::addDevice(const IDevice::Ptr &device)
void DeviceManager::addDevice(const IDevice::Ptr &_device)
{
QTC_ASSERT(this != instance() || (device->isAutoDetected()), return);
const IDevice::Ptr device = _device->clone();
QTC_ASSERT(this != instance() || device->isAutoDetected(), return);
QString name = device->displayName();
const int pos = indexForId(device->id());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment