diff options
| -rw-r--r-- | kde-base/solid/Manifest | 4 | ||||
| -rw-r--r-- | kde-base/solid/files/solid-4.2.0-backport-solid-bluetooth.patch | 1212 | ||||
| -rw-r--r-- | kde-base/solid/solid-4.1.96-r1.ebuild | 48 | ||||
| -rw-r--r-- | kde-base/solid/solid-4.2.0.ebuild | 1 | ||||
| -rw-r--r-- | net-wireless/kdebluetooth4/Manifest | 2 | ||||
| -rw-r--r-- | net-wireless/kdebluetooth4/kdebluetooth4-0.3.ebuild | 31 |
6 files changed, 1297 insertions, 1 deletions
diff --git a/kde-base/solid/Manifest b/kde-base/solid/Manifest index 98593458de9..9a730d9e989 100644 --- a/kde-base/solid/Manifest +++ b/kde-base/solid/Manifest @@ -1,7 +1,9 @@ +AUX solid-4.2.0-backport-solid-bluetooth.patch 42383 RMD160 1aa238d89288ecc7f9bf00dfb532f216ea945bbb SHA1 c455e31c498f21e07a206fe28d10bf5e6acc726a SHA256 e3eeee966f4ca5c074a5cc187ee850dab4c999c3fd5deeffb194a1dd352072d4 DIST kdebase-workspace-4.1.96.tar.bz2 43193383 RMD160 f559dcd554b7b17ff0e173043eafb134cc443fa4 SHA1 958d498f875434ab106351b83e3c818f847d6204 SHA256 5efa0d29aaa7fcc0d948e05856532b81f04bc72bddfd6f779206c36d240d052c DIST kdebase-workspace-4.2.0.tar.bz2 50724381 RMD160 752e727aaf0010e362f3c77190584fa8c6bd4761 SHA1 351eae9401ac6fb990950d1a5120505475abef05 SHA256 e5c550af7d655d62e37c51667f264b53eb9785166f3567960d91acd37b6f902b +EBUILD solid-4.1.96-r1.ebuild 1076 RMD160 728a563b9a96355da6c2ea386c9e357bc8654833 SHA1 bfe7f783d119c54ffb8f610d1b6ce8a7b5b20dc3 SHA256 22876af92170d61440bbed3aa4cb12e336198e31a8b45f9f79e2e74b9466b47c EBUILD solid-4.1.96.ebuild 1013 RMD160 04ffadc7dcd0d00eafbf7f99aa894d33a2322f01 SHA1 db6620b79d61f0eae1cffe176050bdf8e8062006 SHA256 47ed39a38993ac50750f39ded818762a7bebd4030f2307382514f57672f0da74 -EBUILD solid-4.2.0.ebuild 1013 RMD160 04ffadc7dcd0d00eafbf7f99aa894d33a2322f01 SHA1 db6620b79d61f0eae1cffe176050bdf8e8062006 SHA256 47ed39a38993ac50750f39ded818762a7bebd4030f2307382514f57672f0da74 +EBUILD solid-4.2.0.ebuild 1069 RMD160 f79a7b0c9fb2de56b0aabe799fe6c645f2e5d5d6 SHA1 1d9a88841ac3af59d5c6af275d2d720ba717d186 SHA256 1955e5ef7b5d9e3815d3ba8dd8c2cab0806cea19946a84b96fa70a608d8a24f0 EBUILD solid-9999.ebuild 1002 RMD160 cec257f1409314ed16b2f36320dc98dc1d797cf0 SHA1 e9bb240a727c96011892f01f61f5e80265c5b78c SHA256 9b34f9b7f55249dd4894417ba6e86c1b99849c4e44d44c2052393f5ea8308e0b MISC ChangeLog 3786 RMD160 c1c877fa9184c0bcb05d2d1b1e331c547135784c SHA1 6a049e276df1003bba41e1af16cb36f492628ae0 SHA256 ed4b7400e2759db7611cccc7820837319f3c86459920dc4b9ceb32c6307123fb MISC metadata.xml 156 RMD160 ecce3b981f150c45ae1e84e2d208e678d6124259 SHA1 b64f7c0b4e5db816d82ad19848f72118af129d35 SHA256 2f4da28506b9d4185f320f67a6191d30c7a921217ed4447ed46ea0bc4aefc79a diff --git a/kde-base/solid/files/solid-4.2.0-backport-solid-bluetooth.patch b/kde-base/solid/files/solid-4.2.0-backport-solid-bluetooth.patch new file mode 100644 index 00000000000..fc4e3a42c7c --- /dev/null +++ b/kde-base/solid/files/solid-4.2.0-backport-solid-bluetooth.patch @@ -0,0 +1,1212 @@ +Index: bluez-bluetoothinterface.cpp +=================================================================== +--- bluez-bluetoothinterface.cpp (.../branches/KDE/4.2/kdebase/workspace/solid/bluez) (revision 912529) ++++ solid/bluez/bluez-bluetoothinterface.cpp (.../trunk/KDE/kdebase/workspace/solid/bluez) (revision 912529) +@@ -25,6 +25,7 @@ + #include <solid/control/bluetoothinterface.h> + + #include "bluez-bluetoothremotedevice.h" ++#include "bluez-bluetoothinputdevice.h" + #include <KDebug> + + +@@ -43,6 +44,7 @@ + QString objectPath; + + QMap<QString, BluezBluetoothRemoteDevice *> devices; ++ QMap<QString, BluezBluetoothInputDevice *> inputDevices; + }; + + +@@ -56,23 +58,6 @@ + objectPath, \ + "org.bluez.Adapter", \ + signal, this, SLOT(slot)); +-/* +- connectInterfaceToThis("ModeChanged", slotModeChanged(const QString &)); +- connectInterfaceToThis("DiscoverableTimeoutChanged", slotDiscoverableTimeoutChanged(int)); +- connectInterfaceToThis("MinorClassChanged", slotMinorClassChanged(const QString &)); +- connectInterfaceToThis("NameChanged", slotNameChanged(const QString &)); +- connectInterfaceToThis("DiscoveryStarted", slotDiscoveryStarted()); +- connectInterfaceToThis("DiscoveryCompleted", slotDiscoveryCompleted()); +- connectInterfaceToThis("RemoteDeviceDisappeared", slotRemoteDeviceDisappeared(const QString &)); +- connectInterfaceToThis("RemoteDeviceFound", slotRemoteDeviceFound(const QString &, uint, short)); +- connectInterfaceToThis("RemoteNameUpdated", slotRemoteNameUpdated(const QString &, const QString &)); +- connectInterfaceToThis("RemoteDeviceConnected", slotRemoteDeviceConnected(const QString &)); +- connectInterfaceToThis("RemoteDeviceDisconnected", slotRemoteDeviceDisconnected(const QString &)); +- connectInterfaceToThis("TrustAdded", slotTrustAdded(const QString &)); +- connectInterfaceToThis("TrustRemoved", slotTrustRemoved(const QString &)); +- connectInterfaceToThis("BondingCreated", slotBondingCreated(const QString &)); +- connectInterfaceToThis("BondingRemoved", slotBondingRemoved(const QString &)); +-*/ + + connectInterfaceToThis("PropertyChanged", slotPropertyChanged(const QString &, const QVariant &)); + connectInterfaceToThis("DeviceCreated", slotDeviceCreated(const QDBusObjectPath &)); +@@ -98,21 +83,14 @@ + d->iface.call("CancelDeviceCreation",addr); + } + +-QString BluezBluetoothInterface::createDevice(const QString &addr) const ++void BluezBluetoothInterface::createDevice(const QString &addr) const + { +- QDBusObjectPath path = objectReply("CreateDevice",addr); +- return path.path(); ++ d->iface.call("CreateDevice",addr); + } + +-QString BluezBluetoothInterface::createPairedDevice(const QString &addr, const QString &agentUBI, const QString &capab) const ++void BluezBluetoothInterface::createPairedDevice(const QString &addr, const QString &agentUBI, const QString &capab) const + { +- QDBusReply< QDBusObjectPath > reply; +- reply = d->iface.call("CreatePairedDevice",addr,agentUBI,capab); +- +- if (!reply.isValid()) { +- return QString(); +- } +- return reply.value().path(); ++ d->iface.call("CreatePairedDevice",addr,qVariantFromValue(QDBusObjectPath(agentUBI)),capab); + } + + QString BluezBluetoothInterface::findDevice(const QString &addr) const +@@ -147,7 +125,7 @@ + + void BluezBluetoothInterface::registerAgent(const QString &agentUBI, const QString &capab) + { +- d->iface.call("RegisterAgent",agentUBI,capab); ++ d->iface.call("RegisterAgent",qVariantFromValue(QDBusObjectPath(agentUBI)),capab); + } + + void BluezBluetoothInterface::releaseSession() +@@ -157,7 +135,7 @@ + + void BluezBluetoothInterface::removeDevice(const QString &deviceUBI ) + { +- d->iface.call("RemoveDevice",deviceUBI); ++ d->iface.call("RemoveDevice",qVariantFromValue(QDBusObjectPath(deviceUBI))); + } + + void BluezBluetoothInterface::requestSession() +@@ -183,305 +161,20 @@ + + void BluezBluetoothInterface::unregisterAgent(const QString &agentUBI) + { +- d->iface.call("UnregisterAgent",agentUBI); ++ d->iface.call("UnregisterAgent",qVariantFromValue(QDBusObjectPath(agentUBI))); + } + + + +-/* +- +-QString BluezBluetoothInterface::address() const ++void BluezBluetoothInterface::slotDeviceCreated(const QDBusObjectPath &path) + { +- return stringReply("GetAddress"); +-} ++ kDebug() << "device created"; + +-QString BluezBluetoothInterface::version() const +-{ +- return stringReply("GetVersion"); +-} +- +-QString BluezBluetoothInterface::revision() const +-{ +- return stringReply("GetRevision"); +-} +- +-QString BluezBluetoothInterface::manufacturer() const +-{ +- return stringReply("GetManufacturer"); +-} +- +-QString BluezBluetoothInterface::company() const +-{ +- return stringReply("GetCompany"); +-} +- +-Solid::Control::BluetoothInterface::Mode BluezBluetoothInterface::mode() const +-{ +- QString theMode = stringReply("GetMode"); +- Solid::Control::BluetoothInterface::Mode modeEnum; +- if (theMode == "connectable") +- { +- modeEnum = Solid::Control::BluetoothInterface::Connectable; ++ if (!d->devices.contains(path.path())) { ++ BluezBluetoothRemoteDevice* bluetoothRemoteDev = new BluezBluetoothRemoteDevice(path.path()); ++ d->devices.insert(path.path(), bluetoothRemoteDev); + } +- else if (theMode == "discoverable") +- { +- modeEnum = Solid::Control::BluetoothInterface::Discoverable; +- } else { +- Q_ASSERT(theMode == "off"); +- modeEnum = Solid::Control::BluetoothInterface::Off; +- } +- return modeEnum; +-} + +-int BluezBluetoothInterface::discoverableTimeout() const +-{ +- QDBusReply< uint > timeout = d->iface.call("GetDiscoverableTimeout"); +- if (timeout.isValid()) { +- return timeout.value(); +- } +- +- return -1; +-} +- +-bool BluezBluetoothInterface::isDiscoverable() const +-{ +- return boolReply("IsDiscoverable"); +-} +- +-QStringList BluezBluetoothInterface::listConnections() const +-{ +- QStringList list = listReply("ListConnections"); +- for (int i = 0; i < list.size(); i++) { +- list[i] = ubi() + '/' + list[i]; +- } +- return list; +-} +- +-QString BluezBluetoothInterface::majorClass() const +-{ +- return stringReply("GetMajorClass"); +-} +- +-QStringList BluezBluetoothInterface::listAvailableMinorClasses() const +-{ +- return listReply("ListAvailableMinorClasses"); +-} +- +-QString BluezBluetoothInterface::minorClass() const +-{ +- return stringReply("GetMinorClass"); +-} +- +-QStringList BluezBluetoothInterface::serviceClasses() const +-{ +- return listReply("GetServiceClasses"); +-} +- +-QString BluezBluetoothInterface::name() const +-{ +- return stringReply("GetName"); +-} +- +-QString BluezBluetoothInterface::getRemoteName(const QString &mac) +-{ +- return stringReply("GetRemoteName",mac); +-} +- +-bool BluezBluetoothInterface::isTrusted(const QString &mac) +-{ +- return boolReply("IsTrusted",mac); +-} +- +-QStringList BluezBluetoothInterface::listBondings() const +-{ +- return listReply("ListBondings"); +-} +- +-bool BluezBluetoothInterface::isPeriodicDiscoveryActive() const +-{ +- return boolReply("IsPeriodicDiscovery"); +-} +- +-bool BluezBluetoothInterface::isPeriodicDiscoveryNameResolvingActive() const +-{ +- return boolReply("IsPeriodicDiscoveryNameResolving"); +-} +- +-QStringList BluezBluetoothInterface::listRemoteDevices() const +-{ +- QStringList list = listReply("ListRemoteDevices"); +- for (int i = 0; i < list.size(); i++) { +- list[i] = ubi() + '/' + list[i]; +- } +- return list; +-} +- +-QStringList BluezBluetoothInterface::listRecentRemoteDevices(const QDateTime &) const +-{ +- return listReply("ListRecentRemoteDevices"); +-} +- +-void BluezBluetoothInterface::setMode(const Solid::Control::BluetoothInterface::Mode mode) +-{ +- QString modeString; +- switch(mode) +- { +- case Solid::Control::BluetoothInterface::Off: +- modeString = "off"; +- break; +- case Solid::Control::BluetoothInterface::Discoverable: +- modeString = "discoverable"; +- break; +- case Solid::Control::BluetoothInterface::Connectable: +- modeString = "connectable"; +- break; +- } +- d->iface.call("SetMode", modeString); +-} +- +-void BluezBluetoothInterface::setDiscoverableTimeout(int timeout) +-{ +- d->iface.call("SetDiscoverableTimeout", (uint)timeout); +-} +- +-void BluezBluetoothInterface::setMinorClass(const QString &minorClass) +-{ +- d->iface.call("SetMinorClass", minorClass); +-} +- +-void BluezBluetoothInterface::setName(const QString &name) +-{ +- d->iface.call("SetName", name); +-} +- +-void BluezBluetoothInterface::discoverDevices() +-{ +- d->iface.call("DiscoverDevices"); +-} +- +-void BluezBluetoothInterface::discoverDevicesWithoutNameResolving() +-{ +- d->iface.call("DiscoverDevicesWithoutNameResolving"); +-} +- +-void BluezBluetoothInterface::cancelDiscovery() +-{ +- d->iface.call("CancelDiscovery"); +-} +- +-void BluezBluetoothInterface::startPeriodicDiscovery() +-{ +- d->iface.call("StartPeriodicDiscovery"); +-} +- +-void BluezBluetoothInterface::stopPeriodicDiscovery() +-{ +- d->iface.call("StopPeriodicDiscovery"); +-} +- +-void BluezBluetoothInterface::setPeriodicDiscoveryNameResolving(bool nameResolving) +-{ +- d->iface.call("SetPeriodicDiscoveryNameResolving", nameResolving); +-} +- +-void BluezBluetoothInterface::setTrusted(const QString& mac) +-{ +- d->iface.call("SetTrusted", mac); +-} +- +-void BluezBluetoothInterface::removeTrust(const QString& mac) +-{ +- d->iface.call("RemoveTrust", mac); +-} +- +-*/ +- +- +- +-/* +- +-void BluezBluetoothInterface::slotModeChanged(const Solid::Control::BluetoothInterface::Mode mode) +-{ +- emit modeChanged(mode); +-} +- +-void BluezBluetoothInterface::slotDiscoverableTimeoutChanged(int timeout) +-{ +- emit discoverableTimeoutChanged(timeout); +-} +- +-void BluezBluetoothInterface::slotMinorClassChanged(const QString &minorClass) +-{ +- emit minorClassChanged(minorClass); +-} +- +-void BluezBluetoothInterface::slotNameChanged(const QString &name) +-{ +- emit nameChanged(name); +-} +- +-void BluezBluetoothInterface::slotDiscoveryStarted() +-{ +- emit discoveryStarted(); +-} +- +-void BluezBluetoothInterface::slotDiscoveryCompleted() +-{ +- emit discoveryCompleted(); +-} +- +-void BluezBluetoothInterface::slotRemoteDeviceFound(const QString &address, uint deviceClass, short rssi) +-{ +- QString remoteubi = QString("%1/%2").arg(ubi()).arg(address); +- emit remoteDeviceFound(remoteubi, deviceClass, rssi); +-} +- +-void BluezBluetoothInterface::slotRemoteDeviceDisappeared(const QString &address) +-{ +- QString remoteubi = QString("%1/%2").arg(ubi()).arg(address); +- emit remoteDeviceDisappeared(remoteubi); +-} +- +-void BluezBluetoothInterface::slotRemoteNameUpdated(const QString &address, const QString& name) +-{ +- emit remoteNameUpdated(address,name); +-} +- +-void BluezBluetoothInterface::slotRemoteDeviceConnected(const QString &address) +-{ +- emit remoteDeviceConnected(address); +-} +- +-void BluezBluetoothInterface::slotRemoteDeviceDisconnected(const QString &address) +-{ +- emit remoteDeviceDisconnected(address); +-} +- +-void BluezBluetoothInterface::slotTrustAdded(const QString &address) +-{ +- emit trustAdded(address); +-} +- +-void BluezBluetoothInterface::slotTrustRemoved(const QString &address) +-{ +- emit trustRemoved(address); +-} +- +-void BluezBluetoothInterface::slotBondingCreated(const QString &address) +-{ +- emit bondingCreated(address); +-} +- +-void BluezBluetoothInterface::slotBondingRemoved(const QString &address) +-{ +- emit bondingRemoved(address); +-} +- +-*/ +- +-void BluezBluetoothInterface::slotDeviceCreated(const QDBusObjectPath &path) +-{ +- kDebug() << "device created"; + emit deviceCreated(path.path()); + } + +@@ -523,7 +216,20 @@ + return bluetoothInterface; + } + ++QObject *BluezBluetoothInterface::createBluetoothInputDevice(const QString &ubi) ++{ ++ BluezBluetoothInputDevice *bluetoothInputDev; ++ if (d->inputDevices.contains(ubi)) { ++ bluetoothInputDev = d->inputDevices[ubi]; ++ } else { ++ bluetoothInputDev = new BluezBluetoothInputDevice(ubi); ++ d->inputDevices.insert(ubi, bluetoothInputDev); ++ } ++ return bluetoothInputDev; ++} + ++ ++ + /******************* DBus Calls *******************************/ + + QStringList BluezBluetoothInterface::listReply(const QString &method) const +@@ -574,10 +280,13 @@ + + if (param.isEmpty()) + reply = d->iface.call(method); +- else ++ else { ++ qDebug() << "ObjectReply calling: " << method << " " << param; + reply = d->iface.call(method, param); ++ } + + if (reply.isValid()) { ++ qDebug() << "ObjectReply Valid? "<< reply.value().path(); + return reply.value(); + } + +Index: bluez-bluetoothinterface.h +=================================================================== +--- bluez-bluetoothinterface.h (.../branches/KDE/4.2/kdebase/workspace/solid/bluez) (revision 912529) ++++ solid/bluez/bluez-bluetoothinterface.h (.../trunk/KDE/kdebase/workspace/solid/bluez) (revision 912529) +@@ -27,6 +27,7 @@ + #include <QtDBus> + #include <QDBusVariant> + #include <QDBusObjectPath> ++#include <QString> + + #include <solid/control/ifaces/bluetoothinterface.h> + +@@ -42,34 +43,11 @@ + BluezBluetoothInterface(const QString & objectPath); + virtual ~BluezBluetoothInterface(); + QString ubi() const; +-/* +- QString address() const; +- QString version() const; +- QString revision() const; +- QString manufacturer() const; +- QString company() const; +- Solid::Control::BluetoothInterface::Mode mode() const; +- int discoverableTimeout() const; +- bool isDiscoverable() const; +- QStringList listConnections() const; +- QString majorClass() const; +- QStringList listAvailableMinorClasses() const; +- QString minorClass() const; +- QStringList serviceClasses() const; +- QString name() const; +- QStringList listBondings() const; +- bool isPeriodicDiscoveryActive() const; +- bool isPeriodicDiscoveryNameResolvingActive() const; +- QStringList listRemoteDevices() const; +- QStringList listRecentRemoteDevices(const QDateTime &) const; +- QString getRemoteName(const QString &); +- bool isTrusted(const QString &); +- +-*/ ++ + QObject *createBluetoothRemoteDevice(const QString &); +- +- QString createDevice(const QString &) const; +- QString createPairedDevice(const QString &,const QString &,const QString &) const; ++ QObject *createBluetoothInputDevice(const QString &); ++ void createDevice(const QString &) const; ++ void createPairedDevice(const QString &,const QString &,const QString &) const; + QString findDevice(const QString &) const; + QMap< QString, QVariant > getProperties() const; + QStringList listDevices() const; +@@ -87,36 +65,6 @@ + void stopDiscovery(); + void unregisterAgent(const QString &); + +-/* +- void setMode(const Solid::Control::BluetoothInterface::Mode); +- void setDiscoverableTimeout(int); +- void setMinorClass(const QString &); +- void setName(const QString &); +- void discoverDevices(); +- void discoverDevicesWithoutNameResolving(); +- void cancelDiscovery(); +- void startPeriodicDiscovery(); +- void stopPeriodicDiscovery(); +- void setPeriodicDiscoveryNameResolving(bool); +- void setTrusted(const QString &); +- void removeTrust(const QString &); +- +- void slotModeChanged(const Solid::Control::BluetoothInterface::Mode mode); +- void slotDiscoverableTimeoutChanged(int timeout); +- void slotMinorClassChanged(const QString &minor); +- void slotNameChanged(const QString &name); +- void slotDiscoveryStarted(); +- void slotDiscoveryCompleted(); +- void slotRemoteDeviceFound(const QString &ubi, uint deviceClass, short rssi); +- void slotRemoteDeviceDisappeared(const QString &ubi); +- void slotRemoteNameUpdated(const QString &, const QString &); +- void slotRemoteDeviceConnected(const QString&); +- void slotRemoteDeviceDisconnected(const QString&); +- void slotTrustAdded(const QString&); +- void slotTrustRemoved(const QString&); +- void slotBondingCreated(const QString&); +- void slotBondingRemoved(const QString&); +-*/ + void slotDeviceCreated(const QDBusObjectPath &); + void slotDeviceDisappeared(const QString &); + void slotDeviceFound(const QString &, const QMap< QString, QVariant > &); +Index: bluez-bluetoothmanager.cpp +=================================================================== +--- bluez-bluetoothmanager.cpp (.../branches/KDE/4.2/kdebase/workspace/solid/bluez) (revision 912529) ++++ solid/bluez/bluez-bluetoothmanager.cpp (.../trunk/KDE/kdebase/workspace/solid/bluez) (revision 912529) +@@ -104,6 +104,7 @@ + + QString BluezBluetoothManager::defaultInterface() const + { ++ kDebug() << "Calling Backend Default Interface"; + QDBusReply< QDBusObjectPath > path = d->manager.call("DefaultAdapter"); + if (!path.isValid()) + return QString(); +@@ -132,6 +133,16 @@ + return bluetoothInterface; + } + ++void BluezBluetoothManager::removeInterface(const QString& ubi) ++{ ++ ++ if (d->interfaces.contains(ubi)) { ++ kDebug() << "Removing Interface" << ubi; ++ BluezBluetoothInterface * bluetoothInterface = d->interfaces.take(ubi); ++ bluetoothInterface = 0; ++ } ++} ++ + /* + KJob *BluezBluetoothManager::setupInputDevice(const QString &ubi) + { +Index: bluez-bluetoothremotedevice.cpp +=================================================================== +--- bluez-bluetoothremotedevice.cpp (.../branches/KDE/4.2/kdebase/workspace/solid/bluez) (revision 912529) ++++ solid/bluez/bluez-bluetoothremotedevice.cpp (.../trunk/KDE/kdebase/workspace/solid/bluez) (revision 912529) +@@ -42,6 +42,7 @@ + m_adapter = m_objectPath.left(objectPath.size() - 18); + m_address = m_objectPath.right(17); + ++ kdDebug() << "Connecting to ObjectPath: " << objectPath; + + device = new QDBusInterface("org.bluez", objectPath, + "org.bluez.Device", QDBusConnection::systemBus()); +@@ -79,7 +80,7 @@ + + void BluezBluetoothRemoteDevice::setProperty(const QString &name, const QVariant &value) + { +- device->call("SetProperty",name,value); ++ device->call("SetProperty",name,qVariantFromValue(QDBusVariant(value))); + } + + void BluezBluetoothRemoteDevice::discoverServices(const QString& pattern) const +Index: bluez-bluetoothmanager.h +=================================================================== +--- bluez-bluetoothmanager.h (.../branches/KDE/4.2/kdebase/workspace/solid/bluez) (revision 912529) ++++ solid/bluez/bluez-bluetoothmanager.h (.../trunk/KDE/kdebase/workspace/solid/bluez) (revision 912529) +@@ -43,6 +43,7 @@ + virtual ~BluezBluetoothManager(); + QStringList bluetoothInterfaces() const; + QObject * createInterface(const QString &); ++ void removeInterface(const QString& ubi); + // QStringList bluetoothInputDevices() const; + QString defaultInterface() const; + QString findInterface(const QString &) const; +diff -Nur -x '[^b][^l]*' -x .svn 4_2libsControl/bluetoothinputdevice.cpp kdebase/workspace/libs/solid/control/bluetoothinputdevice.cpp +--- 4_2libsControl/bluetoothinputdevice.cpp 2009-01-17 17:51:33.000000000 +0100 ++++ libs/solid/control/bluetoothinputdevice.cpp 2009-01-14 21:06:47.000000000 +0100 +@@ -91,8 +91,8 @@ + FrontendObjectPrivate::setBackendObject(object); + + if (object) { +- QObject::connect(object, SIGNAL(propertyChanged(QString,QVariant)), +- parent(), SIGNAL(propertyChanged(QString,QVariant))); ++ QObject::connect(object, SIGNAL(propertyChanged(const QString&,const QVariant&)), ++ parent(), SIGNAL(propertyChanged(const QString,const QVariant&))); + } + } + +diff -Nur -x '[^b][^l]*' -x .svn 4_2libsControl/bluetoothinterface.cpp kdebase/workspace/libs/solid/control/bluetoothinterface.cpp +--- 4_2libsControl/bluetoothinterface.cpp 2009-01-17 17:51:33.000000000 +0100 ++++ libs/solid/control/bluetoothinterface.cpp 2009-01-16 12:11:03.000000000 +0100 +@@ -25,7 +25,7 @@ + #include <QStringList> + #include <QVariant> + +-#include <kdebug.h> ++#include <KDebug> + + #include "ifaces/bluetoothinterface.h" + +@@ -49,9 +49,12 @@ + void setBackendObject(QObject *object); + + QPair<BluetoothRemoteDevice *, Ifaces::BluetoothRemoteDevice *> findRegisteredBluetoothRemoteDevice(const QString &ubi) const; ++ QPair<BluetoothInputDevice *, Ifaces::BluetoothInputDevice *> findRegisteredBluetoothInputDevice(const QString &ubi) const; + + mutable QMap<QString, QPair<BluetoothRemoteDevice *, Ifaces::BluetoothRemoteDevice *> > remoteDeviceMap; ++ mutable QMap<QString, QPair<BluetoothInputDevice *, Ifaces::BluetoothInputDevice *> > inputDeviceMap; + mutable BluetoothRemoteDevice invalidDevice; ++ mutable BluetoothInputDevice invalidInputDevice; + }; + } + } +@@ -65,30 +68,39 @@ + { + const BluetoothInterface &device = BluetoothManager::self().findBluetoothInterface(ubi); + d->setBackendObject(device.d->backendObject()); ++ QObject::connect(d->backendObject(), SIGNAL(deviceCreated(const QString &)),this, SLOT(slotDeviceCreated(const QString &))); + } + + Solid::Control::BluetoothInterface::BluetoothInterface(QObject *backendObject) + : QObject(), d(new BluetoothInterfacePrivate(this)) + { + d->setBackendObject(backendObject); ++ QObject::connect(d->backendObject(), SIGNAL(deviceCreated(const QString &)),this, SLOT(slotDeviceCreated(const QString &))); + } + + Solid::Control::BluetoothInterface::BluetoothInterface(const BluetoothInterface &device) + : QObject(), d(new BluetoothInterfacePrivate(this)) + { + d->setBackendObject(device.d->backendObject()); ++ QObject::connect(d->backendObject(), SIGNAL(deviceCreated(const QString &)),this, SLOT(slotDeviceCreated(const QString &))); + } + + Solid::Control::BluetoothInterface::~BluetoothInterface() + { + // Delete all the interfaces, they are now outdated + typedef QPair<BluetoothRemoteDevice *, Ifaces::BluetoothRemoteDevice *> BluetoothRemoteDeviceIfacePair; ++ typedef QPair<BluetoothInputDevice *, Ifaces::BluetoothInputDevice *> BluetoothInputDeviceIfacePair; + + // Delete all the devices, they are now outdated +- foreach (const BluetoothRemoteDeviceIfacePair &pair, d->remoteDeviceMap) { ++ foreach (const BluetoothRemoteDeviceIfacePair &pair, d->remoteDeviceMap.values()) { + delete pair.first; + delete pair.second; + } ++ foreach (const BluetoothInputDeviceIfacePair &pair, d->inputDeviceMap.values()) { ++ delete pair.first; ++ delete pair.second; ++ } ++ + } + + Solid::Control::BluetoothInterface &Solid::Control::BluetoothInterface::operator=(const Solid::Control::BluetoothInterface & dev) +@@ -108,9 +120,12 @@ + SOLID_CALL(Ifaces::BluetoothInterface *, d->backendObject(), cancelDeviceCreation(address)); + } + +-QString Solid::Control::BluetoothInterface::createPairedDevice(const QString &address,const QString &adapterPath, const QString &capab) const ++void Solid::Control::BluetoothInterface::createPairedDevice(const QString &address,const QString &adapterPath, const QString &capab) const + { +- return_SOLID_CALL(Ifaces::BluetoothInterface *, d->backendObject(), QString(), createPairedDevice(address,adapterPath,capab)); ++ Ifaces::BluetoothInterface *backend = qobject_cast<Ifaces::BluetoothInterface *>(d->backendObject()); ++ if (backend == 0) ++ return; ++ backend->createPairedDevice(address,adapterPath,capab); + } + + QMap<QString, QVariant> Solid::Control::BluetoothInterface::getProperties() const +@@ -137,7 +152,7 @@ + + Solid::Control::BluetoothRemoteDeviceList list; + foreach (const QString& ubi,ubis) { +- BluetoothRemoteDevice remoteDevice = findBluetoothRemoteDevice(ubi); ++ BluetoothRemoteDevice* remoteDevice = findBluetoothRemoteDeviceUBI(ubi); + list.append(remoteDevice); + } + return list; +@@ -184,13 +199,13 @@ + } + + +-Solid::Control::BluetoothRemoteDevice Solid::Control::BluetoothInterface::findBluetoothRemoteDevice(const QString &address) const ++Solid::Control::BluetoothRemoteDevice Solid::Control::BluetoothInterface::findBluetoothRemoteDeviceAddr(const QString &address) const + { + Ifaces::BluetoothInterface *backend = qobject_cast<Ifaces::BluetoothInterface *>(d->backendObject()); + if (backend == 0) + return d->invalidDevice; + +- const QString ubi = backend->findDevice(address); ++ const QString ubi = getBluetoothRemoteDeviceUBI(address); + + QPair<BluetoothRemoteDevice *, Ifaces::BluetoothRemoteDevice *> pair = d->findRegisteredBluetoothRemoteDevice(ubi); + +@@ -201,18 +216,56 @@ + } + } + +-Solid::Control::BluetoothRemoteDevice * Solid::Control::BluetoothInterface::createBluetoothRemoteDevice(const QString &address) ++ ++const QString Solid::Control::BluetoothInterface::getBluetoothRemoteDeviceUBI(const QString &address) const + { + Ifaces::BluetoothInterface *backend = qobject_cast<Ifaces::BluetoothInterface *>(d->backendObject()); + if (backend == 0) +- return 0; ++ return ""; ++ ++ const QString ubi = backend->findDevice(address); ++ return ubi; ++} + +- const QString ubi = backend->createDevice(address); + ++void Solid::Control::BluetoothInterface::createBluetoothRemoteDevice(const QString &address) ++{ ++ Ifaces::BluetoothInterface *backend = qobject_cast<Ifaces::BluetoothInterface *>(d->backendObject()); ++ if (backend == 0) ++ return; ++ backend->createDevice(address); ++} ++ ++ ++Solid::Control::BluetoothRemoteDevice* Solid::Control::BluetoothInterface::findBluetoothRemoteDeviceUBI(const QString &ubi) const ++{ + QPair<BluetoothRemoteDevice *, Ifaces::BluetoothRemoteDevice *> pair = d->findRegisteredBluetoothRemoteDevice(ubi); + return pair.first; + } + ++Solid::Control::BluetoothInputDevice* Solid::Control::BluetoothInterface::findBluetoothInputDeviceUBI(const QString &ubi) const ++{ ++ QPair<BluetoothInputDevice *, Ifaces::BluetoothInputDevice *> pair = d->findRegisteredBluetoothInputDevice(ubi); ++ return pair.first; ++} ++ ++void Solid::Control::BluetoothInterface::slotDeviceCreated(const QString& ubi) ++{ ++ ++ Ifaces::BluetoothInterface *backend = qobject_cast<Ifaces::BluetoothInterface *>(d->backendObject()); ++ Ifaces::BluetoothRemoteDevice *iface = 0; ++ ++ if (backend != 0) { ++ iface = qobject_cast<Ifaces::BluetoothRemoteDevice *>(backend->createBluetoothRemoteDevice(ubi)); ++ } ++ ++ if (iface != 0) { ++ BluetoothRemoteDevice *device = new BluetoothRemoteDevice(iface); ++ ++ QPair<BluetoothRemoteDevice *, Ifaces::BluetoothRemoteDevice *> pair(device, iface); ++ d->remoteDeviceMap[ubi] = pair; ++ } ++} + + QString Solid::Control::BluetoothInterface::address() const + { +@@ -492,8 +545,6 @@ + QObject::connect(object, SIGNAL(propertyChanged(const QString &,const QVariant &)), + parent(), SIGNAL(propertyChanged(const QString &, const QVariant &))); + +- +- + } + } + +@@ -521,6 +572,32 @@ + } + + } ++} ++ ++QPair<Solid::Control::BluetoothInputDevice *, Solid::Control::Ifaces::BluetoothInputDevice *> Solid::Control::BluetoothInterfacePrivate::findRegisteredBluetoothInputDevice(const QString &ubi) const ++{ ++ if (inputDeviceMap.contains(ubi)) { ++ return inputDeviceMap[ubi]; ++ } else { ++ Ifaces::BluetoothInterface *backend = qobject_cast<Ifaces::BluetoothInterface *>(backendObject()); ++ Ifaces::BluetoothInputDevice *iface = 0; ++ ++ if (backend != 0) { ++ iface = qobject_cast<Ifaces::BluetoothInputDevice *>(backend->createBluetoothInputDevice(ubi)); ++ } ++ ++ if (iface != 0) { ++ BluetoothInputDevice *device = new BluetoothInputDevice(iface); ++ ++ QPair<BluetoothInputDevice *, Ifaces::BluetoothInputDevice *> pair(device, iface); ++ inputDeviceMap[ubi] = pair; ++ ++ return pair; ++ } else { ++ return QPair<BluetoothInputDevice *, Ifaces::BluetoothInputDevice *>(0, 0); ++ } ++ ++ } + } + + #include "bluetoothinterface.moc" +diff -Nur -x '[^b][^l]*' -x .svn 4_2libsControl/bluetoothinterface.h kdebase/workspace/libs/solid/control/bluetoothinterface.h +--- 4_2libsControl/bluetoothinterface.h 2009-01-17 17:51:33.000000000 +0100 ++++ libs/solid/control/bluetoothinterface.h 2009-01-14 14:17:14.000000000 +0100 +@@ -28,7 +28,9 @@ + #include <QtCore/QMap> + + #include "bluetoothremotedevice.h" ++#include "bluetoothinputdevice.h" + #include "ifaces/bluetoothremotedevice.h" ++#include "ifaces/bluetoothinputdevice.h" + + + +@@ -37,7 +39,7 @@ + namespace Control + { + class BluetoothRemoteDevice; +-typedef QList<BluetoothRemoteDevice> BluetoothRemoteDeviceList; ++typedef QList<BluetoothRemoteDevice*> BluetoothRemoteDeviceList; + class BluetoothInterfacePrivate; + + /** +@@ -115,7 +117,8 @@ + * @param ubi the identifier of the bluetooth device to instantiate + * @returns a bluetooth object, if a bluetooth device having the given UBI, for this interface exists, 0 otherwise + */ +- Solid::Control::BluetoothRemoteDevice* createBluetoothRemoteDevice(const QString &address); ++ //Solid::Control::BluetoothRemoteDevice* createBluetoothRemoteDevice(const QString &address); ++ void createBluetoothRemoteDevice(const QString &address); + + /** + * Finds a BluetoothRemoteDevice object given its UBI. +@@ -123,7 +126,13 @@ + * @param ubi the identifier of the bluetooth remote device to find from this bluetooth interface + * @returns a valid BluetoothRemoteDevice object if a remote device having the given UBI for this interface exists, an invalid BluetoothRemoteDevice object otherwise. + */ +- Solid::Control::BluetoothRemoteDevice findBluetoothRemoteDevice(const QString &address) const; ++ const QString getBluetoothRemoteDeviceUBI(const QString &address) const; ++ ++ Solid::Control::BluetoothRemoteDevice findBluetoothRemoteDeviceAddr(const QString &addr) const; ++ ++ Solid::Control::BluetoothRemoteDevice* findBluetoothRemoteDeviceUBI(const QString &ubi) const; ++ ++ Solid::Control::BluetoothInputDevice* findBluetoothInputDeviceUBI(const QString &ubi) const; + + /** + * Retrieves the MAC address of the bluetooth interface/adapter. +@@ -296,7 +305,7 @@ + // bool isTrusted(const QString &); + + +- QString createPairedDevice(const QString &, const QString &, const QString &) const; ++ void createPairedDevice(const QString &, const QString &, const QString &) const; + + QMap< QString, QVariant > getProperties() const; + +@@ -557,6 +566,9 @@ + QVariant getProperty(const QString&) const; + BluetoothInterfacePrivate * const d; + ++private slots: ++ void slotDeviceCreated(const QString& ubi); ++ + }; + + } //Control +diff -Nur -x '[^b][^l]*' -x .svn 4_2libsControl/bluetoothmanager.cpp kdebase/workspace/libs/solid/control/bluetoothmanager.cpp +--- 4_2libsControl/bluetoothmanager.cpp 2009-01-17 17:51:33.000000000 +0100 ++++ libs/solid/control/bluetoothmanager.cpp 2009-01-16 13:17:33.000000000 +0100 +@@ -58,6 +58,7 @@ + + void _k_interfaceAdded(const QString &ubi); + void _k_interfaceRemoved(const QString &ubi); ++ void _k_defaultInterfaceChanged(const QString &ubi); + void _k_interfaceDestroyed(QObject *object); + /* + void _k_inputDeviceCreated(const QString &ubi); +@@ -95,7 +96,7 @@ + typedef QPair<BluetoothInterface *, Ifaces::BluetoothInterface *> BluetoothInterfaceIfacePair; + + // Delete all the devices, they are now outdated +- foreach (const BluetoothInterfaceIfacePair &pair, d->bluetoothInterfaceMap) { ++ foreach (const BluetoothInterfaceIfacePair &pair, d->bluetoothInterfaceMap.values()) { + delete pair.first; + delete pair.second; + } +@@ -110,6 +111,8 @@ + + if (backend == 0) return list; + ++ kDebug() << "UBI List " << ubiList; ++ + foreach (const QString &ubi, ubiList) { + QPair<BluetoothInterface *, Ifaces::BluetoothInterface *> pair = d->findRegisteredBluetoothInterface(ubi); + +@@ -239,7 +242,9 @@ + */ + void Solid::Control::BluetoothManagerPrivate::_k_interfaceAdded(const QString &ubi) + { +- QPair<BluetoothInterface *, Ifaces::BluetoothInterface *> pair = bluetoothInterfaceMap.take(ubi); ++ kDebug() << "Size of InterfaceList " << bluetoothInterfaceMap.size(); ++ QPair<BluetoothInterface *, Ifaces::BluetoothInterface *> pair = findRegisteredBluetoothInterface(ubi); ++/* QPair<BluetoothInterface *, Ifaces::BluetoothInterface *> pair = bluetoothInterfaceMap.take(ubi); + + if (pair.first != 0) { + // Oops, I'm not sure it should happen... +@@ -247,7 +252,7 @@ + + delete pair.first; + delete pair.second; +- } ++ }*/ + + emit q->interfaceAdded(ubi); + } +@@ -261,11 +266,19 @@ + delete pair.second; + } + ++ Ifaces::BluetoothManager *backend = qobject_cast<Ifaces::BluetoothManager *>(managerBackend()); ++ backend->removeInterface(ubi); + emit q->interfaceRemoved(ubi); + } + ++void Solid::Control::BluetoothManagerPrivate::_k_defaultInterfaceChanged(const QString &ubi) |
