forked from qt-creator/qt-creator
Device Support: Merge id and fingerprint.
It seems pointless to have two identity-related concepts in parallel. The new approach is as follows: The identifier is a Core::Id. If the client code supplies a fingerprint string (as needed for auto-detected devices), the id is derived from it, otherwise it gets created from a newly generated UUID. Change-Id: I680afa6cd2fdd43ec1c461616ba982b3ff55c73a Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
This commit is contained in:
@@ -36,6 +36,7 @@
|
||||
#include "remotelinuxdeployconfigurationwidget.h"
|
||||
#include "typespecificdeviceconfigurationlistmodel.h"
|
||||
|
||||
#include <coreplugin/id.h>
|
||||
#include <projectexplorer/devicesupport/devicemanager.h>
|
||||
#include <qt4projectmanager/qt4target.h>
|
||||
|
||||
@@ -91,7 +92,7 @@ void RemoteLinuxDeployConfiguration::handleDeviceConfigurationListUpdated()
|
||||
setDeviceConfig(DeviceManager::instance()->internalId(d->deviceConfiguration));
|
||||
}
|
||||
|
||||
void RemoteLinuxDeployConfiguration::setDeviceConfig(LinuxDeviceConfiguration::Id internalId)
|
||||
void RemoteLinuxDeployConfiguration::setDeviceConfig(const Core::Id &internalId)
|
||||
{
|
||||
d->deviceConfiguration = target()->deviceConfigModel()->find(internalId);
|
||||
emit deviceConfigurationListChanged();
|
||||
@@ -102,7 +103,8 @@ bool RemoteLinuxDeployConfiguration::fromMap(const QVariantMap &map)
|
||||
{
|
||||
if (!DeployConfiguration::fromMap(map))
|
||||
return false;
|
||||
setDeviceConfig(map.value(QLatin1String(DeviceIdKey), IDevice::invalidId()).toULongLong());
|
||||
setDeviceConfig(Core::Id(map.value(QLatin1String(DeviceIdKey),
|
||||
IDevice::invalidId().toString()).toString()));
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -110,7 +112,7 @@ QVariantMap RemoteLinuxDeployConfiguration::toMap() const
|
||||
{
|
||||
QVariantMap map = DeployConfiguration::toMap();
|
||||
map.insert(QLatin1String(DeviceIdKey),
|
||||
DeviceManager::instance()->internalId(d->deviceConfiguration));
|
||||
DeviceManager::instance()->internalId(d->deviceConfiguration).toString());
|
||||
return map;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user