@@ -78,13 +78,8 @@ Rectangle {
7878 InputDeviceModel {
7979 id: keyboardsModel
8080 deviceFilter: InputInfo.Keyboard
81− onDeviceAdded: {
82− root.forceOSKEnabled = autopilotDevices.autopilotDevicePresent();
83− }
84−
85− onDeviceRemoved: {
86− root.forceOSKEnabled = autopilotDevices.autopilotDevicePresent();
87− }
81+ onDeviceAdded: forceOSKEnabled = autopilotDevicePresent();
82+ onDeviceRemoved: forceOSKEnabled = autopilotDevicePresent();
8883 }
8984
9085 InputDeviceModel {
@@ -92,26 +87,25 @@ Rectangle {
9287 deviceFilter: InputInfo.TouchScreen
9388 }
9489
95− /* FIXME: This is a work arround for lp:1542224.
96− * When QInputInfo exposes NameRole to QML, the filtering should
97− * happen in the backend.
90+ /* FIXME: This exposes the NameRole as a work arround for lp:1542224.
91+ * When QInputInfo exposes NameRole to QML, this should be removed.
9892 */
9993 property bool forceOSKEnabled: false
10094 property var autopilotEmulatedDeviceNames: ["py-evdev-uinput"]
10195 UnitySortFilterProxyModel {
10296 id: autopilotDevices
10397 model: keyboardsModel
98+ }
10499
105− function autopilotdDevicePresent() {
106− for(var i = 0; i < count; i++) {
107− var device = get(i);
108− if (autopilotEmulatedDeviceNames.indexOf(device.name) != -1) {
109− console.warn("Forcing the OSK to be enabled as there is an autopilot eumlated device present.")
110− return true;
111− }
100+ function autopilotDevicePresent() {
101+ for(var i = 0; i < autopilotDevices.count; i++) {
102+ var device = autopilotDevices.get(i);
103+ if (autopilotEmulatedDeviceNames.indexOf(device.name) != -1) {
104+ console.warn("Forcing the OSK to be enabled as there is an autopilot eumlated device present.")
105+ return true;
112106 }
113− return false;
114107 }
108+ return false;
115109 }
116110
117111 Screens {