on xenial help sign in
Make use of existing function
5e3edacDaniel d'Andrada
qml/Stages/TabletStage.qml+4−11
@@ -82,17 +82,10 @@ Rectangle {
82 }
82 }
83
83
84 function updateSpreadDelegateFocus() {
84 function updateSpreadDelegateFocus() {
85− var appIndex = 0;
85+ var focusedAppIndex = priv.indexOf(priv.focusedAppId);
86− var found = false;
86+ if (focusedAppIndex !== -1) {
87− while (!found && appIndex < ApplicationManager.count) {
88− if (ApplicationManager.get(appIndex).appId === priv.focusedAppId) {
89− spreadRepeater.itemAt(appIndex).focus = true;
87+ spreadRepeater.itemAt(focusedAppIndex).focus = true;
90− found = true;
91− } else {
88+ } else {
92− ++appIndex;
93− }
94− }
95− if (!found) {
96 console.warn("TabletStage: Failed to find the SpreadDelegate for appID=" + priv.focusedAppId);
89 console.warn("TabletStage: Failed to find the SpreadDelegate for appID=" + priv.focusedAppId);
97 }
90 }
98 }
91 }