From kde-commits Fri Oct 22 18:38:55 2004 From: =?utf-8?q?Fred=20Sch=C3=A4ttgen?= Date: Fri, 22 Oct 2004 18:38:55 +0000 To: kde-commits Subject: kdeextragear-3/kdebluetooth/kioslave/bluetooth Message-Id: <20041022183855.243B116C59 () office ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=109847035016406 CVS commit by schaettgen: Show link to help text in the service management tab of kbluetoothd FEATURE: 90249 Include device detected by the device discovery service into the kio_bluetooth. M +1 -0 bluetooth.protocol 1.2 M +42 -1 kiobluetooth.cpp 1.5 M +1 -0 kiobluetooth.h 1.4 --- kdeextragear-3/kdebluetooth/kioslave/bluetooth/bluetooth.protocol #1.1:1.2 @@ -8,2 +8,3 @@ Description=Bluetooth inquiry protocol maxInstances=3 +DocPath=kdebluetooth/components.kio_sdp.html --- kdeextragear-3/kdebluetooth/kioslave/bluetooth/kiobluetooth.cpp #1.4:1.5 @@ -114,4 +114,22 @@ vector KioBluetooth::getC } +vector KioBluetooth::getCurrentNonDiscoverableDevices() +{ + vector ret; + QByteArray retArray; + QDataStream retStream(retArray, IO_ReadOnly); + QCString replyType; + if (dcopClient()->call("kbluetoothd", "DeviceScanner", "getCurrentNeighbours()", + QByteArray(), replyType, retArray, false) && replyType == "QStringList") + { + QStringList retStrList; + retStream >> retStrList; + for (uint n = 0; n < retStrList.size(); ++n) { + ret.push_back(KBluetooth::DeviceAddress(retStrList[n])); + } + } + return ret; +} + void KioBluetooth::listDevice(const QString& devName, int devClass) { @@ -147,4 +165,20 @@ bool KioBluetooth::doListBrowse(const KU } + vector foundNondiscoverable = getCurrentNonDiscoverableDevices(); + for (size_t n=0; n addresses; @@ -165,5 +199,12 @@ bool KioBluetooth::doListBrowse(const KU // Skip devices which were listed already because we are connected to them. - if (find(connections.begin(), connections.end(), devAddr) != connections.end()) { + if (find(connections.begin(), connections.end(), devAddr) != + connections.end()) + { + continue; + } + if (find(foundNondiscoverable.begin(), foundNondiscoverable.end(), devAddr) != + foundNondiscoverable.end()) + { continue; } --- kdeextragear-3/kdebluetooth/kioslave/bluetooth/kiobluetooth.h #1.3:1.4 @@ -50,4 +50,5 @@ public: private: std::vector getCurrentConnections(); + std::vector getCurrentNonDiscoverableDevices(); void listDevice(const QString& devName, int devClass); bool doListBrowse(const KURL &url);