fire profiles changed signal when uuids change
authorKevron Rees <kevron_m_rees@linux.intel.com>
Mon, 4 Apr 2011 18:06:46 +0000 (11:06 -0700)
committerKevron Rees <kevron_m_rees@linux.intel.com>
Mon, 4 Apr 2011 18:06:46 +0000 (11:06 -0700)
bluetoothdevice.cpp
bluetoothdevice.h

index cd6807d..ad7758b 100644 (file)
@@ -188,14 +188,20 @@ QString BluetoothDevice::path()
 
 void BluetoothDevice::propertyChanged(QString name,QDBusVariant value)
 {
-    emit propertyChanged(name,value.variant());
-
     qDebug()<<"BluetoothDevice::propertyChanged()";
 
     if(name == "Connected")
     {
-       emit connectedChanged(value.variant().toBool());
+           emit connectedChanged(value.variant().toBool());
+    }
+
+    if(name == "UUIDs")
+    {
+           emit profilesChanged(value.variant().toStringList());
     }
+
+     emit propertyChanged(name,value.variant());
+
     ///TODO: create individual signals for each property
 }
 
index eb4ac15..c0aad35 100644 (file)
@@ -14,7 +14,7 @@ class BluetoothDevice : public QObject
        Q_PROPERTY(bool connected READ connected NOTIFY connectedChanged);
        Q_PROPERTY(bool audioConnected READ audioConnected NOTIFY audioConnectedChanged)
        Q_PROPERTY(bool inputConnected READ inputConnected NOTIFY inputConnectedChanged)
-       Q_PROPERTY(QStringList profiles READ profiles)
+       Q_PROPERTY(QStringList profiles READ profiles NOTIFY profilesChanged)
        Q_PROPERTY(QString alias READ alias)
        Q_PROPERTY(QString name READ name)
        Q_PROPERTY(QString address READ address)
@@ -29,6 +29,7 @@ signals:
        void audioConnectedChanged(bool isConnected);
        void inputConnectedChanged(bool isConnected);
        void propertyChanged(QString name, QVariant value);
+       void profilesChanged(QStringList uuids);
 
 public slots:
        void unpair();