Index: sources/view/VBluetoothDeviceInfo.cpp =================================================================== diff -u -r0470ff6f209ff0c5089f8f0849b6da04f60f8f41 -r5696b8db4628ee3143d93952c5dbdf511fa985b1 --- sources/view/VBluetoothDeviceInfo.cpp (.../VBluetoothDeviceInfo.cpp) (revision 0470ff6f209ff0c5089f8f0849b6da04f60f8f41) +++ sources/view/VBluetoothDeviceInfo.cpp (.../VBluetoothDeviceInfo.cpp) (revision 5696b8db4628ee3143d93952c5dbdf511fa985b1) @@ -13,22 +13,9 @@ * Constructor for the VBluetoothDeviceInfo class * \param info - the device information */ -VBluetoothDeviceInfo::VBluetoothDeviceInfo(const QBluetoothDeviceInfo &info) -{ - device = info; -} +VBluetoothDeviceInfo::VBluetoothDeviceInfo(const QBluetoothDeviceInfo &info) : device(info), connected(false) {} /*! - * \brief VBluetoothDeviceInfo::getDevice - * Gets the QBluetoothDeviceInfo this class describes - * \return The QBluetoothDeviceInfo object - */ -QBluetoothDeviceInfo VBluetoothDeviceInfo::getDevice() const -{ - return device; -} - -/*! * \brief VBluetoothDeviceInfo::getName * Gets the name of the device * \return QString - the name of the device @@ -49,12 +36,24 @@ } /*! - * \brief VBluetoothDeviceInfo::setDevice - * Sets the QBluetoothDeviceInfo object to a new object - * \param device - the new QbluetoothDeviceInfo device + * \brief VBluetoothDeviceInfo::setConnected + * Sets the bluetooth connection state */ -void VBluetoothDeviceInfo::setDevice(const QBluetoothDeviceInfo &device) +void VBluetoothDeviceInfo::setConnected(const bool &conn) { - this->device = device; - emit deviceChanged(); + if (conn != connected) + { + connected = conn; + emit deviceChanged(); + } } + +/*! + * \brief VBluetoothDeviceInfo::isConnected + * Gets the bluetooth connection state + * \return bool - true if connected, false otherwise + */ +bool VBluetoothDeviceInfo::isConnected() const +{ + return connected; +}