Changeset View
Changeset View
Standalone View
Standalone View
core/backends/bluetooth/bluetoothlinkprovider.cpp
Show First 20 Lines • Show All 108 Lines • ▼ Show 20 Line(s) | 101 | { | |||
---|---|---|---|---|---|
109 | } | 109 | } | ||
110 | 110 | | |||
111 | mLinks[deviceId] = deviceLink; | 111 | mLinks[deviceId] = deviceLink; | ||
112 | } | 112 | } | ||
113 | 113 | | |||
114 | //I'm the new device and I found an existing device | 114 | //I'm the new device and I found an existing device | ||
115 | void BluetoothLinkProvider::serviceDiscoveryFinished() | 115 | void BluetoothLinkProvider::serviceDiscoveryFinished() | ||
116 | { | 116 | { | ||
117 | QList<QBluetoothServiceInfo> services = mServiceDiscoveryAgent->discoveredServices(); | 117 | const QList<QBluetoothServiceInfo> services = mServiceDiscoveryAgent->discoveredServices(); | ||
118 | 118 | | |||
119 | Q_FOREACH (QBluetoothServiceInfo info, services) { | 119 | for (QBluetoothServiceInfo info : services) { | ||
120 | if (mSockets.contains(info.device().address())) { | 120 | if (mSockets.contains(info.device().address())) { | ||
121 | continue; | 121 | continue; | ||
122 | } | 122 | } | ||
123 | 123 | | |||
124 | QBluetoothSocket* socket = new QBluetoothSocket(QBluetoothServiceInfo::RfcommProtocol); | 124 | QBluetoothSocket* socket = new QBluetoothSocket(QBluetoothServiceInfo::RfcommProtocol); | ||
125 | 125 | | |||
126 | connect(socket, SIGNAL(connected()), this, SLOT(clientConnected())); | 126 | connect(socket, SIGNAL(connected()), this, SLOT(clientConnected())); | ||
127 | connect(socket, SIGNAL(error(QBluetoothSocket::SocketError)), this, SLOT(connectError())); | 127 | connect(socket, SIGNAL(error(QBluetoothSocket::SocketError)), this, SLOT(connectError())); | ||
▲ Show 20 Lines • Show All 178 Lines • Show Last 20 Lines |