on fdf5050 help sign in
128 files changed+689−509
since splitsnapshots
unifiedsplit
CMakeLists.txt+5−2 Jenkinsfile+4−1 cmake/modules/QmlPlugins.cmake−148 data/unity8-dash.conf−26 data/unity8-dash.service+15 data/unity8-filewatcher.conf−13 data/unity8-greeter-wrapper+7−23 data/unity8-session+81 data/unity8.conf−95 data/unity8.service+14 debian/changelog+1−1 debian/control+14−9 debian/rules+2−2 debian/unity8-tests.install+1 debian/unity8.install+3−2 plugins/AccountsService/CMakeLists.txt+1−2 plugins/CMakeLists.txt+1−1 plugins/Cursor/CMakeLists.txt+1−2 plugins/Dash/CMakeLists.txt+1−2 plugins/Dash/abstractdashview.cpp+1−1 plugins/Dash/listviewwithpageheader.cpp+1−1 plugins/GlobalShortcut/CMakeLists.txt+1−1 plugins/Greeter/Unity/Launcher/CMakeLists.txt+1−2 plugins/Greeter/Unity/Launcher/launcheritem.cpp+6 plugins/Greeter/Unity/Launcher/launcheritem.h+1 plugins/ImageCache/CMakeLists.txt+1−1 plugins/LightDM/FullLightDM/CMakeLists.txt+1−1 plugins/LightDM/IntegratedLightDM/CMakeLists.txt+1−1 plugins/LightDM/IntegratedLightDM/liblightdm/CMakeLists.txt+3−4 plugins/Lights/CMakeLists.txt+4−2 plugins/Powerd/CMakeLists.txt+4−2 plugins/ScreenshotDirectory/CMakeLists.txt+1−1 plugins/SessionBroadcast/CMakeLists.txt+1−2 plugins/UInput/CMakeLists.txt+1−1 plugins/Ubuntu/DownloadDaemonListener/CMakeLists.txt+4−2 plugins/Ubuntu/Gestures/CMakeLists.txt+1−3 plugins/Unity/ApplicationMenu/CMakeLists.txt+1−1 plugins/Unity/Connectivity/CMakeLists.txt+1−1 plugins/Unity/DashCommunicator/CMakeLists.txt+1−2 plugins/Unity/Indicators/CMakeLists.txt+1−2 plugins/Unity/InputInfo/CMakeLists.txt+1−2 plugins/Unity/Launcher/CMakeLists.txt+1−2 plugins/Unity/Launcher/appdrawermodel.cpp+68−7 plugins/Unity/Launcher/appdrawermodel.h+8 plugins/Unity/Launcher/dbusinterface.cpp+2 plugins/Unity/Launcher/launcheritem.cpp+13 plugins/Unity/Launcher/launcheritem.h+3 plugins/Unity/Launcher/launchermodel.cpp+1 plugins/Unity/Launcher/ualwrapper.cpp+12−2 plugins/Unity/Launcher/ualwrapper.h+6 plugins/Unity/Platform/CMakeLists.txt+1−1 plugins/Unity/Session/CMakeLists.txt+1−1 plugins/Unity/Session/dbusunitysessionservice.cpp+5−11 plugins/Utils/CMakeLists.txt+4−3 plugins/WindowManager/CMakeLists.txt+1−1 plugins/Wizard/CMakeLists.txt+4−2 plugins/Wizard/Utils/CMakeLists.txt+1−1 src/CMakeLists.txt+5−2 src/Dash/CMakeLists.txt+4−3 src/libunity8-private/CMakeLists.txt+1−1 tests/mocks/AccountsService/CMakeLists.txt+1−2 tests/mocks/Biometryd/CMakeLists.txt+1−1 tests/mocks/CMakeLists.txt+1−1 tests/mocks/GSettings.1.0/CMakeLists.txt+1−2 tests/mocks/LightDMController/CMakeLists.txt+1−2 tests/mocks/Lights/CMakeLists.txt+1−1 tests/mocks/MeeGo/QOfono/CMakeLists.txt+1−1 tests/mocks/Powerd/CMakeLists.txt+1−1 tests/mocks/QMenuModel/CMakeLists.txt+1−2 tests/mocks/QtMultimedia/CMakeLists.txt+1−1 tests/mocks/SessionBroadcast/CMakeLists.txt+1−1 tests/mocks/UInput/CMakeLists.txt+1−1 tests/mocks/Ubuntu/Connectivity/CMakeLists.txt+1−1 tests/mocks/Ubuntu/DownloadDaemonListener/CMakeLists.txt+1−1 tests/mocks/Ubuntu/SystemSettings/SecurityPrivacy/CMakeLists.txt+1−1 tests/mocks/Ubuntu/Telephony/CMakeLists.txt+1−1 tests/mocks/Unity/Application/CMakeLists.txt+2−2 tests/mocks/Unity/ApplicationMenu/CMakeLists.txt+1−1 tests/mocks/Unity/CMakeLists.txt+1−1 tests/mocks/Unity/Connectivity/CMakeLists.txt+1−1 tests/mocks/Unity/DashCommunicator/CMakeLists.txt+1−1 tests/mocks/Unity/Indicators/CMakeLists.txt+1−2 tests/mocks/Unity/InputInfo/CMakeLists.txt+1−1 tests/mocks/Unity/Launcher/CMakeLists.txt+1−1 tests/mocks/Unity/Launcher/MockLauncherItem.cpp+13 tests/mocks/Unity/Launcher/MockLauncherItem.h+3 tests/mocks/Unity/Notifications/CMakeLists.txt+1−1 tests/mocks/Unity/Screens/CMakeLists.txt+1−1 tests/mocks/Utils/CMakeLists.txt+4−3 tests/mocks/Wizard/CMakeLists.txt+1−2 tests/mocks/liblightdm/CMakeLists.txt+1−1 tests/mocks/liblightdm/demo/CMakeLists.txt+1−1 tests/mocks/libusermetrics/CMakeLists.txt+1−1 tests/plugins/AccountsService/CMakeLists.txt+2−2 tests/plugins/Dash/CMakeLists.txt+4−8 tests/plugins/GlobalShortcut/CMakeLists.txt+1−2 tests/plugins/Greeter/Unity/Launcher/CMakeLists.txt+1−1 tests/plugins/ImageCache/CMakeLists.txt+1−1 tests/plugins/LightDM/IntegratedLightDM/CMakeLists.txt+6−6 tests/plugins/SessionBroadcast/CMakeLists.txt+2−2 tests/plugins/Ubuntu/CMakeLists.txt+1−1 tests/plugins/Ubuntu/Gestures/CMakeLists.txt+4−2 tests/plugins/Ubuntu/Gestures/GestureTest.cpp+10−1 tests/plugins/Ubuntu/Gestures/tst_TouchGate.cpp+10−1 tests/plugins/Unity/Indicators/CMakeLists.txt+1−1 tests/plugins/Unity/Launcher/CMakeLists.txt+35−1 tests/plugins/Unity/Launcher/appdrawermodeltest.cpp+53 tests/plugins/Unity/Launcher/ualwrapper.cpp+60 tests/plugins/Unity/Launcher/ualwrapper.h+55 tests/plugins/Unity/Session/CMakeLists.txt+3−2 tests/plugins/Unity/Session/LogindServer.cpp−5 tests/plugins/Unity/Session/LogindServer.h−1 tests/plugins/Unity/Session/interfaces.xml−4 tests/plugins/Unity/Session/server.cpp+1−1 tests/plugins/Unity/Session/sessionbackendtest.cpp+5−3 tests/plugins/Utils/CMakeLists.txt+2−4 tests/plugins/WindowManager/CMakeLists.txt+4−2 tests/plugins/Wizard/CMakeLists.txt+2−2 tests/qmltests/CMakeLists.txt+1−1 tests/qmltests/Components/CMakeLists.txt+8−4 tests/qmltests/Components/tst_DragHandle.cpp+19−2 tests/uqmlscene/CMakeLists.txt+1−1 tests/utils/CMakeLists.txt+1−1 tests/utils/modules/Unity/Test/CMakeLists.txt+2−4 tests/utils/modules/Unity/Test/TouchEventSequenceWrapper.cpp+10−1 tools/indicatorsclient/CMakeLists.txt+1−1 tools/menutool/CMakeLists.txt+1−1 tools/scopetool/CMakeLists.txt+1−1
CMakeLists.txt+5−2
@@ -70,15 +70,18 @@ find_package(Qt5DBus 5.6 REQUIRED)
7070find_package(Qt5Concurrent 5.6 REQUIRED)
7171find_package(Qt5Sql 5.6 REQUIRED)
7272find_package(Qt5Test 5.6 REQUIRED)
73+find_package(Qt5Svg 5.6 REQUIRED)
74+find_package(Qt5Network 5.6 REQUIRED)
75+find_package(Qt5Xml 5.6 REQUIRED)
7376
7477pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=27)
7578pkg_check_modules(GEONAMES REQUIRED geonames>=0.2)
7679pkg_check_modules(GIO REQUIRED gio-2.0>=2.32)
7780pkg_check_modules(GLIB REQUIRED glib-2.0>=2.32)
78−pkg_check_modules(LAUNCHER_API REQUIRED unity-shell-launcher=12)
81+pkg_check_modules(LAUNCHER_API REQUIRED unity-shell-launcher=13)
7982pkg_check_modules(QMENUMODEL REQUIRED qmenumodel)
8083pkg_check_modules(GD3 REQUIRED gnome-desktop-3.0)
81−pkg_check_modules(UAL REQUIRED ubuntu-app-launch-2)
84+pkg_check_modules(UAL REQUIRED ubuntu-app-launch-3)
8285pkg_check_modules(UBUNTUGESTURES REQUIRED UbuntuGestures)
8386pkg_check_modules(QTDBUSTEST REQUIRED
8487 libqtdbustest-1
Jenkinsfile+4−1
@@ -28,7 +28,7 @@ build-binary.sh'''
2828 cleanWs(cleanWhenAborted: true, cleanWhenFailure: true, cleanWhenNotBuilt: true, cleanWhenSuccess: true, cleanWhenUnstable: true, deleteDirs: true)
2929 unstash 'source'
3030 sh '''export architecture="arm64"
31− build-binary.sh'''
31+ # build-binary.sh'''
3232 stash(includes: '*.gz,*.bz2,*.xz,*.deb,*.dsc,*.changes,*.buildinfo,lintian.txt', name: 'build-arm64')
3333 cleanWs(cleanWhenAborted: true, cleanWhenFailure: true, cleanWhenNotBuilt: true, cleanWhenSuccess: true, cleanWhenUnstable: true, deleteDirs: true)
3434 }
@@ -38,6 +38,9 @@ build-binary.sh'''
3838 cleanWs(cleanWhenAborted: true, cleanWhenFailure: true, cleanWhenNotBuilt: true, cleanWhenSuccess: true, cleanWhenUnstable: true, deleteDirs: true)
3939 unstash 'source'
4040 sh '''export architecture="amd64"
41+ export DEBBUILDOPTS=-sa
42+export SKIP_ARCH_BUILD=false
43+export SKIP_SOURCE_REMOVAL=true
4144 build-binary.sh'''
4245 stash(includes: '*.gz,*.bz2,*.xz,*.deb,*.dsc,*.changes,*.buildinfo,lintian.txt', name: 'build-amd64')
4346 cleanWs(cleanWhenAborted: true, cleanWhenFailure: true, cleanWhenNotBuilt: true, cleanWhenSuccess: true, cleanWhenUnstable: true, deleteDirs: true)
cmake/modules/QmlPlugins.cmakedeleted−148
@@ -1,148 +0,0 @@
1−# If you need to override the qmlplugindump binary, create the qmlplugin executable
2−# target before loading this plugin.
3−
4−if(NOT TARGET qmlplugindump)
5− find_program(qmlplugindump_exe qmlplugindump)
6−
7− if(NOT qmlplugindump_exe)
8− msg(FATAL_ERROR "Could not locate qmlplugindump.")
9− endif()
10−
11− add_executable(qmlplugindump IMPORTED)
12− set_target_properties(qmlplugindump PROPERTIES IMPORTED_LOCATION ${qmlplugindump_exe})
13−endif()
14−
15−#
16−# A custom target for building the qmltypes files manually.
17−#
18−if (NOT TARGET qmltypes)
19− add_custom_target(qmltypes)
20−endif()
21−
22−# Creates a target for copying resource files into build dir and optionally installing them.
23−#
24−# Files will be copied into ${BINARY_DIR}/${path} or ${CMAKE_CURRENT_BINARY_DIR} and installed
25−# into ${DESTINATION}/${path}.
26−#
27−# Resource file names are matched against {*.{qml,js,jpg,png,sci,svg},qmldir}.
28−#
29−# export_qmlfiles(plugin path
30−# [SEARCH_PATH path] # Path to search for resources in (defaults to ${CMAKE_CURRENT_SOURCE_DIR})
31−# [BINARY_DIR path]
32−# [DESTINATION path]
33−# [TARGET_PREFIX string] # Will be prefixed to the target name
34−# )
35−#
36−# Created target:
37−# - ${TARGET_PREFIX}${plugin}-qmlfiles - Copies resources into the binary dir.
38−
39−macro(export_qmlfiles PLUGIN PATH)
40− set(single SEARCH_PATH BINARY_DIR DESTINATION TARGET_PREFIX)
41− cmake_parse_arguments(QMLFILES "" "${single}" "" ${ARGN})
42−
43− if(NOT QMLFILES_SEARCH_PATH)
44− set(QMLFILES_SEARCH_PATH ${CMAKE_CURRENT_SOURCE_DIR})
45− endif()
46−
47− if(QMLFILES_BINARY_DIR)
48− set(qmlfiles_dir ${QMLFILES_BINARY_DIR}/${PATH})
49− else()
50− set(qmlfiles_dir ${CMAKE_CURRENT_BINARY_DIR})
51− endif()
52−
53− file(GLOB QMLFILES
54− ${QMLFILES_SEARCH_PATH}/*.qml
55− ${QMLFILES_SEARCH_PATH}/*.js
56− ${QMLFILES_SEARCH_PATH}/*.jpg
57− ${QMLFILES_SEARCH_PATH}/*.png
58− ${QMLFILES_SEARCH_PATH}/*.sci
59− ${QMLFILES_SEARCH_PATH}/*.svg
60− ${QMLFILES_SEARCH_PATH}/*.qmltypes
61− ${QMLFILES_SEARCH_PATH}/qmldir
62− )
63−
64− execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${qmlfiles_dir})
65−
66− # copy the files
67− add_custom_target(${QMLFILES_TARGET_PREFIX}${PLUGIN}-qmlfiles ALL
68− COMMAND cp ${QMLFILES} ${qmlfiles_dir}
69− DEPENDS ${QMLFILES}
70− SOURCES ${QMLFILES}
71− )
72−
73− if(QMLFILES_DESTINATION)
74− # install the qmlfiles file.
75− install(FILES ${QMLFILES}
76− DESTINATION ${QMLFILES_DESTINATION}/${PATH}
77− )
78− endif()
79−endmacro()
80−
81−
82−# Creates a target for generating the typeinfo file for a QML plugin and/or installs the plugin
83−# targets.
84−#
85−# Files will be copied into ${BINARY_DIR}/${path} or ${CMAKE_CURRENT_BINARY_DIR} and installed
86−# into ${DESTINATION}/${path}. If you don't pass BINARY_DIR, it's assumed that current source
87−# path ends with ${path}.
88−#
89−# The generated file will be named after the last segment of the plugin name, e.g. Foo.qmltypes.
90−#
91−# export_qmlplugin(plugin version path
92−# [BINARY_DIR path]
93−# [DESTINATION path]
94−# [TARGET_PREFIX string] # Will be prefixed to the target name
95−# [ENVIRONMENT string] # Will be added to qmlplugindump's env
96−# [TARGETS target1 [target2 ...]] # Targets to depend on and install (e.g. the plugin shared object)
97−# [NO_TYPES] # Do not create the qmltypes target
98−# )
99−#
100−# Created target:
101−# - ${TARGET_PREFIX}${plugin}-qmltypes - Generates the qmltypes file in the source dir.
102−# It will be made a dependency of the "qmltypes" target.
103−
104−macro(export_qmlplugin PLUGIN VERSION PATH)
105− set(options NO_TYPES)
106− set(single BINARY_DIR DESTINATION TARGET_PREFIX ENVIRONMENT)
107− set(multi TARGETS)
108− cmake_parse_arguments(QMLPLUGIN "${options}" "${single}" "${multi}" ${ARGN})
109−
110− if(QMLPLUGIN_BINARY_DIR)
111− set(qmlplugin_dir ${QMLPLUGIN_BINARY_DIR}/${PATH})
112− else()
113− # Find import path to point qmlplugindump at
114− string(REGEX REPLACE "/${PATH}$" "" QMLPLUGIN_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}")
115− set(qmlplugin_dir ${CMAKE_CURRENT_BINARY_DIR})
116− endif()
117−
118− if(NOT QMLPLUGIN_NO_TYPES)
119− # Relative path for the module
120− string(REPLACE "${CMAKE_BINARY_DIR}/" "" QMLPLUGIN_MODULE_DIR "${QMLPLUGIN_BINARY_DIR}")
121−
122− # Find the last segment of the plugin name to use as qmltypes basename
123− string(REGEX MATCH "[^.]+$" plugin_suffix ${PLUGIN})
124− set(target_prefix ${QMLPLUGIN_TARGET_PREFIX}${PLUGIN})
125− set(qmltypes_path ${CMAKE_CURRENT_SOURCE_DIR}/${plugin_suffix}.qmltypes)
126−
127− add_custom_target(${target_prefix}-qmltypes
128− COMMAND env ${QMLPLUGIN_ENVIRONMENT} $<TARGET_FILE:qmlplugindump> -notrelocatable
129− ${PLUGIN} ${VERSION} ${QMLPLUGIN_MODULE_DIR} > ${qmltypes_path}
130− WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
131− )
132− add_dependencies(${target_prefix}-qmltypes ${target_prefix}-qmlfiles ${QMLPLUGIN_TARGETS})
133− add_dependencies(qmltypes ${target_prefix}-qmltypes)
134− endif()
135−
136− set_target_properties(${QMLPLUGIN_TARGETS} PROPERTIES
137− ARCHIVE_OUTPUT_DIRECTORY ${qmlplugin_dir}
138− LIBRARY_OUTPUT_DIRECTORY ${qmlplugin_dir}
139− RUNTIME_OUTPUT_DIRECTORY ${qmlplugin_dir}
140− )
141−
142− if (QMLPLUGIN_DESTINATION)
143− # Install additional targets
144− install(TARGETS ${QMLPLUGIN_TARGETS}
145− DESTINATION ${QMLPLUGIN_DESTINATION}/${PATH}
146− )
147− endif()
148−endmacro()
data/unity8-dash.confdeleted−26
@@ -1,26 +0,0 @@
1−description "Unity Shell v8 Dash"
2−author "Michael Zanetti <michael.zanetti@canonical.com>"
3−
4−emits scope-ui-starting
5−
6−start on started unity8
7−stop on stopping unity8
8−
9−kill timeout 120
10−
11−# Focused app is 100 so we want to be less likely to get
12−# killed than the focused app but more than Unity8
13−
14−## FIXME
15−#oom score 50
16−
17−respawn
18−respawn limit unlimited
19−
20−env APP_ID=unity8-dash
21−
22−pre-start script
23− initctl emit scope-ui-starting
24−end script
25−
26−exec ${BINARY:-unity8-dash} $ARGS --desktop_file_hint=unity8-dash.desktop
data/unity8-dash.servicenew file+15
@@ -0,0 +1,15 @@
1+[Unit]
2+Description=Unity Shell v8 Dash
3+PartOf=graphical-session.target
4+BindsTo=unity8.service
5+After=unity8.service
6+
7+[Service]
8+ExecStart=/usr/bin/unity8-dash --desktop_file_hint=unity8-dash
9+Restart=always
10+TimeoutStartSec=120
11+Environment=APP_ID=unity8-dash
12+
13+# Focused app is 100 so we want to be less likely to get
14+# killed than the focused app but more than Unity8
15+OOMScoreAdjust=50
data/unity8-filewatcher.confdeleted−13
@@ -1,13 +0,0 @@
1−description "File system watcher for unity8"
2−author "Michael Zanetti <michael.zanetti@canonical.com>"
3−
4−# This method of updating the launcher will not work in our new snappy world,
5−# neither for snaps installed in the system nor if we are running inside a snap.
6−# Plus it hardcodes the phablet user... To be replaced once bug 1630997 is
7−# fixed in ubuntu-app-launch.
8−
9−# Workaround for bug 1360208. ~ and * in one expression doesn't work currently
10−start on (file FILE=/home/phablet/.local/share/applications/*.desktop) or (file FILE=/usr/share/applications/*.desktop)
11−
12−exec dbus-send --type=method_call --dest=com.canonical.Unity.Launcher /com/canonical/Unity/Launcher com.canonical.Unity.Launcher.Refresh
13−
data/unity8-greeter-wrapper+7−23
@@ -20,8 +20,8 @@ cleanup()
2020{
2121 trap - TERM EXIT
2222 # Kill upstart and indicators
23− if [ -n "$INIT_PID" ]; then
24− kill "$INIT_PID"
23+ if [ -n "$IND_PID" ]; then
24+ kill "$IND_PID"
2525 fi
2626 if [ -n "$CMD_PID" ]; then
2727 kill "$CMD_PID"
@@ -32,10 +32,7 @@ cleanup()
3232set_greeter_var()
3333{
3434 export "$1=$2"
35− gdbus call --session --dest org.freedesktop.DBus --object-path /org/freedesktop/DBus --method org.freedesktop.DBus.UpdateActivationEnvironment "{'$1': '$2'}"
36− if [ -n "$INIT_PID" ]; then
37− initctl set-env --global "$1=$2"
38− fi
35+ dbus-update-activation-environment --systemd "$1=$2"
3936}
4037
4138SUB_SOCKET=$XDG_RUNTIME_DIR/mir_socket
@@ -61,25 +58,12 @@ set_greeter_var QT_QPA_PLATFORM ubuntumirclient
6158# eventually need the greeter to play ringtones for users that aren't logged in.
6259set_greeter_var PA_DISABLED 1
6360
64−# Normal unity8 sessions are entirely driven by Upstart. But greeters
65−# are special. They need access to the file descriptors that lightdm
66−# creates for them and don't want to start all the services that a normal
67−# session would. So it's inconvenient to live within an upstart session.
68−# But... we still want to use Upstart for some services. So launch here.
69−MIR_SOCKET=$SUB_SOCKET $TOUCH_WRAPPER upstart --user --no-startup-event &
70−INIT_PID=$!
71−while [ ! -e "$XDG_RUNTIME_DIR/upstart/sessions/$INIT_PID.session" ]; do sleep 0.1; done
72−. "$XDG_RUNTIME_DIR/upstart/sessions/$INIT_PID.session"
73−export UPSTART_SESSION
74−
75−# Connect upstart to system, but do first command in a loop to avoid any
76−# race condition between the session file above being written and upstart being
77−# ready to handle requests.
78−while ! initctl notify-dbus-address "$DBUS_SESSION_BUS_ADDRESS"; do sleep 0.1; done
79−initctl start notify-cgmanager
61+# Start the indicators
62+/usr/lib/gnome-session/run-systemd-session indicators.target &
63+IND_PID=$!
8064
8165# Start any pre-greeter tasks if needed (like wizard)
82−initctl emit unity8-greeter-starting
66+#initctl emit unity8-greeter-starting FIXME
8367
8468# Define language here for phone if available. When phone user switches their
8569# language, they expect that to affect the greeter too. But the user doesn't
data/unity8-sessionnew file+81
@@ -0,0 +1,81 @@
1+#!/bin/bash
2+# -*- Mode: sh; indent-tabs-mode: nil; tab-width: 2 -*-
3+
4+# Ensure the shell always gets unthrottled touch events, so that applications
5+# who want full speed low-latency input can get it (LP: #1497105) and so that
6+# apps can use QML touch compression safely (the QML touch compression
7+# algorithm does not support nesting well - LP: #1486341, LP: #1556763 - so
8+# must be fed by the raw input event stream from Unity8).
9+export QML_NO_TOUCH_COMPRESSION=1
10+
11+export MIR_SERVER_PROMPT_FILE=1
12+
13+# Hard code socket path because our snappy apparmor profile
14+# only lets us put the socket in one place. And consumers expect it there.
15+# (XDG_RUNTIME_DIR isn't typical under snappy)
16+export MIR_SERVER_FILE=/run/user/$(id -u)/mir_socket
17+
18+rm -f "$MIR_SERVER_FILE"
19+rm -f "${MIR_SERVER_FILE}_trusted"
20+
21+if [ "$XDG_SESSION_DESKTOP" = "ubuntu-touch" ]; then
22+ # On Ubuntu Touch, we currently use a trick where we auto-login the
23+ # user without a LightDM greeter at all. In this case, we want to
24+ # start with the lockscreen visible. Once we switch to using a
25+ # proper greeter for the first login, we can remove this code path.
26+ MODE=full-greeter
27+else
28+ MODE=full-shell
29+fi
30+
31+# Add options for settings
32+if [ -f ~/.unity8/configs.conf ]; then
33+ source ~/.unity8/configs.conf
34+fi
35+
36+# Scale settings
37+isfloat='^[0-9]+([.][0-9]+)?$'
38+isint='^[0-9]+$'
39+if [[ $SCALE =~ $isfloat ]]; then
40+ if ! [ $SCALE == "0" ]; then
41+ export GRID_UNIT_PX=$(LC_ALL=C printf %.0f $((8 * ${SCALE})))
42+ export QT_WAYLAND_FORCE_DPI=$(LC_ALL=C printf %.0f $((96 * ${SCALE})))
43+ fi
44+fi
45+
46+if [[ $GRID_UNIT_PX =~ $isint ]]; then
47+ dbus-update-activation-environment --systemd GRID_UNIT_PX=${GRID_UNIT_PX}
48+fi
49+
50+if [[ $QT_WAYLAND_FORCE_DPI =~ $isint ]]; then
51+ dbus-update-activation-environment --systemd QT_WAYLAND_FORCE_DPI=${QT_WAYLAND_FORCE_DPI}
52+fi
53+
54+# Tell unity-mir to raise SIGSTOP after we start, which we use to tell
55+# systemd when we are done starting up.
56+export UNITY_MIR_EMITS_SIGSTOP=1
57+
58+# Set some envs
59+dbus-update-activation-environment --systemd QT_QPA_PLATFORM=wayland
60+dbus-update-activation-environment --systemd GDK_BACKEND=wayland
61+dbus-update-activation-environment --systemd SDL_VIDEODRIVER=wayland
62+dbus-update-activation-environment --systemd UNITY8_SHELL_QT_QPA_PLATFORM=mirserver
63+dbus-update-activation-environment --systemd QT_WAYLAND_DISABLE_WINDOWDECORATION=1
64+dbus-update-activation-environment --systemd QT_ACCESSIBILITY=1
65+dbus-update-activation-environment --systemd QT_AUTO_SCREEN_SCALE_FACTOR=0
66+dbus-update-activation-environment --systemd GTK_CSD=0
67+
68+# We need to be sure we dont use mir-on-mir
69+unset MIR_SERVER_HOST_SOCKET
70+unset DISPLAY
71+
72+QT_QPA_PLATFORM=${UNITY8_SHELL_QT_QPA_PLATFORM} ${BINARY:-unity8} --mode=$MODE "$@" &
73+child=$!
74+
75+# Wait for SIGSTOP in child
76+while [ $(ps --no-headers -o state $child) != "T" ]; do
77+ sleep 0.1
78+done
79+
80+kill -CONT $child
81+exit 0
data/unity8.confdeleted−95
@@ -1,95 +0,0 @@
1−description "Unity Shell v8"
2−author "Ricardo Mendoza <ricmm@ubuntu.com>"
3−
4−emits indicator-services-start
5−
6−start on ((xsession SESSION=ubuntu-touch) or (xsession SESSION=unity8-mir) or (xsession SESSION=unity8)) and started dbus
7−stop on desktop-end
8−
9−kill timeout 120
10−
11−#
12−# Ensure the shell always gets unthrottled touch events, so that applications
13−# who want full speed low-latency input can get it (LP: #1497105) and so that
14−# apps can use QML touch compression safely (the QML touch compression
15−# algorithm does not support nesting well - LP: #1486341, LP: #1556763 - so
16−# must be fed by the raw input event stream from Unity8).
17−#
18−env QML_NO_TOUCH_COMPRESSION=1
19−
20−respawn
21−expect stop
22−
23−# FIXME Create an autopilot test that makes sure start+stop and restart
24−# work fine at least 2 times
25−
26−pre-start script
27− # Tell unity-mir to raise SIGSTOP after we start
28− initctl set-env UNITY_MIR_EMITS_SIGSTOP=1
29−
30− # Save original value of MIR_SOCKET so that we can restore it when stopped,
31− # as we modify the variable for future jobs, including ourself.
32− initctl set-env UNITY_MIR_SOCKET=$MIR_SOCKET
33−
34− # Decide where we are going to put our own socket file
35− if [ -n "$SNAP" ]; then
36− # In snappy, we want to hard code our path because our apparmor profile
37− # only lets us put the socket in one place. And consumers expect it
38− # there.
39− MIR_SERVER_FILE=/run/user/$(id -u)/mir_socket
40− else
41− MIR_SERVER_FILE=$XDG_RUNTIME_DIR/mir_socket
42− fi
43− initctl set-env MIR_SERVER_FILE=$MIR_SERVER_FILE
44−
45− # Point all future jobs in this session to our Mir socket instead of
46− # unity-system-compositor's socket.
47− initctl set-env --global MIR_SOCKET=$MIR_SERVER_FILE
48− gdbus call --session --dest org.freedesktop.DBus --object-path /org/freedesktop/DBus --method org.freedesktop.DBus.UpdateActivationEnvironment "@a{ss} {'MIR_SOCKET': '$MIR_SERVER_FILE'}"
49−
50− # Remove the normal and trusted sockets if still there
51− if [ -S "$MIR_SERVER_FILE" ]; then
52− rm "$MIR_SERVER_FILE"
53− fi
54−
55− if [ -S "${MIR_SERVER_FILE}_trusted" ]; then
56− rm "${MIR_SERVER_FILE}_trusted"
57− fi
58−
59− initctl set-env --global MIR_SERVER_PROMPT_FILE=1
60−
61− # Disable Qt's stuttering 'touch compression' to fix scrolling smoothness
62− # issues (LP: #1486341, LP: #1556763). As a bonus, this eliminates most of
63− # the lag seen in the indicator panel pull-down (LP: #1488327) and also
64− # reduces lag seen in apps:
65− initctl set-env --global QML_NO_TOUCH_COMPRESSION=1
66−
67− # Workaround for text not rendering correctly
68− initctl set-env --global QT_ENABLE_GLYPH_CACHE_WORKAROUND=1
69−
70− if [ "$XDG_SESSION_DESKTOP" = "ubuntu-touch" ]; then
71− # On Ubuntu Touch, we currently use a trick where we auto-login the
72− # user without a LightDM greeter at all. In this case, we want to
73− # start with the lockscreen visible. Once we switch to using a
74− # proper greeter for the first login, we can remove this code path.
75− initctl set-env MODE=full-greeter
76− else
77− initctl set-env MODE=full-shell
78− fi
79−
80− # HACK! WORKAROUND FOR HALIUM MISSING UBUNTU_PLATFORM_API
81− initctl set-env --global UBUNTU_PLATFORM_API_BACKEND=test.so.3
82− initctl set-env --global UBUNTU_PLATFORM_API_SENSOR_TEST=/etc/ubuntusensors/test.sensors
83−end script
84−
85−exec ${BINARY:-unity8} --mode=$MODE $ARGS
86−
87−post-start script
88− initctl emit --no-wait indicator-services-start
89−end script
90−
91−post-stop script
92− initctl set-env --global MIR_SOCKET=$UNITY_MIR_SOCKET
93− initctl unset-env --global MIR_SERVER_PROMPT_FILE
94− initctl emit application-end
95−end script
data/unity8.servicenew file+14
@@ -0,0 +1,14 @@
1+[Unit]
2+Description=Unity Shell v8
3+PartOf=graphical-session.target
4+Requires=dbus.socket
5+After=dbus.socket
6+Before=indicators.target
7+Wants=indicators.target
8+
9+[Service]
10+Type=forking
11+ExecStart=/usr/bin/unity8-session
12+ExecStopPost=/usr/bin/dbus-update-activation-environment --systemd MIR_SOCKET=
13+Restart=on-failure
14+TimeoutStartSec=120
debian/changelog+1−1
@@ -1,4 +1,4 @@
1−unity8 (8.16.1+ubports) xenial; urgency=medium
1+unity8 (8.16.1+ubports) bionic; urgency=medium
22
33 * Imported to UBports
44
debian/control+14−9
@@ -3,9 +3,11 @@ Section: x11
33Priority: optional
44Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
55Build-Depends: cmake,
6+ cmake-extras,
67 dbus-test-runner,
78 debhelper (>= 9),
89 dh-apparmor,
10+ dh-systemd,
911 doxyqml,
1012# To allow cross-compiling to work, we also must append :native
1113# to g++ so we don't try to run arm g++
@@ -34,13 +36,13 @@ Build-Depends: cmake,
3436 libqt5svg5-dev,
3537 libqt5xmlpatterns5-dev,
3638 libsystemsettings-dev,
37− libubuntu-app-launch2-dev,
39+ libubuntu-app-launch3-dev,
3840 libubuntu-download-manager-common-dev,
3941 libubuntugestures5-dev (>= 1.3.2030),
4042 libubuntugestures5-private-dev (>= 1.3.2030),
4143 libudev-dev,
4244 libudm-common-dev,
43− libunity-api-dev (>= 8.6),
45+ libunity-api-dev (>= 8.7),
4446 libusermetricsoutput1-dev,
4547# Need those X11 libs touch emulation from mouse events in manual QML tests on a X11 desktop
4648 libx11-dev[!arm64 !armhf],
@@ -61,7 +63,7 @@ Build-Depends: cmake,
6163 qml-module-qtsysteminfo,
6264 qml-module-qttest,
6365 qml-module-ubuntu-components (>= 1.3.2030) | qml-module-ubuntu-components-gles (>= 1.3.2030),
64− qml-module-ubuntu-web,
66+# qml-module-ubuntu-web,
6567 qt5-default,
6668 qtbase5-dev (>= 5.6),
6769 qtbase5-dev-tools,
@@ -71,6 +73,7 @@ Build-Depends: cmake,
7173 qtdeclarative5-private-dev (>= 5.6),
7274 qtdeclarative5-ubuntu-content1,
7375 qtdeclarative5-ubuntu-settings-components (>= 0.11),
76+ systemd,
7477 ttf-ubuntu-font-family,
7578 xvfb,
7679Standards-Version: 3.9.4
@@ -120,7 +123,8 @@ Description: Development tool for Unity scopes
120123Package: unity8
121124Architecture: any
122125Provides: indicator-renderer,
123−Depends: dmz-cursor-theme,
126+Depends: dbus,
127+ dmz-cursor-theme,
124128 gsettings-desktop-schemas,
125129 libcap2-bin,
126130 libglib2.0-bin,
@@ -131,11 +135,12 @@ Depends: dmz-cursor-theme,
131135 qml-module-qtqml-statemachine,
132136 qml-module-qtquick-xmllistmodel,
133137 qml-module-qtsysteminfo,
134− qml-module-ubuntu-web,
138+# qml-module-ubuntu-web,
135139 qtdeclarative5-qtmir-plugin (>= 0.4.8),
136140 qtdeclarative5-ubuntu-telephony0.1,
141+ qtwayland5,
137142 ubuntu-system-settings (>= 0.4),
138− unity-launcher-impl-12,
143+ unity-launcher-impl-13,
139144 unity8-common (= ${source:Version}),
140145 unity8-private (= ${binary:Version}),
141146 unity8-private | unity-launcher-impl,
@@ -167,8 +172,8 @@ Depends: qml-module-qtquick-layouts,
167172 ubuntu-wallpapers,
168173 unity-application-impl-27,
169174 unity-notifications-impl-3,
170− unity-plugin-scopes | unity-scopes-impl,
171− unity-scopes-impl-12,
175+# unity-plugin-scopes | unity-scopes-impl,
176+# unity-scopes-impl-12,
172177 unity8-tests | unity-application-impl,
173178 ${misc:Depends},
174179Breaks: unity8 (<< 7.86),
@@ -239,7 +244,7 @@ Depends: accountsservice-ubuntu-schemas (>= 0.0.7),
239244 ${misc:Depends},
240245 ${shlibs:Depends},
241246Provides: unity-launcher-impl,
242− unity-launcher-impl-12,
247+ unity-launcher-impl-13,
243248Description: Unity 8 private libs
244249 The Unity 8 shell is the primary user interface for Ubuntu devices.
245250 .
debian/rules+2−2
@@ -9,7 +9,7 @@ export DPKG_GENSYMBOLS_CHECK_LEVEL=4
99export NO_PNG_PKG_MANGLE=1
1010
1111%:
12− dh $@ --parallel --fail-missing --with python3
12+ dh $@ --parallel --fail-missing --with python3,systemd
1313
1414override_dh_auto_configure:
1515 # Debian defines CMAKE_INSTALL_LOCALSTATEDIR as /usr/var, which is wrong.
@@ -30,7 +30,7 @@ override_dh_install:
3030 dh_install -X'*.pyc' --fail-missing
3131
3232override_dh_installdeb:
33− dh_apparmor --profile-name=usr.bin.unity8-dash -punity8-dash
33+ #dh_apparmor --profile-name=usr.bin.unity8-dash -punity8-dash
3434 dh_installdeb
3535
3636# use private lib directories
debian/unity8-tests.install+1
@@ -3,6 +3,7 @@ usr/bin/unity-mock-indicator-service
33usr/lib/*/unity8/qml/mocks
44usr/lib/*/unity8/qml/nonmirplugins
55usr/lib/*/unity8/qml/scopefakes
6+usr/lib/*/unity8/qml/utils
67usr/lib/*/unity8/tests
78usr/lib/*/unity8/uqmlscene
89usr/share/unity8/mocks
debian/unity8.install+3−2
@@ -1,7 +1,8 @@
11debian/usr.bin.unity8-dash etc/apparmor.d
22var/lib/unity8/version
3−data/unity8-filewatcher.conf usr/share/upstart/sessions/
4−data/unity8.conf usr/share/upstart/sessions/
3+data/unity8.service usr/lib/systemd/user
4+data/unity8-dash.service usr/lib/systemd/user
5+data/unity8-session usr/bin
56data/devices.conf etc/ubuntu/
67data/test.sensors etc/ubuntusensors/
78usr/bin/unity8
plugins/AccountsService/CMakeLists.txt+1−2
@@ -7,9 +7,8 @@ add_library(AccountsService-qml MODULE
77 plugin.cpp
88 )
99
10−qt5_use_modules(AccountsService-qml DBus Qml)
11−
1210target_link_libraries(AccountsService-qml
11+ Qt5::DBus Qt5::Qml
1312 ${GLIB_LIBRARIES}
1413 )
1514
plugins/CMakeLists.txt+1−1
@@ -1,4 +1,4 @@
1−include(QmlPlugins)
1+find_package(QmlPlugins)
22
33# Set up and install a plugin for unity8.
44#
plugins/Cursor/CMakeLists.txt+1−2
@@ -26,8 +26,7 @@ add_library(Cursor-qml SHARED
2626target_link_libraries(Cursor-qml
2727 xcursorloader-static
2828 ${QT5PLATFORM_SUPPORT_LDFLAGS}
29+ Qt5::Qml Qt5::Quick Qt5::Svg
2930)
3031
31−qt5_use_modules(Cursor-qml Qml Quick Svg)
32−
3332add_unity8_plugin(Cursor 1.1 Cursor TARGETS Cursor-qml)
plugins/Dash/CMakeLists.txt+1−2
@@ -37,10 +37,9 @@ add_library(Dash-qml MODULE
3737target_link_libraries(Dash-qml
3838 ${Qt5Gui_LIBRARIES}
3939 ${Qt5Quick_LIBRARIES}
40+ Qt5::Qml Qt5::Quick Qt5::Concurrent
4041 )
4142
42−qt5_use_modules(Dash-qml Qml Quick Concurrent)
43−
4443add_unity8_plugin(Dash 0.1 Dash TARGETS Dash-qml)
4544
4645install(FILES graphics/music_progress_bg.png DESTINATION ${SHELL_INSTALL_QML}/Dash/graphics/)
plugins/Dash/abstractdashview.cpp+1−1
@@ -236,7 +236,7 @@ QQuickItem *AbstractDashView::createItem(int modelIndex, bool asynchronous)
236236 return nullptr;
237237
238238 m_asyncRequestedIndex = -1;
239− QObject* object = m_delegateModel->object(modelIndex, asynchronous);
239+ QObject* object = m_delegateModel->object(modelIndex, asynchronous ? QQmlIncubator::Asynchronous : QQmlIncubator::AsynchronousIfNested);
240240 QQuickItem *item = qmlobject_cast<QQuickItem*>(object);
241241 if (!item) {
242242 if (object) {
plugins/Dash/listviewwithpageheader.cpp+1−1
@@ -871,7 +871,7 @@ ListViewWithPageHeader::ListItem *ListViewWithPageHeader::createItem(int modelIn
871871 return nullptr;
872872
873873 m_asyncRequestedIndex = -1;
874− QObject* object = m_delegateModel->object(modelIndex, asynchronous);
874+ QObject* object = m_delegateModel->object(modelIndex, asynchronous ? QQmlIncubator::Asynchronous : QQmlIncubator::AsynchronousIfNested);
875875 QQuickItem *item = qmlobject_cast<QQuickItem*>(object);
876876 if (!item) {
877877 if (object) {
plugins/GlobalShortcut/CMakeLists.txt+1−1
@@ -5,6 +5,6 @@ set(globalshortcutplugin_SRCS
55
66add_library(GlobalShortcut-qml SHARED ${globalshortcutplugin_SRCS})
77
8−qt5_use_modules(GlobalShortcut-qml Quick Gui)
8+target_link_libraries(GlobalShortcut-qml Qt5::Quick Qt5::Gui)
99
1010add_unity8_plugin(GlobalShortcut 1.0 GlobalShortcut TARGETS GlobalShortcut-qml)
plugins/Greeter/Unity/Launcher/CMakeLists.txt+1−2
@@ -29,8 +29,7 @@ add_library(UnityLauncherAS-qml MODULE
2929target_link_libraries(UnityLauncherAS-qml
3030 unity8-private
3131 ${GSETTINGS_QT_LDFLAGS}
32+ Qt5::DBus Qt5::Qml Qt5::Gui
3233 )
3334
34−qt5_use_modules(UnityLauncherAS-qml DBus Qml Gui)
35−
3635add_unity8_greeter_plugin(Unity.Launcher 0.1 Unity/Launcher TARGETS UnityLauncherAS-qml)
plugins/Greeter/Unity/Launcher/launcheritem.cpp+6
@@ -89,6 +89,12 @@ void LauncherItem::setKeywords(const QStringList &keywords)
8989 }
9090}
9191
92+uint LauncherItem::popularity() const
93+{
94+ // Not exposing usage order in greeter session at this point.
95+ return 0;
96+}
97+
9298bool LauncherItem::pinned() const
9399{
94100 return m_pinned;
plugins/Greeter/Unity/Launcher/launcheritem.h+1
@@ -35,6 +35,7 @@ public:
3535 QString name() const override;
3636 QString icon() const override;
3737 QStringList keywords() const override;
38+ uint popularity() const override;
3839 bool pinned() const override;
3940 bool running() const override;
4041 bool recent() const override;
plugins/ImageCache/CMakeLists.txt+1−1
@@ -3,6 +3,6 @@ add_library(ImageCache-qml MODULE
33 plugin.cpp
44 )
55
6−qt5_use_modules(ImageCache-qml Gui Qml Quick)
6+target_link_libraries(ImageCache-qml Qt5::Gui Qt5::Qml Qt5::Quick)
77
88add_unity8_plugin(ImageCache 0.1 ImageCache TARGETS ImageCache-qml)
plugins/LightDM/FullLightDM/CMakeLists.txt+1−1
@@ -26,7 +26,7 @@ target_link_libraries(FullLightDM-qml
2626 unity8-private
2727 ${LIBLIGHTDM_LDFLAGS}
2828 ${LIBUSERMETRICSOUTPUT_LDFLAGS}
29+ Qt5::DBus Qt5::Gui Qt5::Qml
2930 )
3031
31−qt5_use_modules(FullLightDM-qml DBus Gui Qml)
3232add_unity8_plugin(FullLightDM 0.1 LightDM/FullLightDM TARGETS FullLightDM-qml)
plugins/LightDM/IntegratedLightDM/CMakeLists.txt+1−1
@@ -25,9 +25,9 @@ target_link_libraries(IntegratedLightDM-qml
2525 integratedLightDM
2626 unity8-private
2727 ${LIBUSERMETRICSOUTPUT_LDFLAGS}
28+ Qt5::DBus Qt5::Gui Qt5::Qml
2829 )
2930
30−qt5_use_modules(IntegratedLightDM-qml DBus Gui Qml)
3131add_unity8_plugin(IntegratedLightDM 0.1 LightDM/IntegratedLightDM TARGETS IntegratedLightDM-qml)
3232
3333add_subdirectory(liblightdm)
plugins/LightDM/IntegratedLightDM/liblightdm/CMakeLists.txt+3−4
@@ -26,22 +26,21 @@ target_link_libraries(integratedLightDM
2626 ${GLIB_LIBRARIES}
2727 ${LIBUSERMETRICSOUTPUT_LDFLAGS}
2828 -lpam
29+ Qt5::Concurrent Qt5::DBus Qt5::Gui
2930)
3031target_link_libraries(integratedLightDMSession
3132 ${GLIB_LIBRARIES}
3233 ${LIBUSERMETRICSOUTPUT_LDFLAGS}
3334 -lpam
35+ Qt5::Concurrent Qt5::DBus Qt5::Gui
3436)
3537target_link_libraries(MockLightDM-demo-shared
3638 ${GLIB_LIBRARIES}
3739 ${LIBUSERMETRICSOUTPUT_LDFLAGS}
3840 -lpam
41+ Qt5::Concurrent Qt5::DBus Qt5::Gui
3942)
4043
41−qt5_use_modules(integratedLightDM Concurrent DBus Gui)
42−qt5_use_modules(integratedLightDMSession Concurrent DBus Gui)
43−qt5_use_modules(MockLightDM-demo-shared Concurrent DBus Gui)
44−
4544set_target_properties(integratedLightDM PROPERTIES
4645 COMPILE_FLAGS "-DSM_BUSNAME=systemBus -fPIC")
4746set_target_properties(integratedLightDMSession PROPERTIES
plugins/Lights/CMakeLists.txt+4−2
@@ -11,7 +11,9 @@ add_library(Lights-qml MODULE
1111 Lights.cpp
1212 )
1313
14−qt5_use_modules(Lights-qml Qml Gui)
15−target_link_libraries(Lights-qml ${ANDROID_HARDWARE_LIBRARIES})
14+target_link_libraries(Lights-qml
15+ Qt5::Qml Qt5::Gui
16+ ${ANDROID_HARDWARE_LIBRARIES}
17+ )
1618
1719add_unity8_plugin(Lights 0.1 Lights TARGETS Lights-qml)
plugins/Powerd/CMakeLists.txt+4−2
@@ -9,7 +9,9 @@ add_library(Powerd-qml MODULE
99 Powerd.cpp
1010 )
1111
12−qt5_use_modules(Powerd-qml DBus Qml)
13−target_link_libraries(Powerd-qml ${GIO_LDFLAGS})
12+target_link_libraries(Powerd-qml
13+ Qt5::DBus Qt5::Qml
14+ ${GIO_LDFLAGS}
15+ )
1416
1517add_unity8_plugin(Powerd 0.1 Powerd TARGETS Powerd-qml)
plugins/ScreenshotDirectory/CMakeLists.txt+1−1
@@ -4,6 +4,6 @@ set(PLUGIN_SOURCES
44)
55
66add_library(ScreenshotDirectory-qml MODULE ${PLUGIN_SOURCES})
7−qt5_use_modules(ScreenshotDirectory-qml Qml Gui Quick)
7+target_link_libraries(ScreenshotDirectory-qml Qt5::Qml Qt5::Gui Qt5::Quick)
88
99add_unity8_plugin(ScreenshotDirectory 0.1 ScreenshotDirectory TARGETS ScreenshotDirectory-qml)
plugins/SessionBroadcast/CMakeLists.txt+1−2
@@ -6,9 +6,8 @@ add_library(SessionBroadcast-qml MODULE
66 plugin.cpp
77 )
88
9−qt5_use_modules(SessionBroadcast-qml DBus Qml)
10−
119target_link_libraries(SessionBroadcast-qml
10+ Qt5::DBus Qt5::Qml
1211 ${GLIB_LIBRARIES}
1312 )
1413
plugins/UInput/CMakeLists.txt+1−1
@@ -3,5 +3,5 @@ add_library(UInput-qml MODULE
33 uinput.cpp
44)
55
6−qt5_use_modules(UInput-qml Qml)
6+target_link_libraries(UInput-qml Qt5::Qml)
77add_unity8_plugin(UInput 0.1 UInput TARGETS UInput-qml)
plugins/Ubuntu/DownloadDaemonListener/CMakeLists.txt+4−2
@@ -11,8 +11,10 @@ set(DOWNLOADDAEMONLISTENER_SOURCES
1111
1212add_library(DownloadDaemonListener MODULE ${DOWNLOADDAEMONLISTENER_SOURCES})
1313
14−qt5_use_modules(DownloadDaemonListener Qml Quick DBus Core)
1514pkg_check_modules(DDLADAPTER REQUIRED udm-common)
1615add_definitions(${DDLADAPTER_CFLAGS} ${DDLADAPTER_CFLAGS_OTHER})
17−target_link_libraries(DownloadDaemonListener ${DDLADAPTER_LIBRARIES})
16+target_link_libraries(DownloadDaemonListener
17+ Qt5::Qml Qt5::Quick Qt5::DBus Qt5::Core
18+ ${DDLADAPTER_LIBRARIES}
19+ )
1820add_unity8_plugin(Ubuntu.DownloadDaemonListener 0.1 Ubuntu/DownloadDaemonListener TARGETS DownloadDaemonListener)
plugins/Ubuntu/Gestures/CMakeLists.txt+1−3
@@ -17,9 +17,7 @@ pkg_check_modules(UBUNTUGESTURES REQUIRED UbuntuGestures)
1717add_definitions(-DUBUNTUGESTURESQML_LIBRARY)
1818
1919add_library(UbuntuGesturesQml SHARED ${UbuntuGesturesQml_SOURCES})
20−target_link_libraries(UbuntuGesturesQml ${UBUNTUGESTURES_LIBRARIES})
21−
22−qt5_use_modules(UbuntuGesturesQml Core Quick)
20+target_link_libraries(UbuntuGesturesQml ${UBUNTUGESTURES_LIBRARIES} Qt5::Core Qt5::Quick)
2321
2422# So that Foo.cpp can #include "Foo.moc"
2523include_directories(${CMAKE_CURRENT_BINARY_DIR})
plugins/Unity/ApplicationMenu/CMakeLists.txt+1−1
@@ -14,6 +14,6 @@ qt5_add_dbus_adaptor(applicationMenu_SRCS com.ubuntu.MenuRegistrar.xml dbusappli
1414
1515add_library(ApplicationMenu-qml MODULE ${applicationMenu_SRCS})
1616
17−qt5_use_modules(ApplicationMenu-qml DBus Qml)
17+target_link_libraries(ApplicationMenu-qml Qt5::DBus Qt5::Qml)
1818
1919add_unity8_plugin(Unity.ApplicationMenu 0.1 Unity/ApplicationMenu TARGETS ApplicationMenu-qml)
plugins/Unity/Connectivity/CMakeLists.txt+1−1
@@ -5,6 +5,6 @@ set(CONNECTIVITY_SOURCES
55
66add_library(Connectivity MODULE ${CONNECTIVITY_SOURCES})
77
8−qt5_use_modules(Connectivity Qml DBus Core)
8+target_link_libraries(Connectivity Qt5::Qml Qt5::DBus Qt5::Core)
99
1010add_unity8_plugin(Unity.Connectivity 0.1 Unity/Connectivity TARGETS Connectivity)
plugins/Unity/DashCommunicator/CMakeLists.txt+1−2
@@ -16,9 +16,8 @@ add_library(DashCommunicator-qml MODULE
1616 ${QMLDASHCOMMUNICATORPLUGIN_SRC}
1717)
1818
19−qt5_use_modules(DashCommunicator-qml DBus Qml)
20−
2119target_link_libraries(DashCommunicator-qml
20+ Qt5::DBus Qt5::Qml
2221 unity8-private
2322)
2423
plugins/Unity/Indicators/CMakeLists.txt+1−2
@@ -44,8 +44,7 @@ target_link_libraries(IndicatorsQml
4444 ${GLIB_LIBRARIES}
4545 ${GIO_LIBRARIES}
4646 ${QMENUMODEL_LDFLAGS}
47+ Qt5::Core Qt5::Qml Qt5::Quick Qt5::DBus
4748)
4849
49−qt5_use_modules(IndicatorsQml Core Qml Quick DBus)
50−
5150add_unity8_plugin(Unity.Indicators 0.1 Unity/Indicators TARGETS IndicatorsQml)
plugins/Unity/InputInfo/CMakeLists.txt+1−2
@@ -32,8 +32,7 @@ add_library(InputInfo SHARED
3232target_link_libraries(InputInfo
3333 ${LIBUDEV_LDFLAGS}
3434 ${LIBEVDEV_LDFLAGS}
35+ Qt5::Core Qt5::Qml Qt5::Quick
3536)
3637
37−qt5_use_modules(InputInfo Core Qml Quick)
38−
3938add_unity8_plugin(Unity.InputInfo 0.1 Unity/InputInfo TARGETS InputInfo)
plugins/Unity/Launcher/CMakeLists.txt+1−2
@@ -47,8 +47,7 @@ target_link_libraries(UnityLauncher-qml
4747 ${GSETTINGS_QT_LDFLAGS}
4848 ${GLIB_LIBRARIES}
4949 ${UAL_LIBRARIES}
50+ Qt5::DBus Qt5::Qml Qt5::Gui
5051 )
5152
52−qt5_use_modules(UnityLauncher-qml DBus Qml Gui)
53−
5453add_unity8_plugin(Unity.Launcher 0.1 Unity/Launcher TARGETS UnityLauncher-qml)
plugins/Unity/Launcher/appdrawermodel.cpp+68−7
@@ -21,7 +21,8 @@
2121#include <QDateTime>
2222
2323AppDrawerModel::AppDrawerModel(QObject *parent):
24− AppDrawerModelInterface(parent)
24+ AppDrawerModelInterface(parent),
25+ m_ual(new UalWrapper(this))
2526{
2627 Q_FOREACH (const QString &appId, UalWrapper::installedApps()) {
2728 UalWrapper::AppInfo info = UalWrapper::getApplicationInfo(appId);
@@ -29,10 +30,16 @@ AppDrawerModel::AppDrawerModel(QObject *parent):
2930 qWarning() << "Failed to get app info for app" << appId;
3031 continue;
3132 }
32− m_list.append(new LauncherItem(appId, info.name, info.icon, this));
33− m_list.last()->setKeywords(info.keywords);
33+ LauncherItem* item = new LauncherItem(appId, info.name, info.icon, this);
34+ item->setKeywords(info.keywords);
35+ item->setPopularity(info.popularity);
36+ m_list.append(item);
3437 }
35− qsrand(QDateTime::currentMSecsSinceEpoch() / 100);
38+
39+ // keep this a queued connection as it's coming from another thread.
40+ connect(m_ual, &UalWrapper::appAdded, this, &AppDrawerModel::appAdded, Qt::QueuedConnection);
41+ connect(m_ual, &UalWrapper::appRemoved, this, &AppDrawerModel::appRemoved, Qt::QueuedConnection);
42+ connect(m_ual, &UalWrapper::appInfoChanged, this, &AppDrawerModel::appInfoChanged, Qt::QueuedConnection);
3643}
3744
3845int AppDrawerModel::rowCount(const QModelIndex &parent) const
@@ -53,10 +60,64 @@ QVariant AppDrawerModel::data(const QModelIndex &index, int role) const
5360 case RoleKeywords:
5461 return m_list.at(index.row())->keywords();
5562 case RoleUsage:
56− // FIXME: u-a-l needs to provide API for usage stats.
57− // don't forget to drop the qsrand() call in the ctor when dropping this.
58− return qrand();
63+ return m_list.at(index.row())->popularity();
5964 }
6065
6166 return QVariant();
6267}
68+
69+void AppDrawerModel::appAdded(const QString &appId)
70+{
71+ UalWrapper::AppInfo info = UalWrapper::getApplicationInfo(appId);
72+ if (!info.valid) {
73+ qWarning() << "App added signal received but failed to get app info for app" << appId;
74+ return;
75+ }
76+
77+ beginInsertRows(QModelIndex(), m_list.count(), m_list.count());
78+ LauncherItem* item = new LauncherItem(appId, info.name, info.icon, this);
79+ item->setKeywords(info.keywords);
80+ item->setPopularity(info.popularity);
81+ m_list.append(item);
82+ endInsertRows();
83+}
84+
85+void AppDrawerModel::appRemoved(const QString &appId)
86+{
87+ int idx = -1;
88+ for (int i = 0; i < m_list.count(); i++) {
89+ if (m_list.at(i)->appId() == appId) {
90+ idx = i;
91+ break;
92+ }
93+ }
94+ if (idx < 0) {
95+ qWarning() << "App removed signal received but app doesn't seem to be in the drawer model";
96+ return;
97+ }
98+ beginRemoveRows(QModelIndex(), idx, idx);
99+ m_list.takeAt(idx)->deleteLater();
100+ endRemoveRows();
101+}
102+
103+void AppDrawerModel::appInfoChanged(const QString &appId)
104+{
105+ LauncherItem *item = nullptr;
106+ int idx = -1;
107+
108+ for(int i = 0; i < m_list.count(); i++) {
109+ if (m_list.at(i)->appId() == appId) {
110+ item = m_list.at(i);
111+ idx = i;
112+ break;
113+ }
114+ }
115+
116+ if (!item) {
117+ return;
118+ }
119+
120+ UalWrapper::AppInfo info = m_ual->getApplicationInfo(appId);
121+ item->setPopularity(info.popularity);
122+ Q_EMIT dataChanged(index(idx), index(idx), {AppDrawerModelInterface::RoleUsage});
123+}
plugins/Unity/Launcher/appdrawermodel.h+8
@@ -19,6 +19,8 @@
1919
2020#include "launcheritem.h"
2121
22+class UalWrapper;
23+
2224class AppDrawerModel: public AppDrawerModelInterface
2325{
2426 Q_OBJECT
@@ -28,6 +30,12 @@ public:
2830 int rowCount(const QModelIndex &parent) const override;
2931 QVariant data(const QModelIndex &index, int role) const override;
3032
33+private Q_SLOTS:
34+ void appAdded(const QString &appId);
35+ void appRemoved(const QString &appId);
36+ void appInfoChanged(const QString &appId);
37+
3138private:
3239 QList<LauncherItem*> m_list;
40+ UalWrapper *m_ual;
3341};
plugins/Unity/Launcher/dbusinterface.cpp+2
@@ -39,6 +39,8 @@ QString DBusInterface::introspect(const QString &path) const
3939 QString nodes;
4040
4141 // Add Refresh to introspect
42+ // TODO: Confirm this is still used anywhere and remove if not.
43+ // It used to be used in an upstart job when desktop fles changed.
4244 nodes = QStringLiteral("<interface name=\"com.canonical.Unity.Launcher\">"
4345 "<method name=\"Refresh\"/>"
4446 "</interface>");
plugins/Unity/Launcher/launcheritem.cpp+13
@@ -256,6 +256,19 @@ void LauncherItem::setSurfaces(const QList<QPair<QString, QString> > &surfaces)
256256 }
257257}
258258
259+uint LauncherItem::popularity() const
260+{
261+ return m_popularity;
262+}
263+
264+void LauncherItem::setPopularity(uint popularity)
265+{
266+ if (m_popularity != popularity) {
267+ m_popularity = popularity;
268+ Q_EMIT popularityChanged(popularity);
269+ }
270+}
271+
259272unity::shell::launcher::QuickListModelInterface *LauncherItem::quickList() const
260273{
261274 return m_quickList;
plugins/Unity/Launcher/launcheritem.h+3
@@ -39,6 +39,7 @@ public:
3939 QString name() const override;
4040 QString icon() const override;
4141 QStringList keywords() const override;
42+ uint popularity() const override;
4243 bool pinned() const override;
4344 bool running() const override;
4445 bool recent() const override;
@@ -55,6 +56,7 @@ private:
5556 void setName(const QString &name);
5657 void setIcon(const QString &icon);
5758 void setKeywords(const QStringList &keywords);
59+ void setPopularity(uint popularity);
5860 void setPinned(bool pinned);
5961 void setRunning(bool running);
6062 void setRecent(bool recent);
@@ -70,6 +72,7 @@ private:
7072 QString m_name;
7173 QString m_icon;
7274 QStringList m_keywords;
75+ uint m_popularity;
7376 bool m_pinned;
7477 bool m_running;
7578 bool m_recent;
plugins/Unity/Launcher/launchermodel.cpp+1
@@ -167,6 +167,7 @@ void LauncherModel::pin(const QString &appId, int index)
167167 appInfo.icon,
168168 this);
169169 item->setPinned(true);
170+ item->setPopularity(appInfo.popularity);
170171 m_list.insert(index, item);
171172 endInsertRows();
172173 }
plugins/Unity/Launcher/ualwrapper.cpp+12−2
@@ -24,7 +24,15 @@ using namespace ubuntu::app_launch;
2424UalWrapper::UalWrapper(QObject *parent):
2525 QObject(parent)
2626{
27−
27+ Registry::appAdded().connect([this](const std::shared_ptr<Application>&app) {
28+ Q_EMIT appAdded(QString::fromStdString(app->appId()));
29+ });
30+ Registry::appRemoved().connect([this](const AppID &appId) {
31+ Q_EMIT appRemoved(QString::fromStdString(appId));
32+ });
33+ Registry::appInfoUpdated().connect([this](const std::shared_ptr<Application>&app){
34+ Q_EMIT appInfoChanged(QString::fromStdString(app->appId()));
35+ });
2836}
2937
3038QStringList UalWrapper::installedApps()
@@ -39,7 +47,7 @@ QStringList UalWrapper::installedApps()
3947 }
4048 }
4149 } catch (const std::runtime_error &e) {
42− qWarning() << "ubuntu-all-launch threw an exception listing apps:" << e.what();
50+ qWarning() << "ubuntu-app-launch threw an exception listing apps:" << e.what();
4351 }
4452
4553 return appIds;
@@ -59,11 +67,13 @@ UalWrapper::AppInfo UalWrapper::getApplicationInfo(const QString &appId)
5967 std::shared_ptr<Application> ualApp;
6068 ualApp = Application::create(ualAppId, Registry::getDefault());
6169
70+ info.appId = appId;
6271 info.name = QString::fromStdString(ualApp->info()->name());
6372 info.icon = QString::fromStdString(ualApp->info()->iconPath());
6473 for (const std::string &keyword : ualApp->info()->keywords().value()) {
6574 info.keywords << QString::fromStdString(keyword);
6675 }
76+ info.popularity = ualApp->info()->popularity();
6777 info.valid = true;
6878 } catch (const std::runtime_error &e) {
6979 qWarning() << "ubuntu-app-launch threw an exception getting app info for appId:" << appId << ":" << e.what();
plugins/Unity/Launcher/ualwrapper.h+6
@@ -21,10 +21,12 @@ class UalWrapper: public QObject
2121 Q_OBJECT
2222public:
2323 struct AppInfo {
24+ QString appId;
2425 bool valid = false;
2526 QString name;
2627 QString icon;
2728 QStringList keywords;
29+ uint popularity = 0;
2830 };
2931
3032 UalWrapper(QObject* parent = nullptr);
@@ -32,4 +34,8 @@ public:
3234 static QStringList installedApps();
3335 static AppInfo getApplicationInfo(const QString &appId);
3436
37+Q_SIGNALS:
38+ void appAdded(const QString &appId);
39+ void appRemoved(const QString &appId);
40+ void appInfoChanged(const QString &appId);
3541};
plugins/Unity/Platform/CMakeLists.txt+1−1
@@ -6,6 +6,6 @@ set(platformplugin_SRCS
66
77add_library(Platform-qml SHARED ${platformplugin_SRCS})
88
9−qt5_use_modules(Platform-qml DBus Qml)
9+target_link_libraries(Platform-qml Qt5::DBus Qt5::Qml)
1010
1111add_unity8_plugin(Unity.Platform 1.0 Unity/Platform TARGETS Platform-qml)
plugins/Unity/Session/CMakeLists.txt+1−1
@@ -18,8 +18,8 @@ add_library(UnitySession-qml MODULE
1818 ${QMLSESSIONPLUGIN_SRC}
1919 )
2020
21−qt5_use_modules(UnitySession-qml DBus Qml)
2221target_link_libraries(UnitySession-qml
22+ Qt5::DBus Qt5::Qml
2323 unity8-private
2424 ${GIO_LDFLAGS}
2525 ${GLIB_LIBRARIES}
plugins/Unity/Session/dbusunitysessionservice.cpp+5−11
@@ -36,6 +36,7 @@
3636
3737#define LOGIN1_SERVICE QStringLiteral("org.freedesktop.login1")
3838#define LOGIN1_PATH QStringLiteral("/org/freedesktop/login1")
39+#define LOGIN1_SESSION_ROOT QStringLiteral("/org/freedesktop/login1/session/")
3940#define LOGIN1_IFACE QStringLiteral("org.freedesktop.login1.Manager")
4041#define LOGIN1_SESSION_IFACE QStringLiteral("org.freedesktop.login1.Session")
4142
@@ -58,16 +59,9 @@ public:
5859
5960 void init()
6061 {
61− // get our logind session path
62− QDBusMessage msg = QDBusMessage::createMethodCall(LOGIN1_SERVICE,
63− LOGIN1_PATH,
64− LOGIN1_IFACE,
65− QStringLiteral("GetSessionByPID"));
66− msg << (quint32) getpid();
67−
68− QDBusReply<QDBusObjectPath> reply = QDBusConnection::SM_BUSNAME().call(msg);
69− if (reply.isValid()) {
70− logindSessionPath = reply.value().path();
62+ QString sessionID = QString::fromLocal8Bit(qgetenv("XDG_SESSION_ID"));
63+ if (!sessionID.isEmpty()) {
64+ logindSessionPath = LOGIN1_SESSION_ROOT + sessionID;
7165
7266 // start watching the Active property
7367 QDBusConnection::SM_BUSNAME().connect(LOGIN1_SERVICE, logindSessionPath, QStringLiteral("org.freedesktop.DBus.Properties"), QStringLiteral("PropertiesChanged"),
@@ -79,7 +73,7 @@ public:
7973 QDBusConnection::SM_BUSNAME().connect(LOGIN1_SERVICE, LOGIN1_PATH, LOGIN1_IFACE, QStringLiteral("PrepareForSleep"),
8074 this, SLOT(onResuming(bool)));
8175 } else {
82− qWarning() << "Failed to get logind session path" << reply.error().message();
76+ qWarning() << "Failed to get logind session: XDG_SESSION_ID is not set";
8377 }
8478 }
8579
plugins/Utils/CMakeLists.txt+4−3
@@ -44,7 +44,10 @@ add_library(Utils-qml SHARED
4444 ${QMLPLUGIN_SRC}
4545 )
4646
47−target_link_libraries(Utils-qml ${GIO_LDFLAGS})
47+target_link_libraries(Utils-qml
48+ ${GIO_LDFLAGS}
49+ Qt5::Qml Qt5::Quick Qt5::DBus Qt5::Network Qt5::Gui Qt5::Sql Qt5::Concurrent
50+ )
4851
4952# Because this is an internal support library, we want
5053# to expose all symbols in it. Consider changing this
@@ -52,6 +55,4 @@ target_link_libraries(Utils-qml ${GIO_LDFLAGS})
5255# files directly in targets.
5356set_target_properties(Utils-qml PROPERTIES COMPILE_FLAGS -fvisibility=default)
5457
55−qt5_use_modules(Utils-qml Qml Quick DBus Network Gui Sql Concurrent)
56−
5758add_unity8_plugin(Utils 0.1 Utils TARGETS Utils-qml)
plugins/WindowManager/CMakeLists.txt+1−1
@@ -20,6 +20,6 @@ include_directories(
2020
2121add_library(windowmanager-qml SHARED ${WINDOWMANAGER_SRC})
2222
23−qt5_use_modules(windowmanager-qml Qml Quick Gui)
23+target_link_libraries(windowmanager-qml Qt5::Qml Qt5::Quick Qt5::Gui)
2424
2525add_unity8_plugin(WindowManager 0.1 WindowManager TARGETS windowmanager-qml)
plugins/Wizard/CMakeLists.txt+4−2
@@ -12,8 +12,10 @@ add_library(Wizard-qml MODULE
1212 keyboardLayoutsModel.cpp
1313)
1414
15−qt5_use_modules(Wizard-qml DBus Qml)
16−target_link_libraries(Wizard-qml ${GD3_LDFLAGS} ${GLIB_LDFLAGS} ${GEONAMES_LDFLAGS})
15+target_link_libraries(Wizard-qml
16+ Qt5::DBus Qt5::Qml
17+ ${GD3_LDFLAGS} ${GLIB_LDFLAGS} ${GEONAMES_LDFLAGS}
18+)
1719add_unity8_plugin(Wizard 0.1 Wizard TARGETS Wizard-qml)
1820
1921set(POLKIT_LIB_DIR "${CMAKE_INSTALL_LOCALSTATEDIR}/lib/polkit-1")
plugins/Wizard/Utils/CMakeLists.txt+1−1
@@ -20,7 +20,7 @@ add_library(WizardUtils-qml SHARED
2020# files directly in targets.
2121set_target_properties(WizardUtils-qml PROPERTIES COMPILE_FLAGS -fvisibility=default)
2222
23−qt5_use_modules(WizardUtils-qml DBus Qml Quick)
23+target_link_libraries(WizardUtils-qml Qt5::DBus Qt5::Qml Qt5::Quick)
2424
2525set(PLUG_DIR ${PLUGIN_PRIVATE_MODULE_DIR}/Ubuntu/SystemSettings/Wizard/Utils)
2626install(FILES qmldir DESTINATION ${PLUG_DIR})
src/CMakeLists.txt+5−2
@@ -44,12 +44,15 @@ endif()
4444
4545pkg_check_modules(ANDROID_PROPERTIES REQUIRED libandroid-properties)
4646add_executable(${SHELL_APP} ${SOURCE_FILES})
47−qt5_use_modules(${SHELL_APP} DBus Gui Qml Quick Test)
4847
4948if (NOT "${ANDROID_PROPERTIES_INCLUDE_DIRS}" STREQUAL "")
5049 set_target_properties(${SHELL_APP} PROPERTIES INCLUDE_DIRECTORIES ${ANDROID_PROPERTIES_INCLUDE_DIRS})
5150endif()
52−target_link_libraries(${SHELL_APP} ${ANDROID_PROPERTIES_LDFLAGS} ${GSETTINGS_QT_LDFLAGS} UbuntuGestures connectivity-qt1 unity8-private)
51+target_link_libraries(${SHELL_APP}
52+ Qt5::DBus Qt5::Gui Qt5::Qml Qt5::Quick Qt5::Test
53+ ${ANDROID_PROPERTIES_LDFLAGS} ${GSETTINGS_QT_LDFLAGS}
54+ UbuntuGestures connectivity-qt1 unity8-private
55+ )
5356
5457if (ENABLE_TOUCH_EMULATION)
5558 target_link_libraries(${SHELL_APP} ${MOUSETOUCHADAPTOR_LIBS_LDFLAGS})
src/Dash/CMakeLists.txt+4−3
@@ -10,12 +10,13 @@ endif()
1010
1111add_executable(unity8-dash ${DASH_SRCS})
1212
13−qt5_use_modules(unity8-dash DBus Gui Qml Quick Test)
14−
1513# For it to find libUbuntuGestures.so, needed by Ubuntu.Gestures QML module.
1614set_target_properties(unity8-dash PROPERTIES INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${SHELL_PRIVATE_LIBDIR}")
1715
18−target_link_libraries(unity8-dash UbuntuGestures connectivity-qt1)
16+target_link_libraries(unity8-dash
17+ Qt5::DBus Qt5::Gui Qt5::Qml Qt5::Quick Qt5::Test
18+ UbuntuGestures connectivity-qt1
19+)
1920
2021if (ENABLE_TOUCH_EMULATION)
2122 target_link_libraries(unity8-dash ${MOUSETOUCHADAPTOR_LIBS_LDFLAGS})
src/libunity8-private/CMakeLists.txt+1−1
@@ -19,7 +19,7 @@ set_target_properties(${LIB_NAME} PROPERTIES
1919 SOVERSION ${SOVERSION}
2020 )
2121
22−qt5_use_modules(${LIB_NAME} DBus)
22+target_link_libraries(${LIB_NAME} Qt5::DBus)
2323
2424# install library
2525install(TARGETS ${LIB_NAME}
tests/mocks/AccountsService/CMakeLists.txt+1−2
@@ -14,9 +14,8 @@ add_library(MockAccountsService-qml MODULE
1414 plugin.cpp
1515 )
1616
17−qt5_use_modules(MockAccountsService-qml DBus Qml)
18−
1917target_link_libraries(MockAccountsService-qml
18+ Qt5::DBus Qt5::Qml
2019 MockLightDM
2120 )
2221
tests/mocks/Biometryd/CMakeLists.txt+1−1
@@ -9,6 +9,6 @@ set(MOCK_BIOMETRYD_SOURCES
99
1010add_library(MockBiometryd MODULE ${MOCK_BIOMETRYD_SOURCES})
1111
12−qt5_use_modules(MockBiometryd Qml Quick Core)
12+target_link_libraries(MockBiometryd Qt5::Qml Qt5::Quick Qt5::Core)
1313
1414add_unity8_mock(Biometryd 0.0 Biometryd TARGETS MockBiometryd)
tests/mocks/CMakeLists.txt+1−1
@@ -1,4 +1,4 @@
1−include(QmlPlugins)
1+find_package(QmlPlugins)
22
33# Set up and optionally install a mock plugin for unity8.
44#
tests/mocks/GSettings.1.0/CMakeLists.txt+1−2
@@ -13,8 +13,7 @@ add_library(FakeGSettingsQml MODULE ${GSettingsQML_SOURCES})
1313target_link_libraries(FakeGSettingsQml
1414 ${Qt5Core_LIBRARIES}
1515 ${Qt5Quick_LIBRARIES}
16+ Qt5::Qml
1617)
1718
18−qt5_use_modules(FakeGSettingsQml Qml)
19−
2019add_unity8_mock(GSettings 1.0 GSettings.1.0 TARGETS FakeGSettingsQml)
tests/mocks/LightDMController/CMakeLists.txt+1−2
@@ -8,8 +8,7 @@ target_include_directories(LightDMController PUBLIC
88
99target_link_libraries(LightDMController
1010 MockLightDM
11+ Qt5::Qml
1112 )
1213
13−qt5_use_modules(LightDMController Qml)
14−
1514add_unity8_mock(LightDMController 0.1 LightDMController TARGETS LightDMController)
tests/mocks/Lights/CMakeLists.txt+1−1
@@ -3,6 +3,6 @@ add_library(MockLights-qml MODULE
33 Lights.cpp
44 )
55
6−qt5_use_modules(MockLights-qml Qml Gui)
6+target_link_libraries(MockLights-qml Qt5::Qml Qt5::Gui)
77
88add_unity8_mock(Lights 0.1 Lights TARGETS MockLights-qml)
tests/mocks/MeeGo/QOfono/CMakeLists.txt+1−1
@@ -6,6 +6,6 @@ set(MOCK_QOFONO_SOURCES
66
77add_library(MockQOfono MODULE ${MOCK_QOFONO_SOURCES})
88
9−qt5_use_modules(MockQOfono Qml Quick Core)
9+target_link_libraries(MockQOfono Qt5::Qml Qt5::Quick Qt5::Core)
1010
1111add_unity8_mock(MeeGo.QOfono 0.2 MeeGo/QOfono TARGETS MockQOfono)
tests/mocks/Powerd/CMakeLists.txt+1−1
@@ -5,6 +5,6 @@ add_library(MockPowerd-qml MODULE
55 Powerd.cpp
66 )
77
8−qt5_use_modules(MockPowerd-qml Qml)
8+target_link_libraries(MockPowerd-qml Qt5::Qml)
99
1010add_unity8_mock(Powerd 0.1 Powerd TARGETS MockPowerd-qml)
tests/mocks/QMenuModel/CMakeLists.txt+1−2
@@ -15,10 +15,9 @@ add_library(QMenuModelQml SHARED ${QMenuModelQml_SOURCES})
1515target_link_libraries(QMenuModelQml
1616 ${Qt5Core_LIBRARIES}
1717 ${Qt5Quick_LIBRARIES}
18+ Qt5::Core Qt5::Quick
1819)
1920
20−qt5_use_modules(QMenuModelQml Core Quick)
21−
2221set_target_properties(QMenuModelQml PROPERTIES
2322 OUTPUT_NAME qmenumodel
2423 VERSION 0)
tests/mocks/QtMultimedia/CMakeLists.txt+1−1
@@ -10,6 +10,6 @@ add_library(QtMultimedia-qml MODULE
1010 declarativeplaylist.cpp
1111 )
1212
13−qt5_use_modules(QtMultimedia-qml Qml Quick)
13+target_link_libraries(QtMultimedia-qml Qt5::Qml Qt5::Quick)
1414
1515add_unity8_mock(QtMultimedia 5.0 QtMultimedia TARGETS QtMultimedia-qml)
tests/mocks/SessionBroadcast/CMakeLists.txt+1−1
@@ -3,6 +3,6 @@ add_library(MockSessionBroadcast-qml MODULE
33 SessionBroadcast.cpp
44 )
55
6−qt5_use_modules(MockSessionBroadcast-qml Qml)
6+target_link_libraries(MockSessionBroadcast-qml Qt5::Qml)
77
88add_unity8_mock(SessionBroadcast 0.1 SessionBroadcast TARGETS MockSessionBroadcast-qml)
tests/mocks/UInput/CMakeLists.txt+1−1
@@ -3,5 +3,5 @@ add_library(FakeUInput-qml MODULE
33 mockuinput.cpp
44)
55
6−qt5_use_modules(FakeUInput-qml Qml)
6+target_link_libraries(FakeUInput-qml Qt5::Qml)
77add_unity8_mock(UInput 0.1 UInput TARGETS FakeUInput-qml)
tests/mocks/Ubuntu/Connectivity/CMakeLists.txt+1−1
@@ -2,7 +2,7 @@ add_library(connectivity-qml SHARED
22 networking-status.cpp
33 plugin.cpp
44)
5−qt5_use_modules(connectivity-qml Qml)
5+target_link_libraries(connectivity-qml Qt5::Qml)
66
77# copy qmldir file into build directory for shadow builds
88file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/qmldir"
tests/mocks/Ubuntu/DownloadDaemonListener/CMakeLists.txt+1−1
@@ -5,6 +5,6 @@ set(FakeUbuntuDownloadDaemonListenerQml_SOURCES
55
66add_library(FakeUbuntuDownloadDaemonListenerQml MODULE ${FakeUbuntuDownloadDaemonListenerQml_SOURCES})
77
8−qt5_use_modules(FakeUbuntuDownloadDaemonListenerQml Core Quick)
8+target_link_libraries(FakeUbuntuDownloadDaemonListenerQml Qt5::Core Qt5::Quick)
99
1010add_unity8_mock(Ubuntu.DownloadDaemonListener 0.1 Ubuntu/DownloadDaemonListener TARGETS FakeUbuntuDownloadDaemonListenerQml)
tests/mocks/Ubuntu/SystemSettings/SecurityPrivacy/CMakeLists.txt+1−1
@@ -5,6 +5,6 @@ set(MOCK_SECURITYPRIVACY_SOURCES
55
66add_library(MockSecurityPrivacy MODULE ${MOCK_SECURITYPRIVACY_SOURCES})
77
8−qt5_use_modules(MockSecurityPrivacy Qml Quick Core)
8+target_link_libraries(MockSecurityPrivacy Qt5::Qml Qt5::Quick Qt5::Core)
99
1010add_unity8_mock(Ubuntu.SystemSettings.SecurityPrivacy 1.0 Ubuntu/SystemSettings/SecurityPrivacy TARGETS MockSecurityPrivacy)
tests/mocks/Ubuntu/Telephony/CMakeLists.txt+1−1
@@ -9,6 +9,6 @@ set(FakeUbuntuTelephonyQml_SOURCES
99
1010add_library(FakeUbuntuTelephonyQml MODULE ${FakeUbuntuTelephonyQml_SOURCES})
1111
12−qt5_use_modules(FakeUbuntuTelephonyQml Core Quick)
12+target_link_libraries(FakeUbuntuTelephonyQml Qt5::Core Qt5::Quick)
1313
1414add_unity8_mock(Ubuntu.Telephony 0.1 Ubuntu/Telephony TARGETS FakeUbuntuTelephonyQml)
tests/mocks/Unity/Application/CMakeLists.txt+2−2
@@ -24,8 +24,8 @@ add_library(FakeUnityApplicationQml MODULE ${FakeUnityApplicationQml_SOURCES})
2424add_library(NonMirUnityApplicationQml MODULE ${FakeUnityApplicationQml_SOURCES})
2525set_target_properties(NonMirUnityApplicationQml PROPERTIES OUTPUT_NAME FakeUnityApplicationQml)
2626
27−qt5_use_modules(FakeUnityApplicationQml Core Quick DBus)
28−qt5_use_modules(NonMirUnityApplicationQml Core Quick DBus)
27+target_link_libraries(FakeUnityApplicationQml Qt5::Core Qt5::Quick Qt5::DBus)
28+target_link_libraries(NonMirUnityApplicationQml Qt5::Core Qt5::Quick Qt5::DBus)
2929
3030add_unity8_mock(Unity.Application 0.1 Unity/Application TARGETS FakeUnityApplicationQml)
3131add_unity8_mock(Unity.Application 0.1 Unity/Application
tests/mocks/Unity/ApplicationMenu/CMakeLists.txt+1−1
@@ -13,6 +13,6 @@ set(FakeApplicationMenu_SRCS
1313
1414add_library(FakeApplicationMenu-qml MODULE ${FakeApplicationMenu_SRCS})
1515
16−qt5_use_modules(FakeApplicationMenu-qml Qml DBus)
16+target_link_libraries(FakeApplicationMenu-qml Qt5::Qml Qt5::DBus)
1717
1818add_unity8_mock(Unity.ApplicationMenu 1.0 Unity/ApplicationMenu PREFIX mocks TARGETS FakeApplicationMenu-qml)
tests/mocks/Unity/CMakeLists.txt+1−1
@@ -67,7 +67,7 @@ target_link_libraries(FakeUnityQml
6767 ${GOBJECT_LDFLAGS}
6868)
6969
70−qt5_use_modules(FakeUnityQml Qml)
70+target_link_libraries(FakeUnityQml Qt5::Qml)
7171
7272add_unity8_mock(Unity 0.2 Unity TARGETS FakeUnityQml)
7373
tests/mocks/Unity/Connectivity/CMakeLists.txt+1−1
@@ -5,6 +5,6 @@ set(MOCK_CONNECTIVITY_SOURCES
55
66add_library(MockConnectivity MODULE ${MOCK_CONNECTIVITY_SOURCES})
77
8−qt5_use_modules(MockConnectivity Qml Quick Core)
8+target_link_libraries(MockConnectivity Qt5::Qml Qt5::Quick Qt5::Core)
99
1010add_unity8_mock(Unity.Connectivity 0.1 Unity/Connectivity TARGETS MockConnectivity)
tests/mocks/Unity/DashCommunicator/CMakeLists.txt+1−1
@@ -12,7 +12,7 @@ add_library(MockDashCommunicator-qml MODULE
1212 ${QMLDASHCOMMUNICATORPLUGIN_SRC}
1313 )
1414
15−qt5_use_modules(MockDashCommunicator-qml DBus Qml)
15+target_link_libraries(MockDashCommunicator-qml Qt5::DBus Qt5::Qml)
1616
1717# export the qmldir and qmltypes files
1818add_unity8_mock(Unity.DashCommunicator 0.1 Unity/DashCommunicator TARGETS MockDashCommunicator-qml)
tests/mocks/Unity/Indicators/CMakeLists.txt+1−2
@@ -29,12 +29,11 @@ add_definitions(-DUNITYINDICATORS_LIBRARY)
2929
3030target_link_libraries(IndicatorsFakeQml
3131 QMenuModelQml
32+ Qt5::Core Qt5::Qml Qt5::Quick
3233)
3334
3435set_target_properties(IndicatorsFakeQml PROPERTIES
3536 INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${SHELL_INSTALL_QML}/mocks/QMenuModel"
3637)
3738
38−qt5_use_modules(IndicatorsFakeQml Core Qml Quick)
39−
4039add_unity8_mock(Unity.Indicators 0.1 Unity/Indicators TARGETS IndicatorsFakeQml)
tests/mocks/Unity/InputInfo/CMakeLists.txt+1−1
@@ -26,6 +26,6 @@ add_library(MockInputInfo SHARED
2626 ${MockInputInfo_SOURCES}
2727)
2828
29−qt5_use_modules(MockInputInfo Core Qml Quick)
29+target_link_libraries(MockInputInfo Qt5::Core Qt5::Qml Qt5::Quick)
3030
3131add_unity8_mock(Unity.InputInfo 0.1 Unity/InputInfo TARGETS MockInputInfo)
tests/mocks/Unity/Launcher/CMakeLists.txt+1−1
@@ -19,6 +19,6 @@ set(MockLauncherModel_SOURCES
1919
2020add_library(MockLauncherPlugin MODULE ${MockLauncherModel_SOURCES})
2121
22−qt5_use_modules(MockLauncherPlugin Core Quick)
22+target_link_libraries(MockLauncherPlugin Qt5::Core Qt5::Quick)
2323
2424add_unity8_mock(Unity.Launcher 0.1 Unity/Launcher TARGETS MockLauncherPlugin)
tests/mocks/Unity/Launcher/MockLauncherItem.cpp+13
@@ -72,6 +72,11 @@ QStringList MockLauncherItem::keywords() const
7272 return m_keywords;
7373}
7474
75+uint MockLauncherItem::popularity() const
76+{
77+ return m_popularity;
78+}
79+
7580bool MockLauncherItem::pinned() const
7681{
7782 return m_pinned;
@@ -201,6 +206,14 @@ void MockLauncherItem::setSurfaceCount(int surfaceCount)
201206 }
202207}
203208
209+void MockLauncherItem::setPopularity(uint popularity)
210+{
211+ if (m_popularity != popularity) {
212+ m_popularity = popularity;
213+ Q_EMIT popularityChanged(m_popularity);
214+ }
215+}
216+
204217unity::shell::launcher::QuickListModelInterface *MockLauncherItem::quickList() const
205218{
206219 return m_quickList;
tests/mocks/Unity/Launcher/MockLauncherItem.h+3
@@ -40,6 +40,7 @@ public:
4040 QString name() const override;
4141 QString icon() const override;
4242 QStringList keywords() const override;
43+ uint popularity() const override;
4344
4445 bool pinned() const override;
4546 bool running() const override;
@@ -55,6 +56,7 @@ public:
5556
5657private:
5758 void setKeywords(const QStringList &keywords);
59+ void setPopularity(uint popularity);
5860 void setPinned(bool pinned);
5961 void setRunning(bool running);
6062 void setRecent(bool recent);
@@ -70,6 +72,7 @@ private:
7072 QString m_name;
7173 QString m_icon;
7274 QStringList m_keywords;
75+ uint m_popularity;
7376 bool m_pinned;
7477 bool m_running;
7578 bool m_recent;
tests/mocks/Unity/Notifications/CMakeLists.txt+1−1
@@ -11,6 +11,6 @@ set(MockNotificationsPlugin_SOURCES
1111
1212add_library(MockNotificationsPlugin MODULE ${MockNotificationsPlugin_SOURCES})
1313
14−qt5_use_modules(MockNotificationsPlugin Core Quick)
14+target_link_libraries(MockNotificationsPlugin Qt5::Core Qt5::Quick)
1515
1616add_unity8_mock(Unity.Notifications 1.0 Unity/Notifications TARGETS MockNotificationsPlugin)
tests/mocks/Unity/Screens/CMakeLists.txt+1−1
@@ -9,6 +9,6 @@ set(MockScreens_SOURCES
99
1010add_library(MockScreensPlugin MODULE ${MockScreens_SOURCES})
1111
12−qt5_use_modules(MockScreensPlugin Gui Qml)
12+target_link_libraries(MockScreensPlugin Qt5::Gui Qt5::Qml)
1313
1414add_unity8_mock(Unity.Screens 0.1 Unity/Screens PREFIX mocks TARGETS MockScreensPlugin)
tests/mocks/Utils/CMakeLists.txt+4−3
@@ -47,7 +47,10 @@ add_library(FakeUtils-qml SHARED
4747 ${QMLPLUGIN_SRC}
4848 )
4949
50−target_link_libraries(FakeUtils-qml ${GIO_LDFLAGS})
50+target_link_libraries(FakeUtils-qml
51+ ${GIO_LDFLAGS}
52+ Qt5::Qml Qt5::Quick Qt5::DBus Qt5::Network Qt5::Gui
53+ )
5154
5255# Because this is an internal support library, we want
5356# to expose all symbols in it. Consider changing this
@@ -55,6 +58,4 @@ target_link_libraries(FakeUtils-qml ${GIO_LDFLAGS})
5558# files directly in targets.
5659set_target_properties(FakeUtils-qml PROPERTIES COMPILE_FLAGS -fvisibility=default)
5760
58−qt5_use_modules(FakeUtils-qml Qml Quick DBus Network Gui)
59−
6061add_unity8_mock(Utils 0.1 Utils TARGETS FakeUtils-qml)
tests/mocks/Wizard/CMakeLists.txt+1−2
@@ -15,6 +15,5 @@ add_library(MockWizard-qml MODULE
1515 ${CMAKE_SOURCE_DIR}/plugins/Wizard/keyboardLayoutsModel.cpp
1616)
1717
18−qt5_use_modules(MockWizard-qml DBus Qml)
19−target_link_libraries(MockWizard-qml ${GD3_LDFLAGS} ${GLIB_LDFLAGS} ${GEONAMES_LDFLAGS})
18+target_link_libraries(MockWizard-qml Qt5::DBus Qt5::Qml ${GD3_LDFLAGS} ${GLIB_LDFLAGS} ${GEONAMES_LDFLAGS})
2019add_unity8_mock(Wizard 0.1 Wizard TARGETS MockWizard-qml)
tests/mocks/liblightdm/CMakeLists.txt+1−1
@@ -7,7 +7,7 @@ set(MockLightDM_SOURCES
77
88add_library(MockLightDM SHARED ${MockLightDM_SOURCES})
99
10−qt5_use_modules(MockLightDM DBus Gui)
10+target_link_libraries(MockLightDM Qt5::DBus Qt5::Gui)
1111
1212set_target_properties(MockLightDM PROPERTIES
1313 OUTPUT_NAME lightdm-qt5-3
tests/mocks/liblightdm/demo/CMakeLists.txt+1−1
@@ -18,4 +18,4 @@ target_link_libraries(MockLightDM-demo
1818 ${LIBUSERMETRICSOUTPUT_LDFLAGS}
1919 )
2020
21−qt5_use_modules(MockLightDM-demo Gui)
21+target_link_libraries(MockLightDM-demo Qt5::Gui)
tests/mocks/libusermetrics/CMakeLists.txt+1−1
@@ -6,7 +6,7 @@ set(mock_SOURCES
66
77add_library(MockUserMetrics SHARED ${mock_SOURCES})
88
9−qt5_use_modules(MockUserMetrics Gui)
9+target_link_libraries(MockUserMetrics Qt5::Gui)
1010
1111include_directories(
1212 ${CMAKE_SOURCE_DIR}/plugins/Utils
tests/plugins/AccountsService/CMakeLists.txt+2−2
@@ -40,7 +40,7 @@ add_executable(mock-server
4040 PropertiesServer.cpp
4141 UscServer.cpp
4242 )
43−qt5_use_modules(mock-server Core DBus)
43+target_link_libraries(mock-server Qt5::Core Qt5::DBus)
4444install(TARGETS mock-server
4545 DESTINATION "${SHELL_PRIVATE_LIBDIR}/tests/plugins/AccountsService"
4646)
@@ -50,7 +50,7 @@ add_executable(test-accountsservice
5050 ${CMAKE_SOURCE_DIR}/plugins/AccountsService/AccountsServiceDBusAdaptor.cpp
5151 client.cpp
5252 )
53−qt5_use_modules(test-accountsservice Core DBus Test)
53+target_link_libraries(test-accountsservice Qt5::Core Qt5::DBus Qt5::Test)
5454install(TARGETS test-accountsservice
5555 DESTINATION "${SHELL_PRIVATE_LIBDIR}/tests/plugins/AccountsService"
5656)
tests/plugins/Dash/CMakeLists.txt+4−8
@@ -32,8 +32,7 @@ macro(add_lvwph_test FILENAME TESTNAME)
3232 add_executable(${TESTNAME}TestExec
3333 ${FILENAME}test.cpp
3434 ${CMAKE_CURRENT_SOURCE_DIR}/../../../plugins/Dash/listviewwithpageheader.cpp)
35− qt5_use_modules(${TESTNAME}TestExec Test Core Qml)
36− target_link_libraries(${TESTNAME}TestExec ${Qt5Gui_LIBRARIES} ${Qt5Quick_LIBRARIES})
35+ target_link_libraries(${TESTNAME}TestExec Qt5::Test Qt5::Core Qt5::Qml ${Qt5Gui_LIBRARIES} ${Qt5Quick_LIBRARIES})
3736 install(TARGETS ${TESTNAME}TestExec
3837 DESTINATION "${SHELL_PRIVATE_LIBDIR}/tests/plugins/Dash"
3938 )
@@ -51,8 +50,7 @@ macro(add_dashview_try_test FILENAME TESTNAME)
5150 ${CMAKE_CURRENT_SOURCE_DIR}/../../../plugins/Dash/${FILENAME}.cpp
5251 ${CMAKE_CURRENT_SOURCE_DIR}/../../../plugins/Dash/abstractdashview.cpp
5352 )
54− qt5_use_modules(${TESTNAME}TestExec Test Core Qml)
55− target_link_libraries(${TESTNAME}TestExec ${Qt5Gui_LIBRARIES} ${Qt5Quick_LIBRARIES})
53+ target_link_libraries(${TESTNAME}TestExec Qt5::Test Qt5::Core Qt5::Qml ${Qt5Gui_LIBRARIES} ${Qt5Quick_LIBRARIES})
5654 install(TARGETS ${TESTNAME}TestExec
5755 DESTINATION "${SHELL_PRIVATE_LIBDIR}/tests/plugins/Dash"
5856 )
@@ -64,8 +62,7 @@ macro(add_dashview_try_test FILENAME TESTNAME)
6462 ${CMAKE_CURRENT_SOURCE_DIR}/../../../plugins/Dash/${FILENAME}.cpp
6563 ${CMAKE_CURRENT_SOURCE_DIR}/../../../plugins/Dash/abstractdashview.cpp
6664 )
67− qt5_use_modules(${TESTNAME}TryExec Test Core Qml)
68− target_link_libraries(${TESTNAME}TryExec ${Qt5Gui_LIBRARIES} ${Qt5Quick_LIBRARIES})
65+ target_link_libraries(${TESTNAME}TryExec Qt5::Test Qt5::Core Qt5::Qml ${Qt5Gui_LIBRARIES} ${Qt5Quick_LIBRARIES})
6966 install(TARGETS ${TESTNAME}TryExec
7067 DESTINATION "${SHELL_PRIVATE_LIBDIR}/tests/plugins/Dash"
7168 )
@@ -84,8 +81,7 @@ endforeach()
8481
8582# CardCreator test
8683add_executable(CardCreatorTestExec cardcreatortest.cpp)
87−qt5_use_modules(CardCreatorTestExec Test Core Qml)
88−target_link_libraries(CardCreatorTestExec ${Qt5Gui_LIBRARIES} ${Qt5Quick_LIBRARIES})
84+target_link_libraries(CardCreatorTestExec Qt5::Test Qt5::Core Qt5::Qml ${Qt5Gui_LIBRARIES} ${Qt5Quick_LIBRARIES})
8985install(TARGETS CardCreatorTestExec
9086 DESTINATION "${SHELL_PRIVATE_LIBDIR}/tests/plugins/Dash"
9187)
tests/plugins/GlobalShortcut/CMakeLists.txt+1−2
@@ -6,8 +6,7 @@ include_directories(
66add_definitions(-DTEST_DIR="plugins/GlobalShortcut")
77
88add_executable(GlobalShortcutTestExec GlobalShortcutTest.cpp ${CMAKE_SOURCE_DIR}/plugins/GlobalShortcut/globalshortcut.cpp)
9−qt5_use_modules(GlobalShortcutTestExec Test Quick)
10−target_link_libraries(GlobalShortcutTestExec ${Qt5Quick_LIBRARIES} GlobalShortcut-qml)
9+target_link_libraries(GlobalShortcutTestExec Qt5::Test Qt5::Quick ${Qt5Quick_LIBRARIES} GlobalShortcut-qml)
1110install(TARGETS GlobalShortcutTestExec
1211 DESTINATION "${SHELL_PRIVATE_LIBDIR}/tests/plugins/GlobalShortcut"
1312)
tests/plugins/Greeter/Unity/Launcher/CMakeLists.txt+1−1
@@ -26,9 +26,9 @@ add_executable(launchermodelastestExec
2626target_link_libraries(launchermodelastestExec
2727 unity8-private
2828 ${GSETTINGS_QT_LDFLAGS}
29+ Qt5::Test Qt5::Core Qt5::DBus Qt5::Gui Qt5::Qml
2930 )
3031add_dependencies(launchermodelastestExec mock-server)
31−qt5_use_modules(launchermodelastestExec Test Core DBus Gui Qml)
3232install(TARGETS launchermodelastestExec
3333 DESTINATION "${SHELL_PRIVATE_LIBDIR}/tests/plugins/Greeter/Unity/Launcher"
3434)
tests/plugins/ImageCache/CMakeLists.txt+1−1
@@ -14,7 +14,7 @@ remove_definitions(-DQT_NO_KEYWORDS)
1414add_executable(ImageCacheTestExec
1515 test.cpp
1616 )
17−qt5_use_modules(ImageCacheTestExec Core Quick Test)
17+target_link_libraries(ImageCacheTestExec Qt5::Core Qt5::Quick Qt5::Test)
1818add_unity8_uitest(ImageCache ImageCacheTestExec
1919 DEPENDS ImageCache-qml
2020 IMPORT_PATHS ${UNITY_PLUGINPATH}
tests/plugins/LightDM/IntegratedLightDM/CMakeLists.txt+6−6
@@ -12,8 +12,8 @@ add_executable(GreeterDBusTestExec
1212# This add_dependencies is needed since we're linking with with -L and -l below
1313# make seems to work but ninja breaks without it
1414add_dependencies(GreeterDBusTestExec MockLightDM)
15−qt5_use_modules(GreeterDBusTestExec Core DBus Quick Test)
1615target_link_libraries(GreeterDBusTestExec
16+ Qt5::Core Qt5::DBus Qt5::Quick Qt5::Test
1717 MockLightDM
1818 )
1919target_include_directories(GreeterDBusTestExec PUBLIC
@@ -36,8 +36,8 @@ add_executable(GreeterPamTestExec
3636 pam.cpp
3737 ${CMAKE_SOURCE_DIR}/plugins/LightDM/IntegratedLightDM/liblightdm/GreeterPrivate.cpp
3838 )
39−qt5_use_modules(GreeterPamTestExec Concurrent Core Test)
4039target_link_libraries(GreeterPamTestExec
40+ Qt5::Concurrent Qt5::Core Qt5::Test
4141 integratedLightDM
4242 )
4343
@@ -57,8 +57,8 @@ add_executable(GreeterSessionsModelTestExec
5757 ${CMAKE_SOURCE_DIR}/plugins/Utils/unitysortfilterproxymodelqml.cpp
5858 )
5959add_dependencies(GreeterSessionsModelTestExec MockLightDM)
60−qt5_use_modules(GreeterSessionsModelTestExec Core Test)
6160target_link_libraries(GreeterSessionsModelTestExec
61+ Qt5::Core Qt5::Test
6262 MockLightDM
6363 )
6464target_include_directories(GreeterSessionsModelTestExec PUBLIC
@@ -84,8 +84,8 @@ add_executable(GreeterUsersModelTestExec
8484# This add_dependencies is needed since we're linking with with -L and -l below
8585# make seems to work but ninja breaks without it
8686add_dependencies(GreeterUsersModelTestExec MockLightDM)
87−qt5_use_modules(GreeterUsersModelTestExec Core Test)
8887target_link_libraries(GreeterUsersModelTestExec
88+ Qt5::Core Qt5::Test
8989 MockLightDM
9090 )
9191target_include_directories(GreeterUsersModelTestExec PUBLIC
@@ -111,8 +111,8 @@ add_executable(GreeterPromptsModelTestExec
111111# This add_dependencies is needed since we're linking with with -L and -l below
112112# make seems to work but ninja breaks without it
113113add_dependencies(GreeterPromptsModelTestExec MockLightDM)
114−qt5_use_modules(GreeterPromptsModelTestExec Core Test)
115114target_link_libraries(GreeterPromptsModelTestExec
115+ Qt5::Core Qt5::Test
116116 MockLightDM
117117 )
118118target_include_directories(GreeterPromptsModelTestExec PUBLIC
@@ -131,8 +131,8 @@ add_unity8_uitest(GreeterPrompts GreeterPromptsModelTestExec
131131add_executable(GreeterIntegratedTestExec
132132 integrated.cpp
133133 )
134−qt5_use_modules(GreeterIntegratedTestExec Core DBus Quick Test)
135134target_link_libraries(GreeterIntegratedTestExec
135+ Qt5::Core Qt5::DBus Qt5::Quick Qt5::Test
136136 ${GLIB_LIBRARIES}
137137 integratedLightDMSession
138138 )
tests/plugins/SessionBroadcast/CMakeLists.txt+2−2
@@ -24,7 +24,7 @@ add_executable(MockBroadcastServer
2424 server.cpp
2525 BroadcastServer.cpp
2626)
27−qt5_use_modules(MockBroadcastServer Core DBus)
27+target_link_libraries(MockBroadcastServer Qt5::Core Qt5::DBus)
2828install(TARGETS MockBroadcastServer
2929 DESTINATION "${SHELL_PRIVATE_LIBDIR}/tests/plugins/SessionBroadcast"
3030)
@@ -34,7 +34,7 @@ add_executable(sessionbroadcasttestExec
3434 ${CMAKE_SOURCE_DIR}/plugins/SessionBroadcast/SessionBroadcast.cpp
3535 sessionbroadcasttest.cpp
3636)
37−qt5_use_modules(sessionbroadcasttestExec Test Core Qml DBus)
37+target_link_libraries(sessionbroadcasttestExec Qt5::Test Qt5::Core Qt5::Qml Qt5::DBus)
3838install(TARGETS sessionbroadcasttestExec
3939 DESTINATION "${SHELL_PRIVATE_LIBDIR}/tests/plugins/SessionBroadcast"
4040)
tests/plugins/Ubuntu/CMakeLists.txt+1−1
@@ -1 +1 @@
1−#add_subdirectory(Gestures) #FIXME broken with qt 5.9
1+add_subdirectory(Gestures)
tests/plugins/Ubuntu/Gestures/CMakeLists.txt+4−2
@@ -18,8 +18,10 @@ include_directories(
1818
1919macro(build_gesture_test CLASSNAME)
2020 add_executable(${CLASSNAME}TestExec tst_${CLASSNAME}.cpp GestureTest.cpp TestItem.cpp)
21− qt5_use_modules(${CLASSNAME}TestExec Test Core Qml Gui Quick)
22− target_link_libraries(${CLASSNAME}TestExec UbuntuGesturesQml ${UBUNTUGESTURES_LIBRARIES})
21+ target_link_libraries(${CLASSNAME}TestExec
22+ Qt5::Test Qt5::Core Qt5::Qml Qt5::Gui Qt5::Quick
23+ UbuntuGesturesQml ${UBUNTUGESTURES_LIBRARIES}
24+ )
2325 install(TARGETS ${CLASSNAME}TestExec
2426 DESTINATION "${SHELL_PRIVATE_LIBDIR}/tests/plugins/Ubuntu/Gestures"
2527 )
tests/plugins/Ubuntu/Gestures/GestureTest.cpp+10−1
@@ -17,6 +17,7 @@
1717#include "GestureTest.h"
1818
1919#include <qpa/qwindowsysteminterface.h>
20+#include <private/qquickanimatorcontroller_p.h>
2021#include <private/qquickwindow_p.h>
2122#include <QQmlEngine>
2223#include <QQuickView>
@@ -108,7 +109,15 @@ void GestureTest::sendTouch(qint64 timestamp, int id, QPointF pos,
108109 QCoreApplication::sendEvent(m_view, &touchEvent);
109110
110111 QQuickWindowPrivate *windowPrivate = QQuickWindowPrivate::get(m_view);
111− windowPrivate->flushDelayedTouchEvent();
112+ if (windowPrivate->delayedTouch) {
113+ windowPrivate->deliverDelayedTouchEvent();
114+
115+ // Touch events which constantly start animations (such as a behavior tracking
116+ // the mouse point) need animations to start.
117+ QQmlAnimationTimer *ut = QQmlAnimationTimer::instance();
118+ if (ut && ut->hasStartAnimationPending())
119+ ut->startAnimations();
120+ }
112121}
113122
114123void GestureTest::passTime(qint64 timeSpanMs)
tests/plugins/Ubuntu/Gestures/tst_TouchGate.cpp+10−1
@@ -19,6 +19,7 @@
1919#include <QQmlEngine>
2020#include <QQuickView>
2121#include <QSharedPointer>
22+#include <private/qquickanimatorcontroller_p.h>
2223#include <private/qquickwindow_p.h>
2324
2425// C++ std lib
@@ -191,7 +192,15 @@ void tst_TouchGate::holdsEventsUntilGainsOwnership()
191192 if (!ownershipAfterTouchEnd) {
192193 touchRegistry->removeCandidateOwnerForTouch(0, candidateItem);
193194 QQuickWindowPrivate *wp = QQuickWindowPrivate::get(testItem->window());
194− wp->flushDelayedTouchEvent();
195+ if (wp->delayedTouch) {
196+ wp->deliverDelayedTouchEvent();
197+
198+ // Touch events which constantly start animations (such as a behavior tracking
199+ // the mouse point) need animations to start.
200+ QQmlAnimationTimer *ut = QQmlAnimationTimer::instance();
201+ if (ut && ut->hasStartAnimationPending())
202+ ut->startAnimations();
203+ }
195204 // TouchGate should now open its flood gates and let testItem get all
196205 // events from touch 0 produced so far
197206 QCOMPARE(testItem->touchEventsReceived.count(), 2);
tests/plugins/Unity/Indicators/CMakeLists.txt+1−1
@@ -17,8 +17,8 @@ macro(indicator_test TEST)
1717 ${TEST}Test.cpp
1818 ${test_ADDITIONAL_CPPS}
1919 )
20− qt5_use_modules(${TEST}Exec Test Core Qml DBus)
2120 target_link_libraries(${TEST}Exec
21+ Qt5::Test Qt5::Core Qt5::Qml Qt5::DBus
2222 ${test_ADDITIONAL_LIBS}
2323 ${GLIB_LIBRARIES}
2424 ${GIO_LIBRARIES}
tests/plugins/Unity/Launcher/CMakeLists.txt+35−1
@@ -44,9 +44,9 @@ target_link_libraries(launchermodeltestExec
4444 ${GSETTINGS_QT_LDFLAGS}
4545 ${GLIB_LIBRARIES}
4646 ${UAL_LIBRARIES}
47+ Qt5::Test Qt5::Core Qt5::DBus Qt5::Xml Qt5::Gui Qt5::Qml
4748 )
4849add_dependencies(launchermodeltestExec mock-server)
49−qt5_use_modules(launchermodeltestExec Test Core DBus Xml Gui Qml)
5050install(TARGETS launchermodeltestExec
5151 DESTINATION "${SHELL_PRIVATE_LIBDIR}/tests/plugins/Unity/Launcher"
5252 )
@@ -61,6 +61,40 @@ add_unity8_unittest(LauncherModel dbus-test-runner
6161 --wait-for org.freedesktop.Accounts
6262)
6363
64+### AppDrawerModelTest
65+add_executable(appdrawermodeltestExec
66+ appdrawermodeltest.cpp
67+ ualwrapper.cpp
68+ ${CMAKE_SOURCE_DIR}/plugins/Unity/Launcher/appdrawermodel.cpp
69+ ${LAUNCHER_API_INCLUDEDIR}/unity/shell/launcher/AppDrawerModelInterface.h
70+ ${CMAKE_SOURCE_DIR}/plugins/Unity/Launcher/launcheritem.cpp
71+ ${CMAKE_SOURCE_DIR}/plugins/Unity/Launcher/quicklistmodel.cpp
72+ ${CMAKE_SOURCE_DIR}/plugins/Unity/Launcher/quicklistentry.cpp
73+ ${LAUNCHER_API_INCLUDEDIR}/unity/shell/launcher/LauncherItemInterface.h
74+ ${LAUNCHER_API_INCLUDEDIR}/unity/shell/launcher/QuickListModelInterface.h
75+ )
76+target_link_libraries(appdrawermodeltestExec
77+ unity8-private
78+ ${GSETTINGS_QT_LDFLAGS}
79+ ${GLIB_LIBRARIES}
80+ ${UAL_LIBRARIES}
81+ Qt5::Test Qt5::Core Qt5::DBus Qt5::Xml Qt5::Gui Qt5::Qml
82+ )
83+add_dependencies(appdrawermodeltestExec mock-server)
84+install(TARGETS appdrawermodeltestExec
85+ DESTINATION "${SHELL_PRIVATE_LIBDIR}/tests/plugins/Unity/Launcher"
86+ )
87+
88+add_unity8_unittest(AppDrawerModel dbus-test-runner
89+ ENVIRONMENT "APPDIR=${CMAKE_CURRENT_BINARY_DIR}/applications"
90+ ARG_PREFIX "--parameter"
91+ ARGS
92+ --task $<TARGET_FILE:mock-server>
93+ --ignore-return
94+ --task $<TARGET_FILE:appdrawermodeltestExec>
95+ --wait-for org.freedesktop.Accounts
96+)
97+
6498# copy sample application files into build directory for shadow builds
6599file(COPY applications
66100 DESTINATION ${CMAKE_CURRENT_BINARY_DIR}
tests/plugins/Unity/Launcher/appdrawermodeltest.cppnew file+53
@@ -0,0 +1,53 @@
1+/*
2+ * Copyright 2017 Canonical Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU Lesser General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+#include "ualwrapper.h"
18+#include "appdrawermodel.h"
19+
20+#include <QtTest>
21+
22+class AppDrawerModelTest : public QObject
23+{
24+ Q_OBJECT
25+
26+private:
27+ AppDrawerModel *appDrawerModel;
28+
29+private Q_SLOTS:
30+
31+ void initTestCase() {
32+ UalWrapper::s_list << QStringLiteral("app1") << QStringLiteral("app2");
33+ appDrawerModel = new AppDrawerModel(this);
34+ QCOMPARE(appDrawerModel->rowCount(QModelIndex()), 2);
35+ }
36+
37+ void testUalAppAddedRemoved() {
38+ QCOMPARE(appDrawerModel->rowCount(QModelIndex()), 2);
39+
40+ UalWrapper::instance()->addMockApp("app3");
41+ qApp->processEvents(); // ualwrapper is connected Queued
42+
43+ QCOMPARE(appDrawerModel->rowCount(QModelIndex()), 3);
44+
45+ UalWrapper::instance()->removeMockApp("app3");
46+ qApp->processEvents();
47+
48+ QCOMPARE(appDrawerModel->rowCount(QModelIndex()), 2);
49+ }
50+};
51+
52+QTEST_GUILESS_MAIN(AppDrawerModelTest)
53+#include "appdrawermodeltest.moc"
tests/plugins/Unity/Launcher/ualwrapper.cppnew file+60
@@ -0,0 +1,60 @@
1+/*
2+ * Copyright (C) 2017 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 "ualwrapper.h"
18+#include <QDebug>
19+
20+UalWrapper* UalWrapper::s_instance = nullptr;
21+QStringList UalWrapper::s_list;
22+
23+UalWrapper::UalWrapper(QObject *parent): QObject(parent)
24+{
25+ s_instance = this;
26+}
27+
28+UalWrapper* UalWrapper::instance()
29+{
30+ return s_instance;
31+}
32+
33+QStringList UalWrapper::installedApps()
34+{
35+ return s_list;
36+}
37+
38+UalWrapper::AppInfo UalWrapper::getApplicationInfo(const QString &appId)
39+{
40+ AppInfo info;
41+ info.appId = appId;
42+ info.name = "App_" + appId;
43+ info.icon = "/dummy/icon/path/" + appId + ".png";
44+ info.keywords << QStringLiteral("keyword1") << QStringLiteral("keyword2");
45+ info.popularity = 1;
46+ info.valid = true;
47+ return info;
48+}
49+
50+void UalWrapper::addMockApp(const QString &appId)
51+{
52+ s_list.append(appId);
53+ Q_EMIT appAdded(appId);
54+}
55+
56+void UalWrapper::removeMockApp(const QString &appId)
57+{
58+ s_list.removeAll(appId);
59+ Q_EMIT appRemoved(appId);
60+}
tests/plugins/Unity/Launcher/ualwrapper.hnew file+55
@@ -0,0 +1,55 @@
1+/*
2+ * Copyright (C) 2017 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 <QObject>
18+
19+// This is a mock implementation
20+
21+class UalWrapper: public QObject
22+{
23+ Q_OBJECT
24+public:
25+ struct AppInfo {
26+ QString appId;
27+ bool valid = false;
28+ QString name;
29+ QString icon;
30+ QStringList keywords;
31+ uint popularity = 0;
32+ };
33+
34+ UalWrapper(QObject* parent = nullptr);
35+
36+ static QStringList installedApps();
37+ static AppInfo getApplicationInfo(const QString &appId);
38+
39+ // for testing:
40+ static UalWrapper* instance();
41+ void addMockApp(const QString &appId);
42+ void removeMockApp(const QString &appId);
43+
44+Q_SIGNALS:
45+ void appAdded(const QString &appId);
46+ void appRemoved(const QString &appId);
47+ void appInfoChanged(const QString &appId);
48+
49+
50+private:
51+ static QStringList s_list;
52+ static UalWrapper *s_instance;
53+
54+ friend class AppDrawerModelTest;
55+};
tests/plugins/Unity/Session/CMakeLists.txt+3−2
@@ -28,7 +28,7 @@ add_executable(LightDMServer
2828 LogindServer.cpp
2929 server.cpp
3030)
31−qt5_use_modules(LightDMServer Core DBus)
31+target_link_libraries(LightDMServer Qt5::Core Qt5::DBus)
3232install(TARGETS LightDMServer
3333 DESTINATION "${SHELL_PRIVATE_LIBDIR}/tests/plugins/Unity/Session"
3434 )
@@ -53,13 +53,14 @@ target_link_libraries(sessionbackendtestExec
5353 unity8-private
5454 ${GLIB_LIBRARIES}
5555 )
56−qt5_use_modules(sessionbackendtestExec Test Core Qml DBus)
56+target_link_libraries(sessionbackendtestExec Qt5::Test Qt5::Core Qt5::Qml Qt5::DBus)
5757install(TARGETS sessionbackendtestExec
5858 DESTINATION "${SHELL_PRIVATE_LIBDIR}/tests/plugins/Unity/Session"
5959)
6060
6161add_unity8_unittest(SessionBackend dbus-test-runner
6262 ENVIRONMENT LD_PRELOAD=$<TARGET_FILE:SessionBackendTestPreload>
63+ XDG_SESSION_ID=testing
6364 XDG_SESSION_PATH=/session
6465 ARG_PREFIX "--parameter"
6566 ARGS
tests/plugins/Unity/Session/LogindServer.cpp−5
@@ -22,11 +22,6 @@ LogindServer::LogindServer(QObject *parent)
2222{
2323}
2424
25−QDBusObjectPath LogindServer::GetSessionByPID(quint32)
26−{
27− return QDBusObjectPath("/logindsession");
28−}
29−
3025void LogindServer::Reboot(bool interactive)
3126{
3227 Q_EMIT RebootCalled(interactive);
tests/plugins/Unity/Session/LogindServer.h−1
@@ -30,7 +30,6 @@ public:
3030 explicit LogindServer(QObject *parent = nullptr);
3131
3232public Q_SLOTS:
33− QDBusObjectPath GetSessionByPID(quint32 pid);
3433 void Reboot(bool interactive);
3534 void PowerOff(bool interactive);
3635
tests/plugins/Unity/Session/interfaces.xml−4
@@ -3,10 +3,6 @@
33 <method name="Lock" />
44 </interface>
55 <interface name="org.freedesktop.login1.Manager">
6− <method name="GetSessionByPID">
7− <arg name="pid" type="u" direction="in" />
8− <arg name="session" type="o" direction="out" />
9− </method>
106 <method name="Reboot">
117 <arg name="interactive" type="b" direction="in" />
128 </method>
tests/plugins/Unity/Session/server.cpp+1−1
@@ -37,7 +37,7 @@ int main(int argc, char *argv[])
3737 auto connection = QDBusConnection::sessionBus();
3838 if (!connection.registerObject("/org/freedesktop/login1", logind))
3939 return 1;
40− if (!connection.registerObject("/logindsession", logind))
40+ if (!connection.registerObject("/org/freedesktop/login1/session/testing", logind))
4141 return 1;
4242 if (!connection.registerService("org.freedesktop.login1"))
4343 return 1;
tests/plugins/Unity/Session/sessionbackendtest.cpp+5−3
@@ -103,8 +103,8 @@ private Q_SLOTS:
103103 QCoreApplication::processEvents(); // to let the services register on DBus
104104
105105 QDBusInterface login1Interface("org.freedesktop.login1",
106− "/logindsession",
107− "org.freedesktop.login1.Manager");
106+ "/org/freedesktop/login1/session/testing",
107+ "org.freedesktop.login1.Manager");
108108 QSignalSpy spy(&login1Interface, signal.toUtf8().data());
109109
110110 QDBusInterface dbusGnomeSessionWrapper("org.gnome.SessionManager",
@@ -225,7 +225,9 @@ private Q_SLOTS:
225225 DBusUnitySessionService dbusUnitySessionService;
226226 QCoreApplication::processEvents(); // to let the service register on DBus
227227
228− QDBusInterface iface("org.freedesktop.login1", "/logindsession", "org.freedesktop.login1.Session");
228+ QDBusInterface iface("org.freedesktop.login1",
229+ "/org/freedesktop/login1/session/testing",
230+ "org.freedesktop.login1.Session");
229231 QVERIFY(iface.isValid());
230232
231233 QSignalSpy spy(&dbusUnitySessionService, SIGNAL(Unlocked()));
tests/plugins/Utils/CMakeLists.txt+2−4
@@ -16,8 +16,7 @@ foreach(util_test
1616 WindowStateStorage
1717)
1818 add_executable(${util_test}TestExec ${util_test}Test.cpp ModelTest.cpp)
19− qt5_use_modules(${util_test}TestExec Test Core Qml)
20− target_link_libraries(${util_test}TestExec Utils-qml)
19+ target_link_libraries(${util_test}TestExec Qt5::Test Qt5::Core Qt5::Qml Utils-qml)
2120 install(TARGETS ${util_test}TestExec
2221 DESTINATION "${SHELL_PRIVATE_LIBDIR}/tests/plugins/Utils"
2322 )
@@ -32,8 +31,7 @@ add_unity8_qmlunittest(. UtilsStyle)
3231
3332# URLDispatcher test needs dbus-test-runner because it claims a dbus name
3433add_executable(URLDispatcherTestExec URLDispatcherTest.cpp)
35−qt5_use_modules(URLDispatcherTestExec Test Core Qml)
36−target_link_libraries(URLDispatcherTestExec Utils-qml)
34+target_link_libraries(URLDispatcherTestExec Qt5::Test Qt5::Core Qt5::Qml Utils-qml)
3735install(TARGETS URLDispatcherTestExec
3836 DESTINATION "${SHELL_PRIVATE_LIBDIR}/tests/plugins/Utils"
3937)
tests/plugins/WindowManager/CMakeLists.txt+4−2
@@ -17,9 +17,11 @@ add_executable(TopLevelWindowModelTestExec
1717 ${APPLICATION_API_INCLUDEDIR}/unity/shell/application/MirSurfaceListInterface.h
1818 ${APPLICATION_API_INCLUDEDIR}/unity/shell/application/SurfaceManagerInterface.h
1919 )
20−qt5_use_modules(TopLevelWindowModelTestExec Test Core Gui Qml Quick)
2120
22−target_link_libraries(TopLevelWindowModelTestExec windowmanager-qml)
21+target_link_libraries(TopLevelWindowModelTestExec
22+ Qt5::Test Qt5::Core Qt5::Gui Qt5::Qml Qt5::Quick
23+ windowmanager-qml
24+)
2325
2426install(TARGETS TopLevelWindowModelTestExec
2527 DESTINATION "${SHELL_PRIVATE_LIBDIR}/tests/plugins/WindowManager"
tests/plugins/Wizard/CMakeLists.txt+2−2
@@ -7,7 +7,7 @@ add_executable(tst-wizard-pagelist
77 tst_pagelist.cpp
88 ${CMAKE_SOURCE_DIR}/plugins/Wizard/PageList.cpp
99)
10−qt5_use_modules(tst-wizard-pagelist Core Qml Test)
10+target_link_libraries(tst-wizard-pagelist Qt5::Core Qt5::Qml Qt5::Test)
1111install(TARGETS tst-wizard-pagelist
1212 DESTINATION "${SHELL_PRIVATE_LIBDIR}/tests/plugins/Wizard"
1313)
@@ -17,7 +17,7 @@ add_executable(tst-wizard-system
1717 tst_system.cpp
1818 ${CMAKE_SOURCE_DIR}/plugins/Wizard/System.cpp
1919)
20−qt5_use_modules(tst-wizard-system Core DBus Qml Test)
20+target_link_libraries(tst-wizard-system Qt5::Core Qt5::DBus Qt5::Qml Qt5::Test)
2121install(TARGETS tst-wizard-system
2222 DESTINATION "${SHELL_PRIVATE_LIBDIR}/tests/plugins/Wizard"
2323)
tests/qmltests/CMakeLists.txt+1−1
@@ -1,5 +1,5 @@
11
2−#add_subdirectory(Components) #FIXME broken with qt 5.9
2+add_subdirectory(Components)
33
44add_unity8_qmltest(. OrientedShell)
55add_unity8_qmltest(. DisabledScreenNotice)
tests/qmltests/Components/CMakeLists.txt+8−4
@@ -18,8 +18,10 @@ include_directories(
1818 )
1919
2020add_executable(DragHandleTestExec tst_DragHandle.cpp)
21−qt5_use_modules(DragHandleTestExec Test Core Qml Gui Quick)
22−target_link_libraries(DragHandleTestExec UbuntuGesturesQml ${UBUNTUGESTURES_LIBRARIES})
21+target_link_libraries(DragHandleTestExec
22+ Qt5::Test Qt5::Core Qt5::Qml Qt5::Gui Qt5::Quick
23+ UbuntuGesturesQml ${UBUNTUGESTURES_LIBRARIES}
24+ )
2325install(TARGETS DragHandleTestExec
2426 DESTINATION "${SHELL_PRIVATE_LIBDIR}/tests/qmltests/Components"
2527 )
@@ -34,8 +36,10 @@ add_unity8_qmltest_data(. tst_DragHandle)
3436
3537########## tst_EdgeDragEvaluator
3638add_executable(EdgeDragEvaluatorTestExec tst_EdgeDragEvaluator.cpp)
37−qt5_use_modules(EdgeDragEvaluatorTestExec Test Core Qml Gui Quick)
38−target_link_libraries(EdgeDragEvaluatorTestExec UbuntuGesturesQml ${UBUNTUGESTURES_LIBRARIES})
39+target_link_libraries(EdgeDragEvaluatorTestExec
40+ Qt5::Test Qt5::Core Qt5::Qml Qt5::Gui Qt5::Quick
41+ UbuntuGesturesQml ${UBUNTUGESTURES_LIBRARIES}
42+ )
3943install(TARGETS EdgeDragEvaluatorTestExec
4044 DESTINATION "${SHELL_PRIVATE_LIBDIR}/tests/qmltests/Components"
4145 )
tests/qmltests/Components/tst_DragHandle.cpp+19−2
@@ -20,6 +20,7 @@
2020#include <qpa/qwindowsysteminterface.h>
2121#include <QtQuick/QQuickView>
2222#include <QtQml/QQmlEngine>
23+#include <private/qquickanimatorcontroller_p.h>
2324#include <private/qquickwindow_p.h>
2425#include <UbuntuGestures/private/ucswipearea_p_p.h>
2526
@@ -179,7 +180,15 @@ void tst_DragHandle::flickAndHold(QQuickItem *dragHandle,
179180 QTest::touchEvent(m_view, m_device).release(0, touchPoint.toPoint());
180181
181182 QQuickWindowPrivate *windowPrivate = QQuickWindowPrivate::get(m_view);
182− windowPrivate->flushDelayedTouchEvent();
183+ if (windowPrivate->delayedTouch) {
184+ windowPrivate->deliverDelayedTouchEvent();
185+
186+ // Touch events which constantly start animations (such as a behavior tracking
187+ // the mouse point) need animations to start.
188+ QQmlAnimationTimer *ut = QQmlAnimationTimer::instance();
189+ if (ut && ut->hasStartAnimationPending())
190+ ut->startAnimations();
191+ }
183192}
184193
185194void tst_DragHandle::drag(QPointF &touchPoint, const QPointF& direction, qreal distance,
@@ -194,7 +203,15 @@ void tst_DragHandle::drag(QPointF &touchPoint, const QPointF& direction, qreal d
194203 m_fakeTimeSource->m_msecsSinceReference += timeStep;
195204 QTest::touchEvent(m_view, m_device).move(0, touchPoint.toPoint());
196205
197− windowPrivate->flushDelayedTouchEvent();
206+ if (windowPrivate->delayedTouch) {
207+ windowPrivate->deliverDelayedTouchEvent();
208+
209+ // Touch events which constantly start animations (such as a behavior tracking
210+ // the mouse point) need animations to start.
211+ QQmlAnimationTimer *ut = QQmlAnimationTimer::instance();
212+ if (ut && ut->hasStartAnimationPending())
213+ ut->startAnimations();
214+ }
198215 }
199216}
200217
tests/uqmlscene/CMakeLists.txt+1−1
@@ -4,7 +4,6 @@ add_executable(uqmlscene
44 ${CMAKE_SOURCE_DIR}/src/DebuggingController.cpp
55 )
66
7−qt5_use_modules(uqmlscene Qml Quick Test DBus)
87pkg_check_modules(XCB REQUIRED xcb)
98
109include_directories(
@@ -25,6 +24,7 @@ if (NOT "${XCB_INCLUDE_DIRS}" STREQUAL "")
2524endif()
2625
2726target_link_libraries(uqmlscene
27+ Qt5::Qml Qt5::Quick Qt5::Test Qt5::DBus
2828 ${Qt5Qml_LIBRARIES}
2929 ${Qt5Quick_LIBRARIES}
3030 ${XCB_LDFLAGS}
tests/utils/CMakeLists.txt+1−1
@@ -1 +1 @@
1−#add_subdirectory(modules) #FIXME broken with qt 5.9
1+add_subdirectory(modules)
tests/utils/modules/Unity/Test/CMakeLists.txt+2−4
@@ -1,4 +1,4 @@
1−include(QmlPlugins)
1+find_package(QmlPlugins)
22
33add_definitions(-DQT_NO_KEYWORDS)
44
@@ -27,7 +27,7 @@ if (ENABLE_TOUCH_EMULATION)
2727endif()
2828
2929add_library(UnityTestQml MODULE ${UnityTestQML_SOURCES})
30−target_link_libraries(UnityTestQml ${UBUNTUGESTURES_LIBRARIES})
30+target_link_libraries(UnityTestQml ${UBUNTUGESTURES_LIBRARIES} Qt5::Core Qt5::Quick Qt5::Test)
3131
3232if (ENABLE_TOUCH_EMULATION)
3333 target_link_libraries(UnityTestQml ${MOUSETOUCHADAPTOR_LIBS_LDFLAGS})
@@ -36,6 +36,4 @@ endif()
3636# To find libUbuntuGestures.so
3737set_target_properties(UnityTestQml PROPERTIES INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${SHELL_PRIVATE_LIBDIR}")
3838
39−qt5_use_modules(UnityTestQml Core Quick Test)
40−
4139add_unity8_mock(Unity.Test 0.1 Unity/Test PREFIX utils TARGETS UnityTestQml)
tests/utils/modules/Unity/Test/TouchEventSequenceWrapper.cpp+10−1
@@ -15,6 +15,7 @@
1515 */
1616
1717#include "TouchEventSequenceWrapper.h"
18+#include <private/qquickanimatorcontroller_p.h>
1819#include <private/qquickwindow_p.h>
1920
2021TouchEventSequenceWrapper::TouchEventSequenceWrapper(QTest::QTouchEventSequence eventSequence, QQuickItem *item)
@@ -34,7 +35,15 @@ void TouchEventSequenceWrapper::commit(bool processEvents)
3435
3536 if (window) {
3637 QQuickWindowPrivate *wp = QQuickWindowPrivate::get(window);
37− wp->flushDelayedTouchEvent();
38+ if (wp->delayedTouch) {
39+ wp->deliverDelayedTouchEvent();
40+
41+ // Touch events which constantly start animations (such as a behavior tracking
42+ // the mouse point) need animations to start.
43+ QQmlAnimationTimer *ut = QQmlAnimationTimer::instance();
44+ if (ut && ut->hasStartAnimationPending())
45+ ut->startAnimations();
46+ }
3847 }
3948}
4049
tools/indicatorsclient/CMakeLists.txt+1−1
@@ -13,7 +13,7 @@ add_executable(${INDICATORS_CLIENT_APP}
1313 ${INDICATORS_CLIENT_HEADERS}
1414)
1515
16−qt5_use_modules(${INDICATORS_CLIENT_APP} Core Widgets Quick)
16+target_link_libraries(${INDICATORS_CLIENT_APP} Qt5::Core Qt5::Widgets Qt5::Quick)
1717
1818install(TARGETS ${INDICATORS_CLIENT_APP}
1919 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
tools/menutool/CMakeLists.txt+1−1
@@ -2,4 +2,4 @@ add_executable(menutool
22 menutool.cpp
33 )
44
5−qt5_use_modules(menutool Qml Quick)
5+target_link_libraries(menutool Qt5::Qml Qt5::Quick)
tools/scopetool/CMakeLists.txt+1−1
@@ -4,7 +4,7 @@ add_executable(${SCOPE_TOOL}
44 ../../src/UnixSignalHandler.cpp
55 )
66
7−qt5_use_modules(${SCOPE_TOOL} Qml Quick)
7+target_link_libraries(${SCOPE_TOOL} Qt5::Qml Qt5::Quick)
88
99# install binaries
1010install(TARGETS ${SCOPE_TOOL}