on xenial help sign in
Merge
commit262fb79cfe782ebc305b144ba7922eb3afe4992b authorAlbert Astals <albert.astals@canonical.com> dateWed 27 Nov 2013, 12:05 (13 years ago) parent1540f4c4d4c90e
21 files changed+35−152
CMakeLists.txt+10−1 cmake/modules/Plugins.cmake+3−3 cmake/modules/autopilot.cmake+1−1 debian/control−3 paths.h.in+4−2 plugins/Utils/CMakeLists.txt−2 plugins/Utils/applicationpaths.h−38 plugins/Utils/plugin.cpp−10 plugins/Utils/ubuntuwindow.cpp−36 plugins/Utils/ubuntuwindow.h−42 tests/mocks/AccountsService/CMakeLists.txt+2−2 tests/mocks/LightDM/CMakeLists.txt+2−2 tests/mocks/LightDM/full/CMakeLists.txt+1−1 tests/mocks/LightDM/single-passphrase/CMakeLists.txt+1−1 tests/mocks/LightDM/single-pin/CMakeLists.txt+1−1 tests/mocks/LightDM/single/CMakeLists.txt+1−1 tests/mocks/Powerd/CMakeLists.txt+2−2 tests/mocks/Ubuntu/DownloadDaemonListener/CMakeLists.txt+1−1 tests/mocks/Unity/Application/CMakeLists.txt+2−2 tests/mocks/libusermetrics/CMakeLists.txt+1−1 tests/qmltests/tst_Shell.qml+3
CMakeLists.txt+10−1
@@ -58,7 +58,16 @@ find_package(Qt5DBus)
5858include(GNUInstallDirs)
5959
6060set(SHELL_APP_DIR ${CMAKE_INSTALL_DATADIR}/unity8)
61−set(SHELL_PRIVATE_LIBDIR ${CMAKE_INSTALL_LIBDIR}/unity8)
61+
62+execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=plugindir_suffix unity-shell-api OUTPUT_VARIABLE SHELL_INSTALL_QML OUTPUT_STRIP_TRAILING_WHITESPACE)
63+if(SHELL_INSTALL_QML STREQUAL "")
64+ message(FATAL_ERROR "Could not determine plugin installation dir.")
65+endif()
66+
67+execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=plugindir unity-shell-api OUTPUT_VARIABLE SHELL_PLUGINDIR OUTPUT_STRIP_TRAILING_WHITESPACE)
68+if(SHELL_PLUGINDIR STREQUAL "")
69+ message(FATAL_ERROR "Could not determine plugin import dir.")
70+endif()
6271
6372configure_file(paths.h.in ${CMAKE_CURRENT_BINARY_DIR}/paths.h @ONLY)
6473
cmake/modules/Plugins.cmake+3−3
@@ -28,7 +28,7 @@ macro(export_qmlfiles PLUGIN PLUGIN_SUBPATH)
2828
2929 # install the qmlfiles file.
3030 install(FILES ${QMLFILES}
31− DESTINATION ${SHELL_PRIVATE_LIBDIR}/qml/${PLUGIN_SUBPATH}
31+ DESTINATION ${SHELL_INSTALL_QML}/${PLUGIN_SUBPATH}
3232 )
3333endmacro(export_qmlfiles)
3434
@@ -56,12 +56,12 @@ macro(export_qmlplugin PLUGIN VERSION PLUGIN_SUBPATH)
5656
5757 # install the qmltypes file.
5858 install(FILES ${CMAKE_BINARY_DIR}/plugins/${PLUGIN_SUBPATH}/plugin.qmltypes
59− DESTINATION ${SHELL_PRIVATE_LIBDIR}/qml/${PLUGIN_SUBPATH}
59+ DESTINATION ${SHELL_INSTALL_QML}/${PLUGIN_SUBPATH}
6060 )
6161 endif()
6262
6363 # install the additional targets
6464 install(TARGETS ${qmlplugin_TARGETS}
65− DESTINATION ${SHELL_PRIVATE_LIBDIR}/qml/${PLUGIN_SUBPATH}
65+ DESTINATION ${SHELL_INSTALL_QML}/${PLUGIN_SUBPATH}
6666 )
6767endmacro(export_qmlplugin)
cmake/modules/autopilot.cmake+1−1
@@ -2,7 +2,7 @@ add_custom_target(autopilot)
22
33function(declare_autopilot_test TEST_NAME TEST_SUITE WORKING_DIR)
44 add_custom_target(autopilot-${TEST_NAME}
5− COMMAND LANG=C UBUNTU_ICON_THEME=ubuntu-mobile QML2_IMPORT_PATH=${SHELL_PRIVATE_LIBDIR}/qml/mocks autopilot run ${TEST_SUITE}
5+ COMMAND LANG=C UBUNTU_ICON_THEME=ubuntu-mobile QML2_IMPORT_PATH=${SHELL_INSTALL_QML}/mocks autopilot run ${TEST_SUITE}
66 WORKING_DIRECTORY ${WORKING_DIR}
77 DEPENDS install
88 )
debian/control−3
@@ -17,10 +17,7 @@ Build-Depends: cmake,
1717 libpulse-dev,
1818 libqmenumodel-dev (>= 0.2.7),
1919 libqt5v8-5-private-dev,
20− libsigc++-2.0-dev,
2120 libunity-api-dev (>= 7.80.4),
22− libunity-core-6.0-dev (>= 7.1.1),
23− libunity-dev (>= 7.0.12),
2421 libunity-mir-dev,
2522 libunity-scopes-json-def-phone,
2623 libupstart-dev,
paths.h.in+4−2
@@ -58,9 +58,11 @@ inline QStringList overrideImportPaths() {
5858inline QStringList fallbackImportPaths() {
5959 QStringList paths;
6060 if (isRunningInstalled()) {
61− paths << QString("@CMAKE_INSTALL_PREFIX@/@SHELL_PRIVATE_LIBDIR@/qml");
62− paths << QString("@CMAKE_INSTALL_PREFIX@/@SHELL_PRIVATE_LIBDIR@/qml/mocks");
61+ paths << QString("@CMAKE_INSTALL_PREFIX@/@SHELL_INSTALL_QML@");
62+ paths << QString("@SHELL_PLUGINDIR@");
63+ paths << QString("@CMAKE_INSTALL_PREFIX@/@SHELL_INSTALL_QML@/mocks");
6364 } else {
65+ paths << QString("@SHELL_PLUGINDIR@");
6466 paths << QString("@CMAKE_BINARY_DIR@/tests/mocks");
6567 }
6668 return paths;
plugins/Utils/CMakeLists.txt−2
@@ -12,12 +12,10 @@ include_directories(
1212
1313set(QMLPLUGIN_SRC
1414 albumartprovider.cpp
15− applicationpaths.h
1615 bottombarvisibilitycommunicatorshell.cpp
1716 mediaartcache.cpp
1817 qlimitproxymodelqml.cpp
1918 qsortfilterproxymodelqml.cpp
20− ubuntuwindow.cpp
2119 unitymenumodelpaths.cpp
2220 plugin.cpp
2321 )
plugins/Utils/applicationpaths.hdeleted−38
@@ -1,38 +0,0 @@
1−/*
2− * Copyright (C) 2013 Canonical, Ltd.
3− *
4− * This program is free software; you can redistribute it and/or modify
5− * it under the terms of the GNU General Public License as published by
6− * the Free Software Foundation; version 3.
7− *
8− * This program is distributed in the hope that it will be useful,
9− * but WITHOUT ANY WARRANTY; without even the implied warranty of
10− * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11− * GNU General Public License for more details.
12− *
13− * You should have received a copy of the GNU General Public License
14− * along with this program. If not, see <http://www.gnu.org/licenses/>.
15− *
16− * Authored by: Nick Dedekind <nick.dedekind@canonical.com>
17− */
18−
19−
20−#ifndef APPLICATION_PATHS_H
21−#define APPLICATION_PATHS_H
22−
23−#include <QObject>
24−#include "paths.h"
25−
26−class ApplicationPaths : public QObject
27−{
28− Q_OBJECT
29−public:
30− Q_INVOKABLE bool isRunningInstalled() const { return ::isRunningInstalled(); }
31− Q_INVOKABLE QString shellAppDirectory() const { return ::shellAppDirectory(); }
32− Q_INVOKABLE QStringList overrideImportPaths() const { return ::overrideImportPaths(); }
33− Q_INVOKABLE QStringList fallbackImportPaths() const { return ::fallbackImportPaths(); }
34− Q_INVOKABLE QStringList shellDataDirs() const { return ::shellDataDirs(); }
35− Q_INVOKABLE QString sourceDirectory() const { return ::sourceDirectory(); }
36−};
37−
38−#endif // APPLICATION_PATHS_H
plugins/Utils/plugin.cpp−10
@@ -27,22 +27,14 @@
2727
2828// local
2929#include "albumartprovider.h"
30−#include "applicationpaths.h"
3130#include "bottombarvisibilitycommunicatorshell.h"
3231#include "qlimitproxymodelqml.h"
3332#include "qsortfilterproxymodelqml.h"
34−#include "ubuntuwindow.h"
3533#include "unitymenumodelpaths.h"
3634
3735static const char* BOTTOM_BAR_VISIBILITY_COMMUNICATOR_DBUS_PATH = "/BottomBarVisibilityCommunicator";
3836static const char* DBUS_SERVICE = "com.canonical.Shell.BottomBarVisibilityCommunicator";
3937
40−static QObject* applicationsPathsSingleton(QQmlEngine* engine, QJSEngine* scriptEngine) {
41− Q_UNUSED(engine);
42− Q_UNUSED(scriptEngine);
43− return new ApplicationPaths;
44−}
45−
4638void UtilsPlugin::registerTypes(const char *uri)
4739{
4840 Q_ASSERT(uri == QLatin1String("Utils"));
@@ -50,8 +42,6 @@ void UtilsPlugin::registerTypes(const char *uri)
5042 qmlRegisterType<QLimitProxyModelQML>(uri, 0, 1, "LimitProxyModel");
5143 qmlRegisterType<QSortFilterProxyModelQML>(uri, 0, 1, "SortFilterProxyModel");
5244 qmlRegisterType<UnityMenuModelPaths>(uri, 0, 1, "UnityMenuModelPaths");
53− qmlRegisterExtendedType<QQuickWindow, UbuntuWindow>(uri, 0, 1, "Window");
54− qmlRegisterSingletonType<ApplicationPaths>(uri, 0, 1, "ApplicationPaths", applicationsPathsSingleton);
5545 qmlRegisterUncreatableType<BottomBarVisibilityCommunicatorShell>(uri, 0, 1, "BottomBarVisibilityCommunicatorShell", "Can't create BottomBarVisibilityCommunicatorShell");
5646}
5747
plugins/Utils/ubuntuwindow.cppdeleted−36
@@ -1,36 +0,0 @@
1−/*
2− * Copyright (C) 2012 Canonical, Ltd.
3− *
4− * This program is free software; you can redistribute it and/or modify
5− * it under the terms of the GNU General Public License as published by
6− * the Free Software Foundation; version 3.
7− *
8− * This program is distributed in the hope that it will be useful,
9− * but WITHOUT ANY WARRANTY; without even the implied warranty of
10− * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11− * GNU General Public License for more details.
12− *
13− * You should have received a copy of the GNU General Public License
14− * along with this program. If not, see <http://www.gnu.org/licenses/>.
15− */
16−
17−#include "ubuntuwindow.h"
18−#include <QDebug>
19−
20−
21−UbuntuWindow::UbuntuWindow(QObject *parent)
22− : QObject(parent),
23− m_window(static_cast<QQuickWindow*>(parent))
24−{
25−}
26−
27−int UbuntuWindow::ubuntuSurfaceRole() const
28−{
29− return m_window->property("UbuntuSurfaceRole").toInt();
30−}
31−
32−void UbuntuWindow::setUbuntuSurfaceRole(int ubuntuSurfaceRole)
33−{
34− qDebug() << "setUbuntuSurfaceRole" << ubuntuSurfaceRole;
35− m_window->setProperty("UbuntuSurfaceRole", ubuntuSurfaceRole);
36−}
plugins/Utils/ubuntuwindow.hdeleted−42
@@ -1,42 +0,0 @@
1−/*
2− * Copyright (C) 2012 Canonical, Ltd.
3− *
4− * This program is free software; you can redistribute it and/or modify
5− * it under the terms of the GNU General Public License as published by
6− * the Free Software Foundation; version 3.
7− *
8− * This program is distributed in the hope that it will be useful,
9− * but WITHOUT ANY WARRANTY; without even the implied warranty of
10− * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11− * GNU General Public License for more details.
12− *
13− * You should have received a copy of the GNU General Public License
14− * along with this program. If not, see <http://www.gnu.org/licenses/>.
15− */
16−
17−#ifndef UBUNTUWINDOW_H
18−#define UBUNTUWINDOW_H
19−
20−#include <QtCore/QObject>
21−#include <QtQuick/QQuickWindow>
22−
23−class UbuntuWindow : public QObject
24−{
25− Q_OBJECT
26−
27− Q_PROPERTY(int ubuntuSurfaceRole READ ubuntuSurfaceRole WRITE setUbuntuSurfaceRole NOTIFY ubuntuSurfaceRoleChanged)
28−
29−public:
30− explicit UbuntuWindow(QObject *parent = 0);
31−
32− int ubuntuSurfaceRole() const;
33− void setUbuntuSurfaceRole(int ubuntuSurfaceRole);
34−
35−Q_SIGNALS:
36− void ubuntuSurfaceRoleChanged(int);
37−
38−private:
39− QQuickWindow* m_window;
40−};
41−
42−#endif // UBUNTUWINDOW_H
tests/mocks/AccountsService/CMakeLists.txt+2−2
@@ -13,9 +13,9 @@ file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/qmldir"
1313 )
1414
1515install(TARGETS MockAccountsService-qml
16− DESTINATION ${SHELL_PRIVATE_LIBDIR}/qml/mocks/AccountsService
16+ DESTINATION ${SHELL_INSTALL_QML}/mocks/AccountsService
1717 )
1818
1919install(FILES qmldir
20− DESTINATION ${SHELL_PRIVATE_LIBDIR}/qml/mocks/AccountsService
20+ DESTINATION ${SHELL_INSTALL_QML}/mocks/AccountsService
2121 )
tests/mocks/LightDM/CMakeLists.txt+2−2
@@ -47,9 +47,9 @@ file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/qmldir"
4747 )
4848
4949install(TARGETS MockLightDM-qml
50− DESTINATION ${SHELL_PRIVATE_LIBDIR}/qml/mocks/LightDM
50+ DESTINATION ${SHELL_INSTALL_QML}/mocks/LightDM
5151 )
5252
5353install(FILES qmldir
54− DESTINATION ${SHELL_PRIVATE_LIBDIR}/qml/mocks/LightDM
54+ DESTINATION ${SHELL_INSTALL_QML}/mocks/LightDM
5555 )
tests/mocks/LightDM/full/CMakeLists.txt+1−1
@@ -14,5 +14,5 @@ set_target_properties(MockLightDM-full PROPERTIES
1414 OUTPUT_NAME lightdm-qt5-2)
1515
1616install(TARGETS MockLightDM-full
17− DESTINATION ${SHELL_PRIVATE_LIBDIR}/qml/mocks/LightDM/full
17+ DESTINATION ${SHELL_INSTALL_QML}/mocks/LightDM/full
1818 )
tests/mocks/LightDM/single-passphrase/CMakeLists.txt+1−1
@@ -15,5 +15,5 @@ set_target_properties(MockLightDM-single-passphrase PROPERTIES
1515 OUTPUT_NAME lightdm-qt5-2)
1616
1717install(TARGETS MockLightDM-single-passphrase
18− DESTINATION ${SHELL_PRIVATE_LIBDIR}/qml/mocks/LightDM/single-passphrase
18+ DESTINATION ${SHELL_INSTALL_QML}/mocks/LightDM/single-passphrase
1919 )
tests/mocks/LightDM/single-pin/CMakeLists.txt+1−1
@@ -15,5 +15,5 @@ set_target_properties(MockLightDM-single-pin PROPERTIES
1515 OUTPUT_NAME lightdm-qt5-2)
1616
1717install(TARGETS MockLightDM-single-pin
18− DESTINATION ${SHELL_PRIVATE_LIBDIR}/qml/mocks/LightDM/single-pin
18+ DESTINATION ${SHELL_INSTALL_QML}/mocks/LightDM/single-pin
1919 )
tests/mocks/LightDM/single/CMakeLists.txt+1−1
@@ -14,5 +14,5 @@ set_target_properties(MockLightDM-single PROPERTIES
1414 OUTPUT_NAME lightdm-qt5-2)
1515
1616install(TARGETS MockLightDM-single
17− DESTINATION ${SHELL_PRIVATE_LIBDIR}/qml/mocks/LightDM/single
17+ DESTINATION ${SHELL_INSTALL_QML}/mocks/LightDM/single
1818 )
tests/mocks/Powerd/CMakeLists.txt+2−2
@@ -13,9 +13,9 @@ file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/qmldir"
1313 )
1414
1515install(TARGETS MockPowerd-qml
16− DESTINATION ${SHELL_PRIVATE_LIBDIR}/qml/mocks/Powerd
16+ DESTINATION ${SHELL_INSTALL_QML}/mocks/Powerd
1717 )
1818
1919install(FILES qmldir
20− DESTINATION ${SHELL_PRIVATE_LIBDIR}/qml/mocks/Powerd
20+ DESTINATION ${SHELL_INSTALL_QML}/mocks/Powerd
2121 )
tests/mocks/Ubuntu/DownloadDaemonListener/CMakeLists.txt+1−1
@@ -14,5 +14,5 @@ add_custom_target(UbuntuDownloadQmlDirFile ALL
1414)
1515
1616install(TARGETS FakeUbuntuDownloadDaemonListenerQml
17− DESTINATION ${SHELL_PRIVATE_LIBDIR}/qml/mocks/Ubuntu/DownloadDaemonListener
17+ DESTINATION ${SHELL_INSTALL_QML}/mocks/Ubuntu/DownloadDaemonListener
1818 )
tests/mocks/Unity/Application/CMakeLists.txt+2−2
@@ -29,9 +29,9 @@ add_custom_target(OSKControllerQmlFile ALL
2929)
3030
3131install(TARGETS FakeUnityApplicationQml
32− DESTINATION ${SHELL_PRIVATE_LIBDIR}/qml/mocks/Unity/Application
32+ DESTINATION ${SHELL_INSTALL_QML}/mocks/Unity/Application
3333 )
3434
3535install(FILES qmldir InputFilterArea.qml OSKController.qml
36− DESTINATION ${SHELL_PRIVATE_LIBDIR}/qml/mocks/Unity/Application
36+ DESTINATION ${SHELL_INSTALL_QML}/mocks/Unity/Application
3737 )
tests/mocks/libusermetrics/CMakeLists.txt+1−1
@@ -13,5 +13,5 @@ set_target_properties(MockUserMetrics PROPERTIES
1313 VERSION 1)
1414
1515install(TARGETS MockUserMetrics
16− DESTINATION ${SHELL_PRIVATE_LIBDIR}/qml/mocks/libusermetrics
16+ DESTINATION ${SHELL_INSTALL_QML}/mocks/libusermetrics
1717 )
tests/qmltests/tst_Shell.qml+3
@@ -72,6 +72,9 @@ Item {
7272 ok = homeLoader !== undefined
7373 && homeLoader.item !== undefined;
7474
75+ var dashHome = findChild(shell, "DashHome");
76+ ok &= dashHome !== undefined;
77+
7578 var greeter = findChild(shell, "greeter");
7679 ok &= greeter !== undefined;
7780