@@ -82,17 +82,10 @@ Rectangle {
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;
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);