From 779f1ff9fad916ce7beb7dfbf3a96b0207c01319 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Wed, 12 Jun 2019 23:58:36 +0200 Subject: QEvdev: remove m_deviceDiscovery members MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit They were never referenced outside the classes' ctor and, worse, remained uninitialized if the specification string contained devices. Change-Id: I977a156acf10190428da00fe128fee70cff8f98d Reviewed-by: Allan Sandfeld Jensen Reviewed-by: MÃ¥rten Nordheim --- src/platformsupport/input/evdevtouch/qevdevtouchmanager.cpp | 9 ++++----- src/platformsupport/input/evdevtouch/qevdevtouchmanager_p.h | 1 - 2 files changed, 4 insertions(+), 6 deletions(-) (limited to 'src/platformsupport/input/evdevtouch') diff --git a/src/platformsupport/input/evdevtouch/qevdevtouchmanager.cpp b/src/platformsupport/input/evdevtouch/qevdevtouchmanager.cpp index a945bd6168..b280f27fac 100644 --- a/src/platformsupport/input/evdevtouch/qevdevtouchmanager.cpp +++ b/src/platformsupport/input/evdevtouch/qevdevtouchmanager.cpp @@ -76,15 +76,14 @@ QEvdevTouchManager::QEvdevTouchManager(const QString &key, const QString &specif // when no devices specified, use device discovery to scan and monitor if (parsed.devices.isEmpty()) { qCDebug(qLcEvdevTouch, "evdevtouch: Using device discovery"); - m_deviceDiscovery = QDeviceDiscovery::create(QDeviceDiscovery::Device_Touchpad | QDeviceDiscovery::Device_Touchscreen, this); - if (m_deviceDiscovery) { - const QStringList devices = m_deviceDiscovery->scanConnectedDevices(); + if (auto deviceDiscovery = QDeviceDiscovery::create(QDeviceDiscovery::Device_Touchpad | QDeviceDiscovery::Device_Touchscreen, this)) { + const QStringList devices = deviceDiscovery->scanConnectedDevices(); for (const QString &device : devices) addDevice(device); - connect(m_deviceDiscovery, &QDeviceDiscovery::deviceDetected, + connect(deviceDiscovery, &QDeviceDiscovery::deviceDetected, this, &QEvdevTouchManager::addDevice); - connect(m_deviceDiscovery, &QDeviceDiscovery::deviceRemoved, + connect(deviceDiscovery, &QDeviceDiscovery::deviceRemoved, this, &QEvdevTouchManager::removeDevice); } } diff --git a/src/platformsupport/input/evdevtouch/qevdevtouchmanager_p.h b/src/platformsupport/input/evdevtouch/qevdevtouchmanager_p.h index 97f3137676..94ee05d900 100644 --- a/src/platformsupport/input/evdevtouch/qevdevtouchmanager_p.h +++ b/src/platformsupport/input/evdevtouch/qevdevtouchmanager_p.h @@ -75,7 +75,6 @@ public: private: QString m_spec; - QDeviceDiscovery *m_deviceDiscovery; QtInputSupport::DeviceHandlerList m_activeDevices; }; -- cgit v1.2.3