summaryrefslogtreecommitdiffstats
path: root/src/platformsupport/input/evdevtouch
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2019-06-12 23:58:36 +0200
committerMarc Mutz <marc.mutz@kdab.com>2019-06-13 08:48:26 +0200
commit779f1ff9fad916ce7beb7dfbf3a96b0207c01319 (patch)
treef02c588a79c6c1b20a9ff6ac8b7ea5824bf8009d /src/platformsupport/input/evdevtouch
parentf1404c0ed1f89df931210a843727a1fd4eaef6a8 (diff)
QEvdev: remove m_deviceDiscovery members
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 <allan.jensen@qt.io> Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src/platformsupport/input/evdevtouch')
-rw-r--r--src/platformsupport/input/evdevtouch/qevdevtouchmanager.cpp9
-rw-r--r--src/platformsupport/input/evdevtouch/qevdevtouchmanager_p.h1
2 files changed, 4 insertions, 6 deletions
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<QEvdevTouchScreenHandlerThread> m_activeDevices;
};