@@ -28,9 +28,7 @@ Rectangle {
2828 // Controls to be set from outside
2929 property int dragAreaWidth
3030 property real maximizedAppTopMargin
31−
32− // FIXME: Should be registerd singleton type QAbstractItemModel.
33− property var surfaces
31+ property var applications
3432
3533 // State information propagated to the outside
3634 property bool fullscreen: priv.focusedApplication ? priv.focusedApplication.fullscreen : false
@@ -95,8 +93,6 @@ Rectangle {
9593 applicationSwitchingAnimation.start();
9694 } else {
9795 ApplicationManager.focusApplication(appId);
98− // TODO: Should happen behind the schenes
99− surfaces.move(surfaces.getIndexOfSurfaceWithAppId(appId), 0);
10096 }
10197 }
10298
@@ -213,9 +209,6 @@ Rectangle {
213209 if (spreadView.selectedIndex >= 0) {
214210 ApplicationManager.focusApplication(ApplicationManager.get(spreadView.selectedIndex).appId);
215211
216− // TODO: Should happen behind the schenes
217− surfaces.move(spreadView.selectedIndex, 0);
218−
219212 spreadView.selectedIndex = -1
220213 spreadView.phase = 0;
221214 spreadView.contentX = -spreadView.shift;
@@ -235,7 +228,7 @@ Rectangle {
235228
236229 Repeater {
237230 id: spreadRepeater
238− model: root.surfaces
231+ model: root.applications
239232 delegate: TransformedSpreadDelegate {
240233 id: appDelegate
241234 objectName: "appDelegate" + index
@@ -249,7 +242,7 @@ Rectangle {
249242 height: spreadView.height
250243 selected: spreadView.selectedIndex == index
251244 otherSelected: spreadView.selectedIndex >= 0 && !selected
252− surface: model.surface
245+ application: root.applications.get(index)
253246 interactive: !spreadView.interactive
254247 maximizedAppTopMargin: root.maximizedAppTopMargin
255248