56
56
property ListModel searchHistory: SearchHistoryModel {}
58
// if running in Hybris environment, can offload running app management to it, else we fake it
59
property var applicationManager
60
// whether or not "import Ubuntu.Application" would work
61
property bool importUbuntuApplicationAvailable: checkImportUbuntuApplicationAvailable()
63
/* Checks if the "Ubuntu.Application" plugin is available, and if so use it for application management.
64
Returns true if the plugin is available, false otherwise.
66
This works around the lack of conditional imports in QML.
67
Ref.: https://bugreports.qt-project.org/browse/QTBUG-16854
69
function checkImportUbuntuApplicationAvailable() {
71
var object = Qt.createQmlObject('import Ubuntu.Application 0.1; import QtQuick 2.0; QtObject {}', shell, "");
75
console.log("NOTICE: The Ubuntu.Application plugin was not found, so all window management is emulated in this application.\n\
76
This emulation will not be perfect, you *must* not trust it. To be safe always test on a device with Ubuntu.Application available.");
58
property var applicationManager: ApplicationManagerWrapper {}
81
60
Component.onCompleted: {
83
if (!importUbuntuApplicationAvailable) {
84
component = Qt.createComponent("Components/ApplicationManagerFake.qml");
86
component = Qt.createComponent("Components/ApplicationManagerWrapper.qml");
89
applicationManager = component.createObject(shell);
90
61
applicationManager.sideStageEnabled = Qt.binding(function() { return sideStage.enabled })
92
63
// FIXME: if application focused before shell starts, shell draws on top of it only.