summaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
Diffstat (limited to 'qt-ui')
-rw-r--r--qt-ui/btdeviceselectiondialog.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/qt-ui/btdeviceselectiondialog.cpp b/qt-ui/btdeviceselectiondialog.cpp
index a257e249c..c78b01b94 100644
--- a/qt-ui/btdeviceselectiondialog.cpp
+++ b/qt-ui/btdeviceselectiondialog.cpp
@@ -192,7 +192,10 @@ void BtDeviceSelectionDialog::hostModeStateChanged(QBluetoothLocalDevice::HostMo
void BtDeviceSelectionDialog::addRemoteDevice(const QBluetoothDeviceInfo &remoteDeviceInfo)
{
#if defined(Q_OS_WIN)
- // TODO add the remote device
+ // On Windows we cannot obtain the pairing status so we set only the name and the address of the device
+ QString deviceLabel = QString("%1 (%2)").arg(remoteDeviceInfo.name(),
+ remoteDeviceInfo.address().toString());
+ QColor pairingColor = QColor(Qt::white);
#else
// By default we use the status label and the color for the UNPAIRED state
QColor pairingColor = QColor(Qt::red);
@@ -210,13 +213,14 @@ void BtDeviceSelectionDialog::addRemoteDevice(const QBluetoothDeviceInfo &remote
QString deviceLabel = QString("%1 (%2) [State: %3]").arg(remoteDeviceInfo.name(),
remoteDeviceInfo.address().toString(),
pairingStatusLabel);
+#endif
+ // Create the new item, set its information and add it to the list
QListWidgetItem *item = new QListWidgetItem(deviceLabel);
item->setData(Qt::UserRole, QVariant::fromValue(remoteDeviceInfo));
item->setBackgroundColor(pairingColor);
ui->discoveredDevicesList->addItem(item);
-#endif
}
void BtDeviceSelectionDialog::itemClicked(QListWidgetItem *item)