From dc26e351320821fa71bcce418100f57f03eff50d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Kotiuk?= Date: Wed, 10 Apr 2024 01:01:10 +0200 Subject: [PATCH 1/2] fix: Add missing include --- src/joycontrolstickcontextmenu.cpp | 1 + src/joysensorcontextmenu.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/src/joycontrolstickcontextmenu.cpp b/src/joycontrolstickcontextmenu.cpp index d9adec294..636b857a3 100644 --- a/src/joycontrolstickcontextmenu.cpp +++ b/src/joycontrolstickcontextmenu.cpp @@ -25,6 +25,7 @@ #include "joycontrolstick.h" #include "mousedialog/mousecontrolsticksettingsdialog.h" +#include #include #include #include diff --git a/src/joysensorcontextmenu.cpp b/src/joysensorcontextmenu.cpp index 00cbfc489..0045c4612 100644 --- a/src/joysensorcontextmenu.cpp +++ b/src/joysensorcontextmenu.cpp @@ -23,6 +23,7 @@ #include "joysensor.h" #include "mousedialog/mousesensorsettingsdialog.h" +#include #include #include #include From 61e01ea6904cbf7ad7276646aeec6f405c3f6486 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Kotiuk?= Date: Wed, 10 Apr 2024 20:15:03 +0200 Subject: [PATCH 2/2] refactor: Remove loop using iterator --- src/eventhandlers/uinputeventhandler.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/eventhandlers/uinputeventhandler.cpp b/src/eventhandlers/uinputeventhandler.cpp index d14ff81ab..58577dc07 100644 --- a/src/eventhandlers/uinputeventhandler.cpp +++ b/src/eventhandlers/uinputeventhandler.cpp @@ -26,7 +26,6 @@ #include #include #include -#include #include #include @@ -289,17 +288,14 @@ int UInputEventHandler::openUInputHandle() locations.append("/dev/misc/uinput"); QString possibleLocation; - QStringListIterator iter(locations); - while (iter.hasNext()) + for (auto &&temp : locations) { - QString temp = iter.next(); QFileInfo tempFileInfo(temp); - if (tempFileInfo.exists()) { possibleLocation = temp; - iter.toBack(); + break; } }