Device support: Only restore SSH options if we really saved them.

As the default-constructed value is not zero. This was not considered in
7aa8ae54ae.

Change-Id: I1f32b1c317e0de34b48dbe003c3968f66133a64d
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
This commit is contained in:
Christian Kandeler
2015-05-05 17:42:38 +02:00
parent c7b11e5990
commit 74066f25b4

View File

@@ -329,8 +329,9 @@ void IDevice::fromMap(const QVariantMap &map)
d->sshParameters.timeout = map.value(QLatin1String(TimeoutKey), DefaultTimeout).toInt(); d->sshParameters.timeout = map.value(QLatin1String(TimeoutKey), DefaultTimeout).toInt();
d->sshParameters.hostKeyCheckingMode = static_cast<QSsh::SshHostKeyCheckingMode> d->sshParameters.hostKeyCheckingMode = static_cast<QSsh::SshHostKeyCheckingMode>
(map.value(QLatin1String(HostKeyCheckingKey), QSsh::SshHostKeyCheckingNone).toInt()); (map.value(QLatin1String(HostKeyCheckingKey), QSsh::SshHostKeyCheckingNone).toInt());
d->sshParameters.options const QVariant optionsVariant = map.value(QLatin1String(SshOptionsKey));
= QSsh::SshConnectionOptions(map.value(QLatin1String(SshOptionsKey)).toInt()); if (optionsVariant.isValid()) // false for QtC < 3.4
d->sshParameters.options = QSsh::SshConnectionOptions(optionsVariant.toInt());
d->freePorts = Utils::PortList::fromString(map.value(QLatin1String(PortsSpecKey), d->freePorts = Utils::PortList::fromString(map.value(QLatin1String(PortsSpecKey),
QLatin1String("10000-10100")).toString()); QLatin1String("10000-10100")).toString());