From daba4737a9e1c43bb6284f235428cd04e2d8b938 Mon Sep 17 00:00:00 2001
From: Alex Blasche <alexander.blasche@digia.com>
Date: Wed, 29 Oct 2014 16:42:47 +0100
Subject: [PATCH] Force lowenergyscanner to show empty list if we did not find
 services

Previously the UI was only updated when a new service was discovered
on a device. In the extremely rare event of no services being found
the UI was hanging in the "Searching for services" view.

Change-Id: I245216ac4e373a765dea2e182ab541e8830417d0
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
---
 examples/bluetooth/lowenergyscanner/device.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/examples/bluetooth/lowenergyscanner/device.cpp b/examples/bluetooth/lowenergyscanner/device.cpp
index b8d61fe3..1f1e11c4 100644
--- a/examples/bluetooth/lowenergyscanner/device.cpp
+++ b/examples/bluetooth/lowenergyscanner/device.cpp
@@ -206,6 +206,9 @@ void Device::addLowEnergyService(const QBluetoothUuid &serviceUuid)
 void Device::serviceScanDone()
 {
     setUpdate("Service scan done!");
+    // force UI in case we didn't find anything
+    if (m_services.isEmpty())
+        emit servicesUpdated();
 }
 
 void Device::connectToService(const QString &uuid)
-- 
GitLab