summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Lemire <paul.lemire@kdab.com>2016-08-24 11:19:42 +0200
committerPaul Lemire <paul.lemire@kdab.com>2016-08-27 17:32:35 +0000
commit446a92c01003df192d01ff562c6088eee66a8b6c (patch)
tree6968f9bcc5ba22a079d6fe89edbf89b12184b960
parent04e21fe5394d0259ac6d4f9cafd595f8b2d87d9f (diff)
QInputAspect: slightly simplify createPhysicalDevice
Change-Id: Ibb21c59904bd7077e0e254fce5822241b2b9ee82 Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
-rw-r--r--src/input/frontend/qinputaspect.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/input/frontend/qinputaspect.cpp b/src/input/frontend/qinputaspect.cpp
index 342998556..d0e91a362 100644
--- a/src/input/frontend/qinputaspect.cpp
+++ b/src/input/frontend/qinputaspect.cpp
@@ -189,11 +189,12 @@ QAbstractPhysicalDevice *QInputAspect::createPhysicalDevice(const QString &name)
{
Q_D(QInputAspect);
const auto integrations = d->m_inputHandler->inputDeviceIntegrations();
+ QAbstractPhysicalDevice *device = nullptr;
for (Qt3DInput::QInputDeviceIntegration *integration : integrations) {
- if (auto dev = integration->createPhysicalDevice(name))
- return dev;
+ if ((device = integration->createPhysicalDevice(name)) != nullptr)
+ break;
}
- return nullptr;
+ return device;
}
/*!