kdeconnectplugin.cpp | kdeconnectplugin.cpp | |||
---|---|---|---|---|
skipping to change at line 108 | skipping to change at line 108 | |||
return; | return; | |||
} | } | |||
// We might have gotten a second deviceAdded signal, check again. | // We might have gotten a second deviceAdded signal, check again. | |||
if (m_devices.contains(deviceId)) { | if (m_devices.contains(deviceId)) { | |||
return; | return; | |||
} | } | |||
QVariantMap props = reply.value(); | QVariantMap props = reply.value(); | |||
if (!props.value(QStringLiteral("isReachable")).toBool() || !props. | // Also check isTrusted for compatibility with older KDEConnect | |||
value(QStringLiteral("isTrusted")).toBool()) { | const bool paired = props.value(QStringLiteral("isPaired")).toBool( | |||
) || props.value(QStringLiteral("isTrusted")).toBool(); | ||||
if (!props.value(QStringLiteral("isReachable")).toBool() || !paired | ||||
) { | ||||
return; | return; | |||
} | } | |||
props.insert(QStringLiteral("id"), deviceId); | props.insert(QStringLiteral("id"), deviceId); | |||
m_devices.append(deviceId); | m_devices.append(deviceId); | |||
sendData(QStringLiteral("deviceAdded"), QJsonObject::fromVariantMap (props)); | sendData(QStringLiteral("deviceAdded"), QJsonObject::fromVariantMap (props)); | |||
}); | }); | |||
} | } | |||
End of changes. 1 change blocks. | ||||
2 lines changed or deleted | 5 lines changed or added | |||
This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/ |