on xenial help sign in
If not running in Mir load the "fake" application manager

Fixes: 1301547

commit6b82fd1b6a989b1f47f6b4e5ec5d7ab703b5d751 authorAlbert Astals <albert.astals@canonical.com> dateThu 3 Apr 2014, 10:37 (13 years ago) parent2faa73dcab4d9c
5 files changed+29
debian/unity8-fake-env.install+1 include/paths.h.in+10 src/main.cpp+3 tests/mocks/Unity/Application/CMakeLists.txt+14 tools/scopetool.cpp+1
debian/unity8-fake-env.install+1
@@ -1,3 +1,4 @@
1+usr/lib/*/unity8/qml/nonmirplugins
12usr/lib/*/unity8/qml/mocks
23usr/lib/*/unity8/qml/scopefakes
34usr/share/unity8/mocks
include/paths.h.in+10
@@ -57,6 +57,16 @@ inline QStringList overrideImportPaths() {
5757 return paths;
5858}
5959
60+inline QStringList nonMirImportPaths() {
61+ QStringList paths;
62+ if (isRunningInstalled()) {
63+ paths << QString("@CMAKE_INSTALL_PREFIX@/@SHELL_INSTALL_QML@/nonmirplugins");
64+ } else {
65+ paths << QString("@CMAKE_BINARY_DIR@/nonmirplugins");
66+ }
67+ return paths;
68+}
69+
6070inline QStringList fallbackImportPaths() {
6171 QStringList paths;
6272 if (isRunningInstalled()) {
src/main.cpp+3
@@ -117,6 +117,9 @@ int startShell(int argc, const char** argv, void* server)
117117
118118 QUrl source(::qmlDirectory()+"Shell.qml");
119119 prependImportPaths(view->engine(), ::overrideImportPaths());
120+ if (!isUbuntuMirServer) {
121+ prependImportPaths(view->engine(), ::nonMirImportPaths());
122+ }
120123 appendImportPaths(view->engine(), ::fallbackImportPaths());
121124
122125 view->setSource(source);
tests/mocks/Unity/Application/CMakeLists.txt+14
@@ -35,3 +35,17 @@ install(TARGETS FakeUnityApplicationQml
3535install(FILES qmldir InputFilterArea.qml OSKController.qml
3636 DESTINATION ${SHELL_INSTALL_QML}/mocks/Unity/Application
3737 )
38+
39+# Duplicate the mock to nonmirplugins
40+# In shadow builds we just link it, in real installs we also install it to the other path
41+add_custom_target(OSKControllerQmlFile2 ALL
42+ COMMAND mkdir -p ${CMAKE_BINARY_DIR}/nonmirplugins/Unity && rm -f ${CMAKE_BINARY_DIR}/nonmirplugins/Unity/Application && ln -s ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_BINARY_DIR}/nonmirplugins/Unity
43+ DEPENDS qmldir
44+)
45+install(TARGETS FakeUnityApplicationQml
46+ DESTINATION ${SHELL_INSTALL_QML}/nonmirplugins/Unity/Application
47+ )
48+
49+install(FILES qmldir InputFilterArea.qml OSKController.qml
50+ DESTINATION ${SHELL_INSTALL_QML}/nonmirplugins/Unity/Application
51+ )
tools/scopetool.cpp+1
@@ -88,6 +88,7 @@ int main(int argc, char *argv[])
8888
8989 QUrl source(::qmlDirectory() + "ScopeTool.qml");
9090 prependImportPaths(view->engine(), ::overrideImportPaths());
91+ prependImportPaths(view->engine(), ::nonMirImportPaths());
9192 appendImportPaths(view->engine(), ::fallbackImportPaths());
9293
9394 view->setSource(source);