Changeset View
Changeset View
Standalone View
Standalone View
core/backends/lan/landevicelink.cpp
Show First 20 Lines • Show All 50 Lines • ▼ Show 20 Line(s) | 40 | { | |||
---|---|---|---|---|---|
51 | //We take ownership of the socket. | 51 | //We take ownership of the socket. | ||
52 | //When the link provider destroys us, | 52 | //When the link provider destroys us, | ||
53 | //the socket (and the reader) will be | 53 | //the socket (and the reader) will be | ||
54 | //destroyed as well | 54 | //destroyed as well | ||
55 | socket->setParent(mSocketLineReader); | 55 | socket->setParent(mSocketLineReader); | ||
56 | 56 | | |||
57 | mConnectionSource = connectionSource; | 57 | mConnectionSource = connectionSource; | ||
58 | 58 | | |||
59 | QHostAddress addr = socket->peerAddress(); | ||||
60 | mHostAddress = (addr.protocol() == QAbstractSocket::IPv6Protocol) ? QHostAddress(addr.toIPv4Address()) : addr; | ||||
albertvaka: I think we can remove the special case for IPv6, and it should just work? Hopefully :D | |||||
Just copying the address is what I had tried first, but it doesn't work, you have to construct a new QHostAddress with toIPv4Address() since Qt 5.6. Without that, toString() returns something like ::ffff:192.168.0.1 which sshfs doesn't like. jeanv: Just copying the address is what I had tried first, but it doesn't work, you have to construct… | |||||
61 | | ||||
59 | QString certString = KdeConnectConfig::instance()->getDeviceProperty(deviceId(), QStringLiteral("certificate")); | 62 | QString certString = KdeConnectConfig::instance()->getDeviceProperty(deviceId(), QStringLiteral("certificate")); | ||
60 | DeviceLink::setPairStatus(certString.isEmpty()? PairStatus::NotPaired : PairStatus::Paired); | 63 | DeviceLink::setPairStatus(certString.isEmpty()? PairStatus::NotPaired : PairStatus::Paired); | ||
61 | } | 64 | } | ||
62 | 65 | | |||
63 | QString LanDeviceLink::name() | 66 | QString LanDeviceLink::name() | ||
64 | { | 67 | { | ||
65 | return QStringLiteral("LanLink"); // Should be same in both android and kde version | 68 | return QStringLiteral("LanLink"); // Should be same in both android and kde version | ||
66 | } | 69 | } | ||
▲ Show 20 Lines • Show All 95 Lines • Show Last 20 Lines |
I think we can remove the special case for IPv6, and it should just work? Hopefully :D