summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/btdeviceselectiondialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'desktop-widgets/btdeviceselectiondialog.cpp')
-rw-r--r--desktop-widgets/btdeviceselectiondialog.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/desktop-widgets/btdeviceselectiondialog.cpp b/desktop-widgets/btdeviceselectiondialog.cpp
index 1b43c8471..de3e383c5 100644
--- a/desktop-widgets/btdeviceselectiondialog.cpp
+++ b/desktop-widgets/btdeviceselectiondialog.cpp
@@ -466,6 +466,20 @@ QString BtDeviceSelectionDialog::getSelectedDeviceName()
return QString();
}
+QString BtDeviceSelectionDialog::getSelectedDeviceText()
+{
+ return formatDeviceText(getSelectedDeviceAddress(), getSelectedDeviceName());
+}
+
+QString BtDeviceSelectionDialog::formatDeviceText(const QString &address, const QString &name)
+{
+ if (address.isEmpty())
+ return name;
+ if (name.isEmpty())
+ return address;
+ return QString("%1 (%2)").arg(name, address);
+}
+
void BtDeviceSelectionDialog::updateLocalDeviceInformation()
{
#if defined(Q_OS_WIN)