From f29be50497a3a8510f9a4ef9a87f62f356e5bd24 Mon Sep 17 00:00:00 2001 From: Dominik Holland Date: Wed, 5 Oct 2016 14:32:06 +0200 Subject: [PATCH] Use appman's preload instead of auto launching the apps itself Previously we maintained an own list of applications which should be auto started and minimized. Now we use appman's preload property in info.yaml to identify the apps which are autostarted and should be started minimized Change-Id: If0be0732de25da73ac6fce02dee2ffbd843bac47 Reviewed-by: Nedim Hadzic --- .../models/ApplicationManagerInterface.qml | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/imports/system/models/ApplicationManagerInterface.qml b/imports/system/models/ApplicationManagerInterface.qml index 9196606..b2071f7 100644 --- a/imports/system/models/ApplicationManagerInterface.qml +++ b/imports/system/models/ApplicationManagerInterface.qml @@ -43,20 +43,11 @@ QtObject { property string activeAppId property variant blackListItems: [] - property var minimizedItems: [NavigationService.defaultNavApp] // Apps which will be started but not shown in full screen + property var minimizedItems: [] // Apps which will be started but not shown in full screen property Item windowItem property Item mapWidget property var itemsToRelease: [] - property Timer timer: Timer { - interval: 1000 - onTriggered: { - for (var i in root.minimizedItems) { - ApplicationManager.startApplication(root.minimizedItems[i]) - } - } - } - signal applicationSurfaceReady(Item item, bool isMinimized) signal releaseApplicationSurface() @@ -64,12 +55,20 @@ QtObject { signal clusterWidgetReady(string category, Item item) Component.onCompleted: { + // Maintain a set of applications which are autostarted(preloaded) + // This is needed to know that these applications should be minimized + for (var i = 0; i < ApplicationManager.count; ++i) { + var app = ApplicationManager.get(i); + if (app.application.preload) { + minimizedItems.push(app.applicationId) + } + } + WindowManager.windowReady.connect(windowReadyHandler) WindowManager.windowClosing.connect(windowClosingHandler) ApplicationManager.applicationWasActivated.connect(applicationActivated) WindowManager.windowLost.connect(windowLostHandler) WindowManager.windowPropertyChanged.connect(windowPropertyChanged) - timer.start() } function windowReadyHandler(index, item) {