[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: kdeextragear-3/kdebluetooth/kioslave/bluetooth
From: Fred SchÃĪttgen <kde.sch () ttgen ! net>
Date: 2004-10-22 18:38:55
Message-ID: 20041022183855.243B116C59 () office ! kde ! org
[Download RAW message or body]
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<DeviceAddress> KioBluetooth::getC
}
+vector<DeviceAddress> KioBluetooth::getCurrentNonDiscoverableDevices()
+{
+ vector<DeviceAddress> 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<DeviceAddress> foundNondiscoverable = getCurrentNonDiscoverableDevices();
+ for (size_t n=0; n<foundNondiscoverable.size(); ++n) {
+ if (find(connections.begin(), connections.end(), foundNondiscoverable[n]) != connections.end())
+ {
+ continue;
+ }
+ QString devName = QString(foundNondiscoverable[n]);
+ NameCache::getCachedName(foundNondiscoverable[n], devName, dcopClient());
+ if (devName == QString::null) {
+ devName = QString(foundNondiscoverable[n]);
+ }
+ int devClass = 0;
+ NameCache::getCachedClass(foundNondiscoverable[n], devClass, dcopClient());
+ listDevice(devName, devClass);
+ }
+
KBluetooth::Inquiry inquiry;
QValueList<AddrInfo> 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<KBluetooth::DeviceAddress> getCurrentConnections();
+ std::vector<KBluetooth::DeviceAddress> getCurrentNonDiscoverableDevices();
void listDevice(const QString& devName, int devClass);
bool doListBrowse(const KURL &url);
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic