on dfa06a3 help sign in
CMakeLists.txt+5−2
since splitsnapshots
unifiedsplit
@@ -70,15 +70,18 @@ find_package(Qt5DBus 5.6 REQUIRED)
70find_package(Qt5Concurrent 5.6 REQUIRED)
70find_package(Qt5Concurrent 5.6 REQUIRED)
71find_package(Qt5Sql 5.6 REQUIRED)
71find_package(Qt5Sql 5.6 REQUIRED)
72find_package(Qt5Test 5.6 REQUIRED)
72find_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)
73
76
74pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=27)
77pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=27)
75pkg_check_modules(GEONAMES REQUIRED geonames>=0.2)
78pkg_check_modules(GEONAMES REQUIRED geonames>=0.2)
76pkg_check_modules(GIO REQUIRED gio-2.0>=2.32)
79pkg_check_modules(GIO REQUIRED gio-2.0>=2.32)
77pkg_check_modules(GLIB REQUIRED glib-2.0>=2.32)
80pkg_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)
79pkg_check_modules(QMENUMODEL REQUIRED qmenumodel)
82pkg_check_modules(QMENUMODEL REQUIRED qmenumodel)
80pkg_check_modules(GD3 REQUIRED gnome-desktop-3.0)
83pkg_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)
82pkg_check_modules(UBUNTUGESTURES REQUIRED UbuntuGestures)
85pkg_check_modules(UBUNTUGESTURES REQUIRED UbuntuGestures)
83pkg_check_modules(QTDBUSTEST REQUIRED
86pkg_check_modules(QTDBUSTEST REQUIRED
84 libqtdbustest-1
87 libqtdbustest-1
Jenkinsfile+4−1
@@ -28,7 +28,7 @@ build-binary.sh'''
28 cleanWs(cleanWhenAborted: true, cleanWhenFailure: true, cleanWhenNotBuilt: true, cleanWhenSuccess: true, cleanWhenUnstable: true, deleteDirs: true)
28 cleanWs(cleanWhenAborted: true, cleanWhenFailure: true, cleanWhenNotBuilt: true, cleanWhenSuccess: true, cleanWhenUnstable: true, deleteDirs: true)
29 unstash 'source'
29 unstash 'source'
30 sh '''export architecture="arm64"
30 sh '''export architecture="arm64"
31− build-binary.sh'''
31+ # build-binary.sh'''
32 stash(includes: '*.gz,*.bz2,*.xz,*.deb,*.dsc,*.changes,*.buildinfo,lintian.txt', name: 'build-arm64')
32 stash(includes: '*.gz,*.bz2,*.xz,*.deb,*.dsc,*.changes,*.buildinfo,lintian.txt', name: 'build-arm64')
33 cleanWs(cleanWhenAborted: true, cleanWhenFailure: true, cleanWhenNotBuilt: true, cleanWhenSuccess: true, cleanWhenUnstable: true, deleteDirs: true)
33 cleanWs(cleanWhenAborted: true, cleanWhenFailure: true, cleanWhenNotBuilt: true, cleanWhenSuccess: true, cleanWhenUnstable: true, deleteDirs: true)
34 }
34 }
@@ -38,6 +38,9 @@ build-binary.sh'''
38 cleanWs(cleanWhenAborted: true, cleanWhenFailure: true, cleanWhenNotBuilt: true, cleanWhenSuccess: true, cleanWhenUnstable: true, deleteDirs: true)
38 cleanWs(cleanWhenAborted: true, cleanWhenFailure: true, cleanWhenNotBuilt: true, cleanWhenSuccess: true, cleanWhenUnstable: true, deleteDirs: true)
39 unstash 'source'
39 unstash 'source'
40 sh '''export architecture="amd64"
40 sh '''export architecture="amd64"
41+ export DEBBUILDOPTS=-sa
42+export SKIP_ARCH_BUILD=false
43+export SKIP_SOURCE_REMOVAL=true
41 build-binary.sh'''
44 build-binary.sh'''
42 stash(includes: '*.gz,*.bz2,*.xz,*.deb,*.dsc,*.changes,*.buildinfo,lintian.txt', name: 'build-amd64')
45 stash(includes: '*.gz,*.bz2,*.xz,*.deb,*.dsc,*.changes,*.buildinfo,lintian.txt', name: 'build-amd64')
43 cleanWs(cleanWhenAborted: true, cleanWhenFailure: true, cleanWhenNotBuilt: true, cleanWhenSuccess: true, cleanWhenUnstable: true, deleteDirs: true)
46 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()
20{
20{
21 trap - TERM EXIT
21 trap - TERM EXIT
22 # Kill upstart and indicators
22 # Kill upstart and indicators
23− if [ -n "$INIT_PID" ]; then
23+ if [ -n "$IND_PID" ]; then
24− kill "$INIT_PID"
24+ kill "$IND_PID"
25 fi
25 fi
26 if [ -n "$CMD_PID" ]; then
26 if [ -n "$CMD_PID" ]; then
27 kill "$CMD_PID"
27 kill "$CMD_PID"
@@ -32,10 +32,7 @@ cleanup()
32set_greeter_var()
32set_greeter_var()
33{
33{
34 export "$1=$2"
34 export "$1=$2"
35− gdbus call --session --dest org.freedesktop.DBus --object-path /org/freedesktop/DBus --method org.freedesktop.DBus.UpdateActivationEnvironment "{'$1': '$2'}"
35+ dbus-update-activation-environment --systemd "$1=$2"
36− if [ -n "$INIT_PID" ]; then
37− initctl set-env --global "$1=$2"
38− fi
39}
36}
40
37
41SUB_SOCKET=$XDG_RUNTIME_DIR/mir_socket
38SUB_SOCKET=$XDG_RUNTIME_DIR/mir_socket
@@ -61,25 +58,12 @@ set_greeter_var QT_QPA_PLATFORM ubuntumirclient
61# eventually need the greeter to play ringtones for users that aren't logged in.
58# eventually need the greeter to play ringtones for users that aren't logged in.
62set_greeter_var PA_DISABLED 1
59set_greeter_var PA_DISABLED 1
63
60
64−# Normal unity8 sessions are entirely driven by Upstart. But greeters
61+# Start the indicators
65−# are special. They need access to the file descriptors that lightdm
62+/usr/lib/gnome-session/run-systemd-session indicators.target &
66−# creates for them and don't want to start all the services that a normal
63+IND_PID=$!
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
80
64
81# Start any pre-greeter tasks if needed (like wizard)
65# Start any pre-greeter tasks if needed (like wizard)
82−initctl emit unity8-greeter-starting
66+#initctl emit unity8-greeter-starting FIXME
83
67
84# Define language here for phone if available. When phone user switches their
68# Define language here for phone if available. When phone user switches their
85# language, they expect that to affect the greeter too. But the user doesn't
69# 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+
71+QT_QPA_PLATFORM=${UNITY8_SHELL_QT_QPA_PLATFORM} ${BINARY:-unity8} --mode=$MODE "$@" &
72+child=$!
73+
74+# Wait for SIGSTOP in child
75+while [ $(ps --no-headers -o state $child) != "T" ]; do
76+ sleep 0.1
77+done
78+
79+kill -CONT $child
80+exit 0
81+
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
2
2
3 * Imported to UBports
3 * Imported to UBports
4
4
debian/control+14−9
@@ -3,9 +3,11 @@ Section: x11
3Priority: optional
3Priority: optional
4Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
4Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
5Build-Depends: cmake,
5Build-Depends: cmake,
6+ cmake-extras,
6 dbus-test-runner,
7 dbus-test-runner,
7 debhelper (>= 9),
8 debhelper (>= 9),
8 dh-apparmor,
9 dh-apparmor,
10+ dh-systemd,
9 doxyqml,
11 doxyqml,
10# To allow cross-compiling to work, we also must append :native
12# To allow cross-compiling to work, we also must append :native
11# to g++ so we don't try to run arm g++
13# to g++ so we don't try to run arm g++
@@ -34,13 +36,13 @@ Build-Depends: cmake,
34 libqt5svg5-dev,
36 libqt5svg5-dev,
35 libqt5xmlpatterns5-dev,
37 libqt5xmlpatterns5-dev,
36 libsystemsettings-dev,
38 libsystemsettings-dev,
37− libubuntu-app-launch2-dev,
39+ libubuntu-app-launch3-dev,
38 libubuntu-download-manager-common-dev,
40 libubuntu-download-manager-common-dev,
39 libubuntugestures5-dev (>= 1.3.2030),
41 libubuntugestures5-dev (>= 1.3.2030),
40 libubuntugestures5-private-dev (>= 1.3.2030),
42 libubuntugestures5-private-dev (>= 1.3.2030),
41 libudev-dev,
43 libudev-dev,
42 libudm-common-dev,
44 libudm-common-dev,
43− libunity-api-dev (>= 8.6),
45+ libunity-api-dev (>= 8.7),
44 libusermetricsoutput1-dev,
46 libusermetricsoutput1-dev,
45# Need those X11 libs touch emulation from mouse events in manual QML tests on a X11 desktop
47# Need those X11 libs touch emulation from mouse events in manual QML tests on a X11 desktop
46 libx11-dev[!arm64 !armhf],
48 libx11-dev[!arm64 !armhf],
@@ -61,7 +63,7 @@ Build-Depends: cmake,
61 qml-module-qtsysteminfo,
63 qml-module-qtsysteminfo,
62 qml-module-qttest,
64 qml-module-qttest,
63 qml-module-ubuntu-components (>= 1.3.2030) | qml-module-ubuntu-components-gles (>= 1.3.2030),
65 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,
65 qt5-default,
67 qt5-default,
66 qtbase5-dev (>= 5.6),
68 qtbase5-dev (>= 5.6),
67 qtbase5-dev-tools,
69 qtbase5-dev-tools,
@@ -71,6 +73,7 @@ Build-Depends: cmake,
71 qtdeclarative5-private-dev (>= 5.6),
73 qtdeclarative5-private-dev (>= 5.6),
72 qtdeclarative5-ubuntu-content1,
74 qtdeclarative5-ubuntu-content1,
73 qtdeclarative5-ubuntu-settings-components (>= 0.11),
75 qtdeclarative5-ubuntu-settings-components (>= 0.11),
76+ systemd,
74 ttf-ubuntu-font-family,
77 ttf-ubuntu-font-family,
75 xvfb,
78 xvfb,
76Standards-Version: 3.9.4
79Standards-Version: 3.9.4
@@ -120,7 +123,8 @@ Description: Development tool for Unity scopes
120Package: unity8
123Package: unity8
121Architecture: any
124Architecture: any
122Provides: indicator-renderer,
125Provides: indicator-renderer,
126+Depends: dbus,
123−Depends: dmz-cursor-theme,
127+ dmz-cursor-theme,
124 gsettings-desktop-schemas,
128 gsettings-desktop-schemas,
125 libcap2-bin,
129 libcap2-bin,
126 libglib2.0-bin,
130 libglib2.0-bin,
@@ -131,11 +135,12 @@ Depends: dmz-cursor-theme,
131 qml-module-qtqml-statemachine,
135 qml-module-qtqml-statemachine,
132 qml-module-qtquick-xmllistmodel,
136 qml-module-qtquick-xmllistmodel,
133 qml-module-qtsysteminfo,
137 qml-module-qtsysteminfo,
134− qml-module-ubuntu-web,
138+# qml-module-ubuntu-web,
135 qtdeclarative5-qtmir-plugin (>= 0.4.8),
139 qtdeclarative5-qtmir-plugin (>= 0.4.8),
136 qtdeclarative5-ubuntu-telephony0.1,
140 qtdeclarative5-ubuntu-telephony0.1,
141+ qtwayland5,
137 ubuntu-system-settings (>= 0.4),
142 ubuntu-system-settings (>= 0.4),
138− unity-launcher-impl-12,
143+ unity-launcher-impl-13,
139 unity8-common (= ${source:Version}),
144 unity8-common (= ${source:Version}),
140 unity8-private (= ${binary:Version}),
145 unity8-private (= ${binary:Version}),
141 unity8-private | unity-launcher-impl,
146 unity8-private | unity-launcher-impl,
@@ -167,8 +172,8 @@ Depends: qml-module-qtquick-layouts,
167 ubuntu-wallpapers,
172 ubuntu-wallpapers,
168 unity-application-impl-27,
173 unity-application-impl-27,
169 unity-notifications-impl-3,
174 unity-notifications-impl-3,
170− unity-plugin-scopes | unity-scopes-impl,
175+# unity-plugin-scopes | unity-scopes-impl,
171− unity-scopes-impl-12,
176+# unity-scopes-impl-12,
172 unity8-tests | unity-application-impl,
177 unity8-tests | unity-application-impl,
173 ${misc:Depends},
178 ${misc:Depends},
174Breaks: unity8 (<< 7.86),
179Breaks: unity8 (<< 7.86),
@@ -239,7 +244,7 @@ Depends: accountsservice-ubuntu-schemas (>= 0.0.7),
239 ${misc:Depends},
244 ${misc:Depends},
240 ${shlibs:Depends},
245 ${shlibs:Depends},
241Provides: unity-launcher-impl,
246Provides: unity-launcher-impl,
242− unity-launcher-impl-12,
247+ unity-launcher-impl-13,
243Description: Unity 8 private libs
248Description: Unity 8 private libs
244 The Unity 8 shell is the primary user interface for Ubuntu devices.
249 The Unity 8 shell is the primary user interface for Ubuntu devices.
245 .
250 .
debian/rules+2−2
@@ -9,7 +9,7 @@ export DPKG_GENSYMBOLS_CHECK_LEVEL=4
9export NO_PNG_PKG_MANGLE=1
9export NO_PNG_PKG_MANGLE=1
10
10
11%:
11%:
12− dh $@ --parallel --fail-missing --with python3
12+ dh $@ --parallel --fail-missing --with python3,systemd
13
13
14override_dh_auto_configure:
14override_dh_auto_configure:
15 # Debian defines CMAKE_INSTALL_LOCALSTATEDIR as /usr/var, which is wrong.
15 # Debian defines CMAKE_INSTALL_LOCALSTATEDIR as /usr/var, which is wrong.
@@ -30,7 +30,7 @@ override_dh_install:
30 dh_install -X'*.pyc' --fail-missing
30 dh_install -X'*.pyc' --fail-missing
31
31
32override_dh_installdeb:
32override_dh_installdeb:
33− dh_apparmor --profile-name=usr.bin.unity8-dash -punity8-dash
33+ #dh_apparmor --profile-name=usr.bin.unity8-dash -punity8-dash
34 dh_installdeb
34 dh_installdeb
35
35
36# use private lib directories
36# use private lib directories
debian/unity8-tests.install+1
@@ -3,6 +3,7 @@ usr/bin/unity-mock-indicator-service
3usr/lib/*/unity8/qml/mocks
3usr/lib/*/unity8/qml/mocks
4usr/lib/*/unity8/qml/nonmirplugins
4usr/lib/*/unity8/qml/nonmirplugins
5usr/lib/*/unity8/qml/scopefakes
5usr/lib/*/unity8/qml/scopefakes
6+usr/lib/*/unity8/qml/utils
6usr/lib/*/unity8/tests
7usr/lib/*/unity8/tests
7usr/lib/*/unity8/uqmlscene
8usr/lib/*/unity8/uqmlscene
8usr/share/unity8/mocks
9usr/share/unity8/mocks
debian/unity8.install+3−2
@@ -1,7 +1,8 @@
1debian/usr.bin.unity8-dash etc/apparmor.d
1debian/usr.bin.unity8-dash etc/apparmor.d
2var/lib/unity8/version
2var/lib/unity8/version
3−data/unity8-filewatcher.conf usr/share/upstart/sessions/
3+data/unity8.service usr/lib/systemd/user
4−data/unity8.conf usr/share/upstart/sessions/
4+data/unity8-dash.service usr/lib/systemd/user
5+data/unity8-session usr/bin
5data/devices.conf etc/ubuntu/
6data/devices.conf etc/ubuntu/
6data/test.sensors etc/ubuntusensors/
7data/test.sensors etc/ubuntusensors/
7usr/bin/unity8
8usr/bin/unity8
plugins/AccountsService/CMakeLists.txt+1−2
@@ -7,9 +7,8 @@ add_library(AccountsService-qml MODULE
7 plugin.cpp
7 plugin.cpp
8 )
8 )
9
9
10−qt5_use_modules(AccountsService-qml DBus Qml)
11−
12target_link_libraries(AccountsService-qml
10target_link_libraries(AccountsService-qml
11+ Qt5::DBus Qt5::Qml
13 ${GLIB_LIBRARIES}
12 ${GLIB_LIBRARIES}
14 )
13 )
15
14
plugins/CMakeLists.txt+1−1
@@ -1,4 +1,4 @@
1−include(QmlPlugins)
1+find_package(QmlPlugins)
2
2
3# Set up and install a plugin for unity8.
3# Set up and install a plugin for unity8.
4#
4#
plugins/Cursor/CMakeLists.txt+1−2
@@ -26,8 +26,7 @@ add_library(Cursor-qml SHARED
26target_link_libraries(Cursor-qml
26target_link_libraries(Cursor-qml
27 xcursorloader-static
27 xcursorloader-static
28 ${QT5PLATFORM_SUPPORT_LDFLAGS}
28 ${QT5PLATFORM_SUPPORT_LDFLAGS}
29+ Qt5::Qml Qt5::Quick Qt5::Svg
29)
30)
30
31
31−qt5_use_modules(Cursor-qml Qml Quick Svg)
32−
33add_unity8_plugin(Cursor 1.1 Cursor TARGETS Cursor-qml)
32add_unity8_plugin(Cursor 1.1 Cursor TARGETS Cursor-qml)
plugins/Dash/CMakeLists.txt+1−2
@@ -37,10 +37,9 @@ add_library(Dash-qml MODULE
37target_link_libraries(Dash-qml
37target_link_libraries(Dash-qml
38 ${Qt5Gui_LIBRARIES}
38 ${Qt5Gui_LIBRARIES}
39 ${Qt5Quick_LIBRARIES}
39 ${Qt5Quick_LIBRARIES}
40+ Qt5::Qml Qt5::Quick Qt5::Concurrent
40 )
41 )
41
42
42−qt5_use_modules(Dash-qml Qml Quick Concurrent)
43−
44add_unity8_plugin(Dash 0.1 Dash TARGETS Dash-qml)
43add_unity8_plugin(Dash 0.1 Dash TARGETS Dash-qml)
45
44
46install(FILES graphics/music_progress_bg.png DESTINATION ${SHELL_INSTALL_QML}/Dash/graphics/)
45install(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)
236 return nullptr;
236 return nullptr;
237
237
238 m_asyncRequestedIndex = -1;
238 m_asyncRequestedIndex = -1;
239− QObject* object = m_delegateModel->object(modelIndex, asynchronous);
239+ QObject* object = m_delegateModel->object(modelIndex, asynchronous ? QQmlIncubator::Asynchronous : QQmlIncubator::AsynchronousIfNested);
240 QQuickItem *item = qmlobject_cast<QQuickItem*>(object);
240 QQuickItem *item = qmlobject_cast<QQuickItem*>(object);
241 if (!item) {
241 if (!item) {
242 if (object) {
242 if (object) {
plugins/Dash/listviewwithpageheader.cpp+1−1
@@ -871,7 +871,7 @@ ListViewWithPageHeader::ListItem *ListViewWithPageHeader::createItem(int modelIn
871 return nullptr;
871 return nullptr;
872
872
873 m_asyncRequestedIndex = -1;
873 m_asyncRequestedIndex = -1;
874− QObject* object = m_delegateModel->object(modelIndex, asynchronous);
874+ QObject* object = m_delegateModel->object(modelIndex, asynchronous ? QQmlIncubator::Asynchronous : QQmlIncubator::AsynchronousIfNested);
875 QQuickItem *item = qmlobject_cast<QQuickItem*>(object);
875 QQuickItem *item = qmlobject_cast<QQuickItem*>(object);
876 if (!item) {
876 if (!item) {
877 if (object) {
877 if (object) {
plugins/GlobalShortcut/CMakeLists.txt+1−1
@@ -5,6 +5,6 @@ set(globalshortcutplugin_SRCS
5
5
6add_library(GlobalShortcut-qml SHARED ${globalshortcutplugin_SRCS})
6add_library(GlobalShortcut-qml SHARED ${globalshortcutplugin_SRCS})
7
7
8−qt5_use_modules(GlobalShortcut-qml Quick Gui)
8+target_link_libraries(GlobalShortcut-qml Qt5::Quick Qt5::Gui)
9
9
10add_unity8_plugin(GlobalShortcut 1.0 GlobalShortcut TARGETS GlobalShortcut-qml)
10add_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
29target_link_libraries(UnityLauncherAS-qml
29target_link_libraries(UnityLauncherAS-qml
30 unity8-private
30 unity8-private
31 ${GSETTINGS_QT_LDFLAGS}
31 ${GSETTINGS_QT_LDFLAGS}
32+ Qt5::DBus Qt5::Qml Qt5::Gui
32 )
33 )
33
34
34−qt5_use_modules(UnityLauncherAS-qml DBus Qml Gui)
35−
36add_unity8_greeter_plugin(Unity.Launcher 0.1 Unity/Launcher TARGETS UnityLauncherAS-qml)
35add_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)
89 }
89 }
90}
90}
91
91
92+uint LauncherItem::popularity() const
93+{
94+ // Not exposing usage order in greeter session at this point.
95+ return 0;
96+}
97+
92bool LauncherItem::pinned() const
98bool LauncherItem::pinned() const
93{
99{
94 return m_pinned;
100 return m_pinned;
plugins/Greeter/Unity/Launcher/launcheritem.h+1
@@ -35,6 +35,7 @@ public:
35 QString name() const override;
35 QString name() const override;
36 QString icon() const override;
36 QString icon() const override;
37 QStringList keywords() const override;
37 QStringList keywords() const override;
38+ uint popularity() const override;
38 bool pinned() const override;
39 bool pinned() const override;
39 bool running() const override;
40 bool running() const override;
40 bool recent() const override;
41 bool recent() const override;
plugins/ImageCache/CMakeLists.txt+1−1
@@ -3,6 +3,6 @@ add_library(ImageCache-qml MODULE
3 plugin.cpp
3 plugin.cpp
4 )
4 )
5
5
6−qt5_use_modules(ImageCache-qml Gui Qml Quick)
6+target_link_libraries(ImageCache-qml Qt5::Gui Qt5::Qml Qt5::Quick)
7
7
8add_unity8_plugin(ImageCache 0.1 ImageCache TARGETS ImageCache-qml)
8add_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
26 unity8-private
26 unity8-private
27 ${LIBLIGHTDM_LDFLAGS}
27 ${LIBLIGHTDM_LDFLAGS}
28 ${LIBUSERMETRICSOUTPUT_LDFLAGS}
28 ${LIBUSERMETRICSOUTPUT_LDFLAGS}
29+ Qt5::DBus Qt5::Gui Qt5::Qml
29 )
30 )
30
31
31−qt5_use_modules(FullLightDM-qml DBus Gui Qml)
32add_unity8_plugin(FullLightDM 0.1 LightDM/FullLightDM TARGETS FullLightDM-qml)
32add_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
25 integratedLightDM
25 integratedLightDM
26 unity8-private
26 unity8-private
27 ${LIBUSERMETRICSOUTPUT_LDFLAGS}
27 ${LIBUSERMETRICSOUTPUT_LDFLAGS}
28+ Qt5::DBus Qt5::Gui Qt5::Qml
28 )
29 )
29
30
30−qt5_use_modules(IntegratedLightDM-qml DBus Gui Qml)
31add_unity8_plugin(IntegratedLightDM 0.1 LightDM/IntegratedLightDM TARGETS IntegratedLightDM-qml)
31add_unity8_plugin(IntegratedLightDM 0.1 LightDM/IntegratedLightDM TARGETS IntegratedLightDM-qml)
32
32
33add_subdirectory(liblightdm)
33add_subdirectory(liblightdm)
plugins/LightDM/IntegratedLightDM/liblightdm/CMakeLists.txt+3−4
@@ -26,22 +26,21 @@ target_link_libraries(integratedLightDM
26 ${GLIB_LIBRARIES}
26 ${GLIB_LIBRARIES}
27 ${LIBUSERMETRICSOUTPUT_LDFLAGS}
27 ${LIBUSERMETRICSOUTPUT_LDFLAGS}
28 -lpam
28 -lpam
29+ Qt5::Concurrent Qt5::DBus Qt5::Gui
29)
30)
30target_link_libraries(integratedLightDMSession
31target_link_libraries(integratedLightDMSession
31 ${GLIB_LIBRARIES}
32 ${GLIB_LIBRARIES}
32 ${LIBUSERMETRICSOUTPUT_LDFLAGS}
33 ${LIBUSERMETRICSOUTPUT_LDFLAGS}
33 -lpam
34 -lpam
35+ Qt5::Concurrent Qt5::DBus Qt5::Gui
34)
36)
35target_link_libraries(MockLightDM-demo-shared
37target_link_libraries(MockLightDM-demo-shared
36 ${GLIB_LIBRARIES}
38 ${GLIB_LIBRARIES}
37 ${LIBUSERMETRICSOUTPUT_LDFLAGS}
39 ${LIBUSERMETRICSOUTPUT_LDFLAGS}
38 -lpam
40 -lpam
41+ Qt5::Concurrent Qt5::DBus Qt5::Gui
39)
42)
40
43
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−
45set_target_properties(integratedLightDM PROPERTIES
44set_target_properties(integratedLightDM PROPERTIES
46 COMPILE_FLAGS "-DSM_BUSNAME=systemBus -fPIC")
45 COMPILE_FLAGS "-DSM_BUSNAME=systemBus -fPIC")
47set_target_properties(integratedLightDMSession PROPERTIES
46set_target_properties(integratedLightDMSession PROPERTIES
plugins/Lights/CMakeLists.txt+4−2
@@ -11,7 +11,9 @@ add_library(Lights-qml MODULE
11 Lights.cpp
11 Lights.cpp
12 )
12 )
13
13
14−qt5_use_modules(Lights-qml Qml Gui)
14+target_link_libraries(Lights-qml
15+ Qt5::Qml Qt5::Gui
15−target_link_libraries(Lights-qml ${ANDROID_HARDWARE_LIBRARIES})
16+ ${ANDROID_HARDWARE_LIBRARIES}
17+ )
16
18
17add_unity8_plugin(Lights 0.1 Lights TARGETS Lights-qml)
19add_unity8_plugin(Lights 0.1 Lights TARGETS Lights-qml)
plugins/Powerd/CMakeLists.txt+4−2
@@ -9,7 +9,9 @@ add_library(Powerd-qml MODULE
9 Powerd.cpp
9 Powerd.cpp
10 )
10 )
11
11
12−qt5_use_modules(Powerd-qml DBus Qml)
12+target_link_libraries(Powerd-qml
13+ Qt5::DBus Qt5::Qml
13−target_link_libraries(Powerd-qml ${GIO_LDFLAGS})
14+ ${GIO_LDFLAGS}
15+ )
14
16
15add_unity8_plugin(Powerd 0.1 Powerd TARGETS Powerd-qml)
17add_unity8_plugin(Powerd 0.1 Powerd TARGETS Powerd-qml)
plugins/ScreenshotDirectory/CMakeLists.txt+1−1
@@ -4,6 +4,6 @@ set(PLUGIN_SOURCES
4)
4)
5
5
6add_library(ScreenshotDirectory-qml MODULE ${PLUGIN_SOURCES})
6add_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)
8
8
9add_unity8_plugin(ScreenshotDirectory 0.1 ScreenshotDirectory TARGETS ScreenshotDirectory-qml)
9add_unity8_plugin(ScreenshotDirectory 0.1 ScreenshotDirectory TARGETS ScreenshotDirectory-qml)
plugins/SessionBroadcast/CMakeLists.txt+1−2
@@ -6,9 +6,8 @@ add_library(SessionBroadcast-qml MODULE
6 plugin.cpp
6 plugin.cpp
7 )
7 )
8
8
9−qt5_use_modules(SessionBroadcast-qml DBus Qml)
10−
11target_link_libraries(SessionBroadcast-qml
9target_link_libraries(SessionBroadcast-qml
10+ Qt5::DBus Qt5::Qml
12 ${GLIB_LIBRARIES}
11 ${GLIB_LIBRARIES}
13 )
12 )
14
13
plugins/UInput/CMakeLists.txt+1−1
@@ -3,5 +3,5 @@ add_library(UInput-qml MODULE
3 uinput.cpp
3 uinput.cpp
4)
4)
5
5
6−qt5_use_modules(UInput-qml Qml)
6+target_link_libraries(UInput-qml Qt5::Qml)
7add_unity8_plugin(UInput 0.1 UInput TARGETS UInput-qml)
7add_unity8_plugin(UInput 0.1 UInput TARGETS UInput-qml)
plugins/Ubuntu/DownloadDaemonListener/CMakeLists.txt+4−2
@@ -11,8 +11,10 @@ set(DOWNLOADDAEMONLISTENER_SOURCES
11
11
12add_library(DownloadDaemonListener MODULE ${DOWNLOADDAEMONLISTENER_SOURCES})
12add_library(DownloadDaemonListener MODULE ${DOWNLOADDAEMONLISTENER_SOURCES})
13
13
14−qt5_use_modules(DownloadDaemonListener Qml Quick DBus Core)
15pkg_check_modules(DDLADAPTER REQUIRED udm-common)
14pkg_check_modules(DDLADAPTER REQUIRED udm-common)
16add_definitions(${DDLADAPTER_CFLAGS} ${DDLADAPTER_CFLAGS_OTHER})
15add_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+ )
18add_unity8_plugin(Ubuntu.DownloadDaemonListener 0.1 Ubuntu/DownloadDaemonListener TARGETS DownloadDaemonListener)
20add_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)
17add_definitions(-DUBUNTUGESTURESQML_LIBRARY)
17add_definitions(-DUBUNTUGESTURESQML_LIBRARY)
18
18
19add_library(UbuntuGesturesQml SHARED ${UbuntuGesturesQml_SOURCES})
19add_library(UbuntuGesturesQml SHARED ${UbuntuGesturesQml_SOURCES})
20−target_link_libraries(UbuntuGesturesQml ${UBUNTUGESTURES_LIBRARIES})
20+target_link_libraries(UbuntuGesturesQml ${UBUNTUGESTURES_LIBRARIES} Qt5::Core Qt5::Quick)
21−
22−qt5_use_modules(UbuntuGesturesQml Core Quick)
23
21
24# So that Foo.cpp can #include "Foo.moc"
22# So that Foo.cpp can #include "Foo.moc"
25include_directories(${CMAKE_CURRENT_BINARY_DIR})
23include_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
14
14
15add_library(ApplicationMenu-qml MODULE ${applicationMenu_SRCS})
15add_library(ApplicationMenu-qml MODULE ${applicationMenu_SRCS})
16
16
17−qt5_use_modules(ApplicationMenu-qml DBus Qml)
17+target_link_libraries(ApplicationMenu-qml Qt5::DBus Qt5::Qml)
18
18
19add_unity8_plugin(Unity.ApplicationMenu 0.1 Unity/ApplicationMenu TARGETS ApplicationMenu-qml)
19add_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
5
5
6add_library(Connectivity MODULE ${CONNECTIVITY_SOURCES})
6add_library(Connectivity MODULE ${CONNECTIVITY_SOURCES})
7
7
8−qt5_use_modules(Connectivity Qml DBus Core)
8+target_link_libraries(Connectivity Qt5::Qml Qt5::DBus Qt5::Core)
9
9
10add_unity8_plugin(Unity.Connectivity 0.1 Unity/Connectivity TARGETS Connectivity)
10add_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
16 ${QMLDASHCOMMUNICATORPLUGIN_SRC}
16 ${QMLDASHCOMMUNICATORPLUGIN_SRC}
17)
17)
18
18
19−qt5_use_modules(DashCommunicator-qml DBus Qml)
20−
21target_link_libraries(DashCommunicator-qml
19target_link_libraries(DashCommunicator-qml
20+ Qt5::DBus Qt5::Qml
22 unity8-private
21 unity8-private
23)
22)
24
23
plugins/Unity/Indicators/CMakeLists.txt+1−2
@@ -44,8 +44,7 @@ target_link_libraries(IndicatorsQml
44 ${GLIB_LIBRARIES}
44 ${GLIB_LIBRARIES}
45 ${GIO_LIBRARIES}
45 ${GIO_LIBRARIES}
46 ${QMENUMODEL_LDFLAGS}
46 ${QMENUMODEL_LDFLAGS}
47+ Qt5::Core Qt5::Qml Qt5::Quick Qt5::DBus
47)
48)
48
49
49−qt5_use_modules(IndicatorsQml Core Qml Quick DBus)
50−
51add_unity8_plugin(Unity.Indicators 0.1 Unity/Indicators TARGETS IndicatorsQml)
50add_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
32target_link_libraries(InputInfo
32target_link_libraries(InputInfo
33 ${LIBUDEV_LDFLAGS}
33 ${LIBUDEV_LDFLAGS}
34 ${LIBEVDEV_LDFLAGS}
34 ${LIBEVDEV_LDFLAGS}
35+ Qt5::Core Qt5::Qml Qt5::Quick
35)
36)
36
37
37−qt5_use_modules(InputInfo Core Qml Quick)
38−
39add_unity8_plugin(Unity.InputInfo 0.1 Unity/InputInfo TARGETS InputInfo)
38add_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
47 ${GSETTINGS_QT_LDFLAGS}
47 ${GSETTINGS_QT_LDFLAGS}
48 ${GLIB_LIBRARIES}
48 ${GLIB_LIBRARIES}
49 ${UAL_LIBRARIES}
49 ${UAL_LIBRARIES}
50+ Qt5::DBus Qt5::Qml Qt5::Gui
50 )
51 )
51
52
52−qt5_use_modules(UnityLauncher-qml DBus Qml Gui)
53−
54add_unity8_plugin(Unity.Launcher 0.1 Unity/Launcher TARGETS UnityLauncher-qml)
53add_unity8_plugin(Unity.Launcher 0.1 Unity/Launcher TARGETS UnityLauncher-qml)
plugins/Unity/Launcher/appdrawermodel.cpp+68−7
@@ -21,7 +21,8 @@
21#include <QDateTime>
21#include <QDateTime>
22
22
23AppDrawerModel::AppDrawerModel(QObject *parent):
23AppDrawerModel::AppDrawerModel(QObject *parent):
24− AppDrawerModelInterface(parent)
24+ AppDrawerModelInterface(parent),
25+ m_ual(new UalWrapper(this))
25{
26{
26 Q_FOREACH (const QString &appId, UalWrapper::installedApps()) {
27 Q_FOREACH (const QString &appId, UalWrapper::installedApps()) {
27 UalWrapper::AppInfo info = UalWrapper::getApplicationInfo(appId);
28 UalWrapper::AppInfo info = UalWrapper::getApplicationInfo(appId);
@@ -29,10 +30,16 @@ AppDrawerModel::AppDrawerModel(QObject *parent):
29 qWarning() << "Failed to get app info for app" << appId;
30 qWarning() << "Failed to get app info for app" << appId;
30 continue;
31 continue;
31 }
32 }
32− m_list.append(new LauncherItem(appId, info.name, info.icon, this));
33+ LauncherItem* item = new LauncherItem(appId, info.name, info.icon, this);
33− m_list.last()->setKeywords(info.keywords);
34+ item->setKeywords(info.keywords);
35+ item->setPopularity(info.popularity);
36+ m_list.append(item);
34 }
37 }
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);
36}
43}
37
44
38int AppDrawerModel::rowCount(const QModelIndex &parent) const
45int AppDrawerModel::rowCount(const QModelIndex &parent) const
@@ -53,10 +60,64 @@ QVariant AppDrawerModel::data(const QModelIndex &index, int role) const
53 case RoleKeywords:
60 case RoleKeywords:
54 return m_list.at(index.row())->keywords();
61 return m_list.at(index.row())->keywords();
55 case RoleUsage:
62 case RoleUsage:
56− // FIXME: u-a-l needs to provide API for usage stats.
63+ return m_list.at(index.row())->popularity();
57− // don't forget to drop the qsrand() call in the ctor when dropping this.
58− return qrand();
59 }
64 }
60
65
61 return QVariant();
66 return QVariant();
62}
67}
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 @@
19
19
20#include "launcheritem.h"
20#include "launcheritem.h"
21
21
22+class UalWrapper;
23+
22class AppDrawerModel: public AppDrawerModelInterface
24class AppDrawerModel: public AppDrawerModelInterface
23{
25{
24 Q_OBJECT
26 Q_OBJECT
@@ -28,6 +30,12 @@ public:
28 int rowCount(const QModelIndex &parent) const override;
30 int rowCount(const QModelIndex &parent) const override;
29 QVariant data(const QModelIndex &index, int role) const override;
31 QVariant data(const QModelIndex &index, int role) const override;
30
32
33+private Q_SLOTS:
34+ void appAdded(const QString &appId);
35+ void appRemoved(const QString &appId);
36+ void appInfoChanged(const QString &appId);
37+
31private:
38private:
32 QList<LauncherItem*> m_list;
39 QList<LauncherItem*> m_list;
40+ UalWrapper *m_ual;
33};
41};
plugins/Unity/Launcher/dbusinterface.cpp+2
@@ -39,6 +39,8 @@ QString DBusInterface::introspect(const QString &path) const
39 QString nodes;
39 QString nodes;
40
40
41 // Add Refresh to introspect
41 // 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.
42 nodes = QStringLiteral("<interface name=\"com.canonical.Unity.Launcher\">"
44 nodes = QStringLiteral("<interface name=\"com.canonical.Unity.Launcher\">"
43 "<method name=\"Refresh\"/>"
45 "<method name=\"Refresh\"/>"
44 "</interface>");
46 "</interface>");
plugins/Unity/Launcher/launcheritem.cpp+13
@@ -256,6 +256,19 @@ void LauncherItem::setSurfaces(const QList<QPair<QString, QString> > &surfaces)
256 }
256 }
257}
257}
258
258
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+
259unity::shell::launcher::QuickListModelInterface *LauncherItem::quickList() const
272unity::shell::launcher::QuickListModelInterface *LauncherItem::quickList() const
260{
273{
261 return m_quickList;
274 return m_quickList;
plugins/Unity/Launcher/launcheritem.h+3
@@ -39,6 +39,7 @@ public:
39 QString name() const override;
39 QString name() const override;
40 QString icon() const override;
40 QString icon() const override;
41 QStringList keywords() const override;
41 QStringList keywords() const override;
42+ uint popularity() const override;
42 bool pinned() const override;
43 bool pinned() const override;
43 bool running() const override;
44 bool running() const override;
44 bool recent() const override;
45 bool recent() const override;
@@ -55,6 +56,7 @@ private:
55 void setName(const QString &name);
56 void setName(const QString &name);
56 void setIcon(const QString &icon);
57 void setIcon(const QString &icon);
57 void setKeywords(const QStringList &keywords);
58 void setKeywords(const QStringList &keywords);
59+ void setPopularity(uint popularity);
58 void setPinned(bool pinned);
60 void setPinned(bool pinned);
59 void setRunning(bool running);
61 void setRunning(bool running);
60 void setRecent(bool recent);
62 void setRecent(bool recent);
@@ -70,6 +72,7 @@ private:
70 QString m_name;
72 QString m_name;
71 QString m_icon;
73 QString m_icon;
72 QStringList m_keywords;
74 QStringList m_keywords;
75+ uint m_popularity;
73 bool m_pinned;
76 bool m_pinned;
74 bool m_running;
77 bool m_running;
75 bool m_recent;
78 bool m_recent;
plugins/Unity/Launcher/launchermodel.cpp+1
@@ -167,6 +167,7 @@ void LauncherModel::pin(const QString &appId, int index)
167 appInfo.icon,
167 appInfo.icon,
168 this);
168 this);
169 item->setPinned(true);
169 item->setPinned(true);
170+ item->setPopularity(appInfo.popularity);
170 m_list.insert(index, item);
171 m_list.insert(index, item);
171 endInsertRows();
172 endInsertRows();
172 }
173 }
plugins/Unity/Launcher/ualwrapper.cpp+12−2
@@ -24,7 +24,15 @@ using namespace ubuntu::app_launch;
24UalWrapper::UalWrapper(QObject *parent):
24UalWrapper::UalWrapper(QObject *parent):
25 QObject(parent)
25 QObject(parent)
26{
26{
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+ });
28}
36}
29
37
30QStringList UalWrapper::installedApps()
38QStringList UalWrapper::installedApps()
@@ -39,7 +47,7 @@ QStringList UalWrapper::installedApps()
39 }
47 }
40 }
48 }
41 } catch (const std::runtime_error &e) {
49 } 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();
43 }
51 }
44
52
45 return appIds;
53 return appIds;
@@ -59,11 +67,13 @@ UalWrapper::AppInfo UalWrapper::getApplicationInfo(const QString &appId)
59 std::shared_ptr<Application> ualApp;
67 std::shared_ptr<Application> ualApp;
60 ualApp = Application::create(ualAppId, Registry::getDefault());
68 ualApp = Application::create(ualAppId, Registry::getDefault());
61
69
70+ info.appId = appId;
62 info.name = QString::fromStdString(ualApp->info()->name());
71 info.name = QString::fromStdString(ualApp->info()->name());
63 info.icon = QString::fromStdString(ualApp->info()->iconPath());
72 info.icon = QString::fromStdString(ualApp->info()->iconPath());
64 for (const std::string &keyword : ualApp->info()->keywords().value()) {
73 for (const std::string &keyword : ualApp->info()->keywords().value()) {
65 info.keywords << QString::fromStdString(keyword);
74 info.keywords << QString::fromStdString(keyword);
66 }
75 }
76+ info.popularity = ualApp->info()->popularity();
67 info.valid = true;
77 info.valid = true;
68 } catch (const std::runtime_error &e) {
78 } catch (const std::runtime_error &e) {
69 qWarning() << "ubuntu-app-launch threw an exception getting app info for appId:" << appId << ":" << e.what();
79 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
21 Q_OBJECT
21 Q_OBJECT
22public:
22public:
23 struct AppInfo {
23 struct AppInfo {
24+ QString appId;
24 bool valid = false;
25 bool valid = false;
25 QString name;
26 QString name;
26 QString icon;
27 QString icon;
27 QStringList keywords;
28 QStringList keywords;
29+ uint popularity = 0;
28 };
30 };
29
31
30 UalWrapper(QObject* parent = nullptr);
32 UalWrapper(QObject* parent = nullptr);
@@ -32,4 +34,8 @@ public:
32 static QStringList installedApps();
34 static QStringList installedApps();
33 static AppInfo getApplicationInfo(const QString &appId);
35 static AppInfo getApplicationInfo(const QString &appId);
34
36
37+Q_SIGNALS:
38+ void appAdded(const QString &appId);
39+ void appRemoved(const QString &appId);
40+ void appInfoChanged(const QString &appId);
35};
41};
plugins/Unity/Platform/CMakeLists.txt+1−1
@@ -6,6 +6,6 @@ set(platformplugin_SRCS
6
6
7add_library(Platform-qml SHARED ${platformplugin_SRCS})
7add_library(Platform-qml SHARED ${platformplugin_SRCS})
8
8
9−qt5_use_modules(Platform-qml DBus Qml)
9+target_link_libraries(Platform-qml Qt5::DBus Qt5::Qml)
10
10
11add_unity8_plugin(Unity.Platform 1.0 Unity/Platform TARGETS Platform-qml)
11add_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
18 ${QMLSESSIONPLUGIN_SRC}
18 ${QMLSESSIONPLUGIN_SRC}
19 )
19 )
20
20
21−qt5_use_modules(UnitySession-qml DBus Qml)
22target_link_libraries(UnitySession-qml
21target_link_libraries(UnitySession-qml
22+ Qt5::DBus Qt5::Qml
23 unity8-private
23 unity8-private
24 ${GIO_LDFLAGS}
24 ${GIO_LDFLAGS}
25 ${GLIB_LIBRARIES}
25 ${GLIB_LIBRARIES}
plugins/Unity/Session/dbusunitysessionservice.cpp+5−11
@@ -36,6 +36,7 @@
36
36
37#define LOGIN1_SERVICE QStringLiteral("org.freedesktop.login1")
37#define LOGIN1_SERVICE QStringLiteral("org.freedesktop.login1")
38#define LOGIN1_PATH QStringLiteral("/org/freedesktop/login1")
38#define LOGIN1_PATH QStringLiteral("/org/freedesktop/login1")
39+#define LOGIN1_SESSION_ROOT QStringLiteral("/org/freedesktop/login1/session/")
39#define LOGIN1_IFACE QStringLiteral("org.freedesktop.login1.Manager")
40#define LOGIN1_IFACE QStringLiteral("org.freedesktop.login1.Manager")
40#define LOGIN1_SESSION_IFACE QStringLiteral("org.freedesktop.login1.Session")
41#define LOGIN1_SESSION_IFACE QStringLiteral("org.freedesktop.login1.Session")
41
42
@@ -58,16 +59,9 @@ public:
58
59
59 void init()
60 void init()
60 {
61 {
61− // get our logind session path
62+ QString sessionID = QString::fromLocal8Bit(qgetenv("XDG_SESSION_ID"));
62− QDBusMessage msg = QDBusMessage::createMethodCall(LOGIN1_SERVICE,
63+ if (!sessionID.isEmpty()) {
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();
64+ logindSessionPath = LOGIN1_SESSION_ROOT + sessionID;
71
65
72 // start watching the Active property
66 // start watching the Active property
73 QDBusConnection::SM_BUSNAME().connect(LOGIN1_SERVICE, logindSessionPath, QStringLiteral("org.freedesktop.DBus.Properties"), QStringLiteral("PropertiesChanged"),
67 QDBusConnection::SM_BUSNAME().connect(LOGIN1_SERVICE, logindSessionPath, QStringLiteral("org.freedesktop.DBus.Properties"), QStringLiteral("PropertiesChanged"),
@@ -79,7 +73,7 @@ public:
79 QDBusConnection::SM_BUSNAME().connect(LOGIN1_SERVICE, LOGIN1_PATH, LOGIN1_IFACE, QStringLiteral("PrepareForSleep"),
73 QDBusConnection::SM_BUSNAME().connect(LOGIN1_SERVICE, LOGIN1_PATH, LOGIN1_IFACE, QStringLiteral("PrepareForSleep"),
80 this, SLOT(onResuming(bool)));
74 this, SLOT(onResuming(bool)));
81 } else {
75 } 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";
83 }
77 }
84 }
78 }
85
79
plugins/Utils/CMakeLists.txt+4−3
@@ -44,7 +44,10 @@ add_library(Utils-qml SHARED
44 ${QMLPLUGIN_SRC}
44 ${QMLPLUGIN_SRC}
45 )
45 )
46
46
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+ )
48
51
49# Because this is an internal support library, we want
52# Because this is an internal support library, we want
50# to expose all symbols in it. Consider changing this
53# to expose all symbols in it. Consider changing this
@@ -52,6 +55,4 @@ target_link_libraries(Utils-qml ${GIO_LDFLAGS})
52# files directly in targets.
55# files directly in targets.
53set_target_properties(Utils-qml PROPERTIES COMPILE_FLAGS -fvisibility=default)
56set_target_properties(Utils-qml PROPERTIES COMPILE_FLAGS -fvisibility=default)
54
57
55−qt5_use_modules(Utils-qml Qml Quick DBus Network Gui Sql Concurrent)
56−
57add_unity8_plugin(Utils 0.1 Utils TARGETS Utils-qml)
58add_unity8_plugin(Utils 0.1 Utils TARGETS Utils-qml)
plugins/WindowManager/CMakeLists.txt+1−1
@@ -20,6 +20,6 @@ include_directories(
20
20
21add_library(windowmanager-qml SHARED ${WINDOWMANAGER_SRC})
21add_library(windowmanager-qml SHARED ${WINDOWMANAGER_SRC})
22
22
23−qt5_use_modules(windowmanager-qml Qml Quick Gui)
23+target_link_libraries(windowmanager-qml Qt5::Qml Qt5::Quick Qt5::Gui)
24
24
25add_unity8_plugin(WindowManager 0.1 WindowManager TARGETS windowmanager-qml)
25add_unity8_plugin(WindowManager 0.1 WindowManager TARGETS windowmanager-qml)
plugins/Wizard/CMakeLists.txt+4−2
@@ -12,8 +12,10 @@ add_library(Wizard-qml MODULE
12 keyboardLayoutsModel.cpp
12 keyboardLayoutsModel.cpp
13)
13)
14
14
15−qt5_use_modules(Wizard-qml DBus Qml)
15+target_link_libraries(Wizard-qml
16+ Qt5::DBus Qt5::Qml
16−target_link_libraries(Wizard-qml ${GD3_LDFLAGS} ${GLIB_LDFLAGS} ${GEONAMES_LDFLAGS})
17+ ${GD3_LDFLAGS} ${GLIB_LDFLAGS} ${GEONAMES_LDFLAGS}
18+)
17add_unity8_plugin(Wizard 0.1 Wizard TARGETS Wizard-qml)
19add_unity8_plugin(Wizard 0.1 Wizard TARGETS Wizard-qml)
18
20
19set(POLKIT_LIB_DIR "${CMAKE_INSTALL_LOCALSTATEDIR}/lib/polkit-1")
21set(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
20# files directly in targets.
20# files directly in targets.
21set_target_properties(WizardUtils-qml PROPERTIES COMPILE_FLAGS -fvisibility=default)
21set_target_properties(WizardUtils-qml PROPERTIES COMPILE_FLAGS -fvisibility=default)
22
22
23−qt5_use_modules(WizardUtils-qml DBus Qml Quick)
23+target_link_libraries(WizardUtils-qml Qt5::DBus Qt5::Qml Qt5::Quick)
24
24
25set(PLUG_DIR ${PLUGIN_PRIVATE_MODULE_DIR}/Ubuntu/SystemSettings/Wizard/Utils)
25set(PLUG_DIR ${PLUGIN_PRIVATE_MODULE_DIR}/Ubuntu/SystemSettings/Wizard/Utils)
26install(FILES qmldir DESTINATION ${PLUG_DIR})
26install(FILES qmldir DESTINATION ${PLUG_DIR})
src/CMakeLists.txt+5−2
@@ -44,12 +44,15 @@ endif()
44
44
45pkg_check_modules(ANDROID_PROPERTIES REQUIRED libandroid-properties)
45pkg_check_modules(ANDROID_PROPERTIES REQUIRED libandroid-properties)
46add_executable(${SHELL_APP} ${SOURCE_FILES})
46add_executable(${SHELL_APP} ${SOURCE_FILES})
47−qt5_use_modules(${SHELL_APP} DBus Gui Qml Quick Test)
48
47
49if (NOT "${ANDROID_PROPERTIES_INCLUDE_DIRS}" STREQUAL "")
48if (NOT "${ANDROID_PROPERTIES_INCLUDE_DIRS}" STREQUAL "")
50 set_target_properties(${SHELL_APP} PROPERTIES INCLUDE_DIRECTORIES ${ANDROID_PROPERTIES_INCLUDE_DIRS})
49 set_target_properties(${SHELL_APP} PROPERTIES INCLUDE_DIRECTORIES ${ANDROID_PROPERTIES_INCLUDE_DIRS})
51endif()
50endif()
51+target_link_libraries(${SHELL_APP}
52+ Qt5::DBus Qt5::Gui Qt5::Qml Qt5::Quick Qt5::Test
52−target_link_libraries(${SHELL_APP} ${ANDROID_PROPERTIES_LDFLAGS} ${GSETTINGS_QT_LDFLAGS} UbuntuGestures connectivity-qt1 unity8-private)
53+ ${ANDROID_PROPERTIES_LDFLAGS} ${GSETTINGS_QT_LDFLAGS}
54+ UbuntuGestures connectivity-qt1 unity8-private
55+ )
53
56
54if (ENABLE_TOUCH_EMULATION)
57if (ENABLE_TOUCH_EMULATION)
55 target_link_libraries(${SHELL_APP} ${MOUSETOUCHADAPTOR_LIBS_LDFLAGS})
58 target_link_libraries(${SHELL_APP} ${MOUSETOUCHADAPTOR_LIBS_LDFLAGS})
src/Dash/CMakeLists.txt+4−3
@@ -10,12 +10,13 @@ endif()
10
10
11add_executable(unity8-dash ${DASH_SRCS})
11add_executable(unity8-dash ${DASH_SRCS})
12
12
13−qt5_use_modules(unity8-dash DBus Gui Qml Quick Test)
14−
15# For it to find libUbuntuGestures.so, needed by Ubuntu.Gestures QML module.
13# For it to find libUbuntuGestures.so, needed by Ubuntu.Gestures QML module.
16set_target_properties(unity8-dash PROPERTIES INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${SHELL_PRIVATE_LIBDIR}")
14set_target_properties(unity8-dash PROPERTIES INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${SHELL_PRIVATE_LIBDIR}")
17
15
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+)
19
20
20if (ENABLE_TOUCH_EMULATION)
21if (ENABLE_TOUCH_EMULATION)
21 target_link_libraries(unity8-dash ${MOUSETOUCHADAPTOR_LIBS_LDFLAGS})
22 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
19 SOVERSION ${SOVERSION}
19 SOVERSION ${SOVERSION}
20 )
20 )
21
21
22−qt5_use_modules(${LIB_NAME} DBus)
22+target_link_libraries(${LIB_NAME} Qt5::DBus)
23
23
24# install library
24# install library
25install(TARGETS ${LIB_NAME}
25install(TARGETS ${LIB_NAME}
tests/mocks/AccountsService/CMakeLists.txt+1−2
@@ -14,9 +14,8 @@ add_library(MockAccountsService-qml MODULE
14 plugin.cpp
14 plugin.cpp
15 )
15 )
16
16
17−qt5_use_modules(MockAccountsService-qml DBus Qml)
18−
19target_link_libraries(MockAccountsService-qml
17target_link_libraries(MockAccountsService-qml
18+ Qt5::DBus Qt5::Qml
20 MockLightDM
19 MockLightDM
21 )
20 )
22
21
tests/mocks/Biometryd/CMakeLists.txt+1−1
@@ -9,6 +9,6 @@ set(MOCK_BIOMETRYD_SOURCES
9
9
10add_library(MockBiometryd MODULE ${MOCK_BIOMETRYD_SOURCES})
10add_library(MockBiometryd MODULE ${MOCK_BIOMETRYD_SOURCES})
11
11
12−qt5_use_modules(MockBiometryd Qml Quick Core)
12+target_link_libraries(MockBiometryd Qt5::Qml Qt5::Quick Qt5::Core)
13
13
14add_unity8_mock(Biometryd 0.0 Biometryd TARGETS MockBiometryd)
14add_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)
2
2
3# Set up and optionally install a mock plugin for unity8.
3# Set up and optionally install a mock plugin for unity8.
4#
4#
tests/mocks/GSettings.1.0/CMakeLists.txt+1−2
@@ -13,8 +13,7 @@ add_library(FakeGSettingsQml MODULE ${GSettingsQML_SOURCES})
13target_link_libraries(FakeGSettingsQml
13target_link_libraries(FakeGSettingsQml
14 ${Qt5Core_LIBRARIES}
14 ${Qt5Core_LIBRARIES}
15 ${Qt5Quick_LIBRARIES}
15 ${Qt5Quick_LIBRARIES}
16+ Qt5::Qml
16)
17)
17
18
18−qt5_use_modules(FakeGSettingsQml Qml)
19−
20add_unity8_mock(GSettings 1.0 GSettings.1.0 TARGETS FakeGSettingsQml)
19add_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
8
8
9target_link_libraries(LightDMController
9target_link_libraries(LightDMController
10 MockLightDM
10 MockLightDM
11+ Qt5::Qml
11 )
12 )
12
13
13−qt5_use_modules(LightDMController Qml)
14−
15add_unity8_mock(LightDMController 0.1 LightDMController TARGETS LightDMController)
14add_unity8_mock(LightDMController 0.1 LightDMController TARGETS LightDMController)
tests/mocks/Lights/CMakeLists.txt+1−1
@@ -3,6 +3,6 @@ add_library(MockLights-qml MODULE
3 Lights.cpp
3 Lights.cpp
4 )
4 )
5
5
6−qt5_use_modules(MockLights-qml Qml Gui)
6+target_link_libraries(MockLights-qml Qt5::Qml Qt5::Gui)
7
7
8add_unity8_mock(Lights 0.1 Lights TARGETS MockLights-qml)
8add_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
6
6
7add_library(MockQOfono MODULE ${MOCK_QOFONO_SOURCES})
7add_library(MockQOfono MODULE ${MOCK_QOFONO_SOURCES})
8
8
9−qt5_use_modules(MockQOfono Qml Quick Core)
9+target_link_libraries(MockQOfono Qt5::Qml Qt5::Quick Qt5::Core)
10
10
11add_unity8_mock(MeeGo.QOfono 0.2 MeeGo/QOfono TARGETS MockQOfono)
11add_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
5 Powerd.cpp
5 Powerd.cpp
6 )
6 )
7
7
8−qt5_use_modules(MockPowerd-qml Qml)
8+target_link_libraries(MockPowerd-qml Qt5::Qml)
9
9
10add_unity8_mock(Powerd 0.1 Powerd TARGETS MockPowerd-qml)
10add_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})
15target_link_libraries(QMenuModelQml
15target_link_libraries(QMenuModelQml
16 ${Qt5Core_LIBRARIES}
16 ${Qt5Core_LIBRARIES}
17 ${Qt5Quick_LIBRARIES}
17 ${Qt5Quick_LIBRARIES}
18+ Qt5::Core Qt5::Quick
18)
19)
19
20
20−qt5_use_modules(QMenuModelQml Core Quick)
21−
22set_target_properties(QMenuModelQml PROPERTIES
21set_target_properties(QMenuModelQml PROPERTIES
23 OUTPUT_NAME qmenumodel
22 OUTPUT_NAME qmenumodel
24 VERSION 0)
23 VERSION 0)
tests/mocks/QtMultimedia/CMakeLists.txt+1−1
@@ -10,6 +10,6 @@ add_library(QtMultimedia-qml MODULE
10 declarativeplaylist.cpp
10 declarativeplaylist.cpp
11 )
11 )
12
12
13−qt5_use_modules(QtMultimedia-qml Qml Quick)
13+target_link_libraries(QtMultimedia-qml Qt5::Qml Qt5::Quick)
14
14
15add_unity8_mock(QtMultimedia 5.0 QtMultimedia TARGETS QtMultimedia-qml)
15add_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
3 SessionBroadcast.cpp
3 SessionBroadcast.cpp
4 )
4 )
5
5
6−qt5_use_modules(MockSessionBroadcast-qml Qml)
6+target_link_libraries(MockSessionBroadcast-qml Qt5::Qml)
7
7
8add_unity8_mock(SessionBroadcast 0.1 SessionBroadcast TARGETS MockSessionBroadcast-qml)
8add_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
3 mockuinput.cpp
3 mockuinput.cpp
4)
4)
5
5
6−qt5_use_modules(FakeUInput-qml Qml)
6+target_link_libraries(FakeUInput-qml Qt5::Qml)
7add_unity8_mock(UInput 0.1 UInput TARGETS FakeUInput-qml)
7add_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
2 networking-status.cpp
2 networking-status.cpp
3 plugin.cpp
3 plugin.cpp
4)
4)
5−qt5_use_modules(connectivity-qml Qml)
5+target_link_libraries(connectivity-qml Qt5::Qml)
6
6
7# copy qmldir file into build directory for shadow builds
7# copy qmldir file into build directory for shadow builds
8file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/qmldir"
8file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/qmldir"
tests/mocks/Ubuntu/DownloadDaemonListener/CMakeLists.txt+1−1
@@ -5,6 +5,6 @@ set(FakeUbuntuDownloadDaemonListenerQml_SOURCES
5
5
6add_library(FakeUbuntuDownloadDaemonListenerQml MODULE ${FakeUbuntuDownloadDaemonListenerQml_SOURCES})
6add_library(FakeUbuntuDownloadDaemonListenerQml MODULE ${FakeUbuntuDownloadDaemonListenerQml_SOURCES})
7
7
8−qt5_use_modules(FakeUbuntuDownloadDaemonListenerQml Core Quick)
8+target_link_libraries(FakeUbuntuDownloadDaemonListenerQml Qt5::Core Qt5::Quick)
9
9
10add_unity8_mock(Ubuntu.DownloadDaemonListener 0.1 Ubuntu/DownloadDaemonListener TARGETS FakeUbuntuDownloadDaemonListenerQml)
10add_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
5
5
6add_library(MockSecurityPrivacy MODULE ${MOCK_SECURITYPRIVACY_SOURCES})
6add_library(MockSecurityPrivacy MODULE ${MOCK_SECURITYPRIVACY_SOURCES})
7
7
8−qt5_use_modules(MockSecurityPrivacy Qml Quick Core)
8+target_link_libraries(MockSecurityPrivacy Qt5::Qml Qt5::Quick Qt5::Core)
9
9
10add_unity8_mock(Ubuntu.SystemSettings.SecurityPrivacy 1.0 Ubuntu/SystemSettings/SecurityPrivacy TARGETS MockSecurityPrivacy)
10add_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
9
9
10add_library(FakeUbuntuTelephonyQml MODULE ${FakeUbuntuTelephonyQml_SOURCES})
10add_library(FakeUbuntuTelephonyQml MODULE ${FakeUbuntuTelephonyQml_SOURCES})
11
11
12−qt5_use_modules(FakeUbuntuTelephonyQml Core Quick)
12+target_link_libraries(FakeUbuntuTelephonyQml Qt5::Core Qt5::Quick)
13
13
14add_unity8_mock(Ubuntu.Telephony 0.1 Ubuntu/Telephony TARGETS FakeUbuntuTelephonyQml)
14add_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})
24add_library(NonMirUnityApplicationQml MODULE ${FakeUnityApplicationQml_SOURCES})
24add_library(NonMirUnityApplicationQml MODULE ${FakeUnityApplicationQml_SOURCES})
25set_target_properties(NonMirUnityApplicationQml PROPERTIES OUTPUT_NAME FakeUnityApplicationQml)
25set_target_properties(NonMirUnityApplicationQml PROPERTIES OUTPUT_NAME FakeUnityApplicationQml)
26
26
27−qt5_use_modules(FakeUnityApplicationQml Core Quick DBus)
27+target_link_libraries(FakeUnityApplicationQml Qt5::Core Qt5::Quick Qt5::DBus)
28−qt5_use_modules(NonMirUnityApplicationQml Core Quick DBus)
28+target_link_libraries(NonMirUnityApplicationQml Qt5::Core Qt5::Quick Qt5::DBus)
29
29
30add_unity8_mock(Unity.Application 0.1 Unity/Application TARGETS FakeUnityApplicationQml)
30add_unity8_mock(Unity.Application 0.1 Unity/Application TARGETS FakeUnityApplicationQml)
31add_unity8_mock(Unity.Application 0.1 Unity/Application
31add_unity8_mock(Unity.Application 0.1 Unity/Application
tests/mocks/Unity/ApplicationMenu/CMakeLists.txt+1−1
@@ -13,6 +13,6 @@ set(FakeApplicationMenu_SRCS
13
13
14add_library(FakeApplicationMenu-qml MODULE ${FakeApplicationMenu_SRCS})
14add_library(FakeApplicationMenu-qml MODULE ${FakeApplicationMenu_SRCS})
15
15
16−qt5_use_modules(FakeApplicationMenu-qml Qml DBus)
16+target_link_libraries(FakeApplicationMenu-qml Qt5::Qml Qt5::DBus)
17
17
18add_unity8_mock(Unity.ApplicationMenu 1.0 Unity/ApplicationMenu PREFIX mocks TARGETS FakeApplicationMenu-qml)
18add_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
67 ${GOBJECT_LDFLAGS}
67 ${GOBJECT_LDFLAGS}
68)
68)
69
69
70−qt5_use_modules(FakeUnityQml Qml)
70+target_link_libraries(FakeUnityQml Qt5::Qml)
71
71
72add_unity8_mock(Unity 0.2 Unity TARGETS FakeUnityQml)
72add_unity8_mock(Unity 0.2 Unity TARGETS FakeUnityQml)
73
73
tests/mocks/Unity/Connectivity/CMakeLists.txt+1−1
@@ -5,6 +5,6 @@ set(MOCK_CONNECTIVITY_SOURCES
5
5
6add_library(MockConnectivity MODULE ${MOCK_CONNECTIVITY_SOURCES})
6add_library(MockConnectivity MODULE ${MOCK_CONNECTIVITY_SOURCES})
7
7
8−qt5_use_modules(MockConnectivity Qml Quick Core)
8+target_link_libraries(MockConnectivity Qt5::Qml Qt5::Quick Qt5::Core)
9
9
10add_unity8_mock(Unity.Connectivity 0.1 Unity/Connectivity TARGETS MockConnectivity)
10add_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
12 ${QMLDASHCOMMUNICATORPLUGIN_SRC}
12 ${QMLDASHCOMMUNICATORPLUGIN_SRC}
13 )
13 )
14
14
15−qt5_use_modules(MockDashCommunicator-qml DBus Qml)
15+target_link_libraries(MockDashCommunicator-qml Qt5::DBus Qt5::Qml)
16
16
17# export the qmldir and qmltypes files
17# export the qmldir and qmltypes files
18add_unity8_mock(Unity.DashCommunicator 0.1 Unity/DashCommunicator TARGETS MockDashCommunicator-qml)
18add_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)
29
29
30target_link_libraries(IndicatorsFakeQml
30target_link_libraries(IndicatorsFakeQml
31 QMenuModelQml
31 QMenuModelQml
32+ Qt5::Core Qt5::Qml Qt5::Quick
32)
33)
33
34
34set_target_properties(IndicatorsFakeQml PROPERTIES
35set_target_properties(IndicatorsFakeQml PROPERTIES
35 INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${SHELL_INSTALL_QML}/mocks/QMenuModel"
36 INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${SHELL_INSTALL_QML}/mocks/QMenuModel"
36)
37)
37
38
38−qt5_use_modules(IndicatorsFakeQml Core Qml Quick)
39−
40add_unity8_mock(Unity.Indicators 0.1 Unity/Indicators TARGETS IndicatorsFakeQml)
39add_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
26 ${MockInputInfo_SOURCES}
26 ${MockInputInfo_SOURCES}
27)
27)
28
28
29−qt5_use_modules(MockInputInfo Core Qml Quick)
29+target_link_libraries(MockInputInfo Qt5::Core Qt5::Qml Qt5::Quick)
30
30
31add_unity8_mock(Unity.InputInfo 0.1 Unity/InputInfo TARGETS MockInputInfo)
31add_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
19
19
20add_library(MockLauncherPlugin MODULE ${MockLauncherModel_SOURCES})
20add_library(MockLauncherPlugin MODULE ${MockLauncherModel_SOURCES})
21
21
22−qt5_use_modules(MockLauncherPlugin Core Quick)
22+target_link_libraries(MockLauncherPlugin Qt5::Core Qt5::Quick)
23
23
24add_unity8_mock(Unity.Launcher 0.1 Unity/Launcher TARGETS MockLauncherPlugin)
24add_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
72 return m_keywords;
72 return m_keywords;
73}
73}
74
74
75+uint MockLauncherItem::popularity() const
76+{
77+ return m_popularity;
78+}
79+
75bool MockLauncherItem::pinned() const
80bool MockLauncherItem::pinned() const
76{
81{
77 return m_pinned;
82 return m_pinned;
@@ -201,6 +206,14 @@ void MockLauncherItem::setSurfaceCount(int surfaceCount)
201 }
206 }
202}
207}
203
208
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+
204unity::shell::launcher::QuickListModelInterface *MockLauncherItem::quickList() const
217unity::shell::launcher::QuickListModelInterface *MockLauncherItem::quickList() const
205{
218{
206 return m_quickList;
219 return m_quickList;
tests/mocks/Unity/Launcher/MockLauncherItem.h+3
@@ -40,6 +40,7 @@ public:
40 QString name() const override;
40 QString name() const override;
41 QString icon() const override;
41 QString icon() const override;
42 QStringList keywords() const override;
42 QStringList keywords() const override;
43+ uint popularity() const override;
43
44
44 bool pinned() const override;
45 bool pinned() const override;
45 bool running() const override;
46 bool running() const override;
@@ -55,6 +56,7 @@ public:
55
56
56private:
57private:
57 void setKeywords(const QStringList &keywords);
58 void setKeywords(const QStringList &keywords);
59+ void setPopularity(uint popularity);
58 void setPinned(bool pinned);
60 void setPinned(bool pinned);
59 void setRunning(bool running);
61 void setRunning(bool running);
60 void setRecent(bool recent);
62 void setRecent(bool recent);
@@ -70,6 +72,7 @@ private:
70 QString m_name;
72 QString m_name;
71 QString m_icon;
73 QString m_icon;
72 QStringList m_keywords;
74 QStringList m_keywords;
75+ uint m_popularity;
73 bool m_pinned;
76 bool m_pinned;
74 bool m_running;
77 bool m_running;
75 bool m_recent;
78 bool m_recent;
tests/mocks/Unity/Notifications/CMakeLists.txt+1−1
@@ -11,6 +11,6 @@ set(MockNotificationsPlugin_SOURCES
11
11
12add_library(MockNotificationsPlugin MODULE ${MockNotificationsPlugin_SOURCES})
12add_library(MockNotificationsPlugin MODULE ${MockNotificationsPlugin_SOURCES})
13
13
14−qt5_use_modules(MockNotificationsPlugin Core Quick)
14+target_link_libraries(MockNotificationsPlugin Qt5::Core Qt5::Quick)
15
15
16add_unity8_mock(Unity.Notifications 1.0 Unity/Notifications TARGETS MockNotificationsPlugin)
16add_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
9
9
10add_library(MockScreensPlugin MODULE ${MockScreens_SOURCES})
10add_library(MockScreensPlugin MODULE ${MockScreens_SOURCES})
11
11
12−qt5_use_modules(MockScreensPlugin Gui Qml)
12+target_link_libraries(MockScreensPlugin Qt5::Gui Qt5::Qml)
13
13
14add_unity8_mock(Unity.Screens 0.1 Unity/Screens PREFIX mocks TARGETS MockScreensPlugin)
14add_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
47 ${QMLPLUGIN_SRC}
47 ${QMLPLUGIN_SRC}
48 )
48 )
49
49
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+ )
51
54
52# Because this is an internal support library, we want
55# Because this is an internal support library, we want
53# to expose all symbols in it. Consider changing this
56# to expose all symbols in it. Consider changing this
@@ -55,6 +58,4 @@ target_link_libraries(FakeUtils-qml ${GIO_LDFLAGS})
55# files directly in targets.
58# files directly in targets.
56set_target_properties(FakeUtils-qml PROPERTIES COMPILE_FLAGS -fvisibility=default)
59set_target_properties(FakeUtils-qml PROPERTIES COMPILE_FLAGS -fvisibility=default)
57
60
58−qt5_use_modules(FakeUtils-qml Qml Quick DBus Network Gui)
59−
60add_unity8_mock(Utils 0.1 Utils TARGETS FakeUtils-qml)
61add_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
15 ${CMAKE_SOURCE_DIR}/plugins/Wizard/keyboardLayoutsModel.cpp
15 ${CMAKE_SOURCE_DIR}/plugins/Wizard/keyboardLayoutsModel.cpp
16)
16)
17
17
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})
20add_unity8_mock(Wizard 0.1 Wizard TARGETS MockWizard-qml)
19add_unity8_mock(Wizard 0.1 Wizard TARGETS MockWizard-qml)
tests/mocks/liblightdm/CMakeLists.txt+1−1
@@ -7,7 +7,7 @@ set(MockLightDM_SOURCES
7
7
8add_library(MockLightDM SHARED ${MockLightDM_SOURCES})
8add_library(MockLightDM SHARED ${MockLightDM_SOURCES})
9
9
10−qt5_use_modules(MockLightDM DBus Gui)
10+target_link_libraries(MockLightDM Qt5::DBus Qt5::Gui)
11
11
12set_target_properties(MockLightDM PROPERTIES
12set_target_properties(MockLightDM PROPERTIES
13 OUTPUT_NAME lightdm-qt5-3
13 OUTPUT_NAME lightdm-qt5-3
tests/mocks/liblightdm/demo/CMakeLists.txt+1−1
@@ -18,4 +18,4 @@ target_link_libraries(MockLightDM-demo
18 ${LIBUSERMETRICSOUTPUT_LDFLAGS}
18 ${LIBUSERMETRICSOUTPUT_LDFLAGS}
19 )
19 )
20
20
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
6
6
7add_library(MockUserMetrics SHARED ${mock_SOURCES})
7add_library(MockUserMetrics SHARED ${mock_SOURCES})
8
8
9−qt5_use_modules(MockUserMetrics Gui)
9+target_link_libraries(MockUserMetrics Qt5::Gui)
10
10
11include_directories(
11include_directories(
12 ${CMAKE_SOURCE_DIR}/plugins/Utils
12 ${CMAKE_SOURCE_DIR}/plugins/Utils
tests/plugins/AccountsService/CMakeLists.txt+2−2
@@ -40,7 +40,7 @@ add_executable(mock-server
40 PropertiesServer.cpp
40 PropertiesServer.cpp
41 UscServer.cpp
41 UscServer.cpp
42 )
42 )
43−qt5_use_modules(mock-server Core DBus)
43+target_link_libraries(mock-server Qt5::Core Qt5::DBus)
44install(TARGETS mock-server
44install(TARGETS mock-server
45 DESTINATION "${SHELL_PRIVATE_LIBDIR}/tests/plugins/AccountsService"
45 DESTINATION "${SHELL_PRIVATE_LIBDIR}/tests/plugins/AccountsService"
46)
46)
@@ -50,7 +50,7 @@ add_executable(test-accountsservice
50 ${CMAKE_SOURCE_DIR}/plugins/AccountsService/AccountsServiceDBusAdaptor.cpp
50 ${CMAKE_SOURCE_DIR}/plugins/AccountsService/AccountsServiceDBusAdaptor.cpp
51 client.cpp
51 client.cpp
52 )
52 )
53−qt5_use_modules(test-accountsservice Core DBus Test)
53+target_link_libraries(test-accountsservice Qt5::Core Qt5::DBus Qt5::Test)
54install(TARGETS test-accountsservice
54install(TARGETS test-accountsservice
55 DESTINATION "${SHELL_PRIVATE_LIBDIR}/tests/plugins/AccountsService"
55 DESTINATION "${SHELL_PRIVATE_LIBDIR}/tests/plugins/AccountsService"
56)
56)
tests/plugins/Dash/CMakeLists.txt+4−8
@@ -32,8 +32,7 @@ macro(add_lvwph_test FILENAME TESTNAME)
32 add_executable(${TESTNAME}TestExec
32 add_executable(${TESTNAME}TestExec
33 ${FILENAME}test.cpp
33 ${FILENAME}test.cpp
34 ${CMAKE_CURRENT_SOURCE_DIR}/../../../plugins/Dash/listviewwithpageheader.cpp)
34 ${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})
37 install(TARGETS ${TESTNAME}TestExec
36 install(TARGETS ${TESTNAME}TestExec
38 DESTINATION "${SHELL_PRIVATE_LIBDIR}/tests/plugins/Dash"
37 DESTINATION "${SHELL_PRIVATE_LIBDIR}/tests/plugins/Dash"
39 )
38 )
@@ -51,8 +50,7 @@ macro(add_dashview_try_test FILENAME TESTNAME)
51 ${CMAKE_CURRENT_SOURCE_DIR}/../../../plugins/Dash/${FILENAME}.cpp
50 ${CMAKE_CURRENT_SOURCE_DIR}/../../../plugins/Dash/${FILENAME}.cpp
52 ${CMAKE_CURRENT_SOURCE_DIR}/../../../plugins/Dash/abstractdashview.cpp
51 ${CMAKE_CURRENT_SOURCE_DIR}/../../../plugins/Dash/abstractdashview.cpp
53 )
52 )
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})
56 install(TARGETS ${TESTNAME}TestExec
54 install(TARGETS ${TESTNAME}TestExec
57 DESTINATION "${SHELL_PRIVATE_LIBDIR}/tests/plugins/Dash"
55 DESTINATION "${SHELL_PRIVATE_LIBDIR}/tests/plugins/Dash"
58 )
56 )
@@ -64,8 +62,7 @@ macro(add_dashview_try_test FILENAME TESTNAME)
64 ${CMAKE_CURRENT_SOURCE_DIR}/../../../plugins/Dash/${FILENAME}.cpp
62 ${CMAKE_CURRENT_SOURCE_DIR}/../../../plugins/Dash/${FILENAME}.cpp
65 ${CMAKE_CURRENT_SOURCE_DIR}/../../../plugins/Dash/abstractdashview.cpp
63 ${CMAKE_CURRENT_SOURCE_DIR}/../../../plugins/Dash/abstractdashview.cpp
66 )
64 )
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})
69 install(TARGETS ${TESTNAME}TryExec
66 install(TARGETS ${TESTNAME}TryExec
70 DESTINATION "${SHELL_PRIVATE_LIBDIR}/tests/plugins/Dash"
67 DESTINATION "${SHELL_PRIVATE_LIBDIR}/tests/plugins/Dash"
71 )
68 )
@@ -84,8 +81,7 @@ endforeach()
84
81
85# CardCreator test
82# CardCreator test
86add_executable(CardCreatorTestExec cardcreatortest.cpp)
83add_executable(CardCreatorTestExec cardcreatortest.cpp)
87−qt5_use_modules(CardCreatorTestExec Test Core Qml)
84+target_link_libraries(CardCreatorTestExec Qt5::Test Qt5::Core Qt5::Qml ${Qt5Gui_LIBRARIES} ${Qt5Quick_LIBRARIES})
88−target_link_libraries(CardCreatorTestExec ${Qt5Gui_LIBRARIES} ${Qt5Quick_LIBRARIES})
89install(TARGETS CardCreatorTestExec
85install(TARGETS CardCreatorTestExec
90 DESTINATION "${SHELL_PRIVATE_LIBDIR}/tests/plugins/Dash"
86 DESTINATION "${SHELL_PRIVATE_LIBDIR}/tests/plugins/Dash"
91)
87)
tests/plugins/GlobalShortcut/CMakeLists.txt+1−2
@@ -6,8 +6,7 @@ include_directories(
6add_definitions(-DTEST_DIR="plugins/GlobalShortcut")
6add_definitions(-DTEST_DIR="plugins/GlobalShortcut")
7
7
8add_executable(GlobalShortcutTestExec GlobalShortcutTest.cpp ${CMAKE_SOURCE_DIR}/plugins/GlobalShortcut/globalshortcut.cpp)
8add_executable(GlobalShortcutTestExec GlobalShortcutTest.cpp ${CMAKE_SOURCE_DIR}/plugins/GlobalShortcut/globalshortcut.cpp)
9−qt5_use_modules(GlobalShortcutTestExec Test Quick)
9+target_link_libraries(GlobalShortcutTestExec Qt5::Test Qt5::Quick ${Qt5Quick_LIBRARIES} GlobalShortcut-qml)
10−target_link_libraries(GlobalShortcutTestExec ${Qt5Quick_LIBRARIES} GlobalShortcut-qml)
11install(TARGETS GlobalShortcutTestExec
10install(TARGETS GlobalShortcutTestExec
12 DESTINATION "${SHELL_PRIVATE_LIBDIR}/tests/plugins/GlobalShortcut"
11 DESTINATION "${SHELL_PRIVATE_LIBDIR}/tests/plugins/GlobalShortcut"
13)
12)
tests/plugins/Greeter/Unity/Launcher/CMakeLists.txt+1−1
@@ -26,9 +26,9 @@ add_executable(launchermodelastestExec
26target_link_libraries(launchermodelastestExec
26target_link_libraries(launchermodelastestExec
27 unity8-private
27 unity8-private
28 ${GSETTINGS_QT_LDFLAGS}
28 ${GSETTINGS_QT_LDFLAGS}
29+ Qt5::Test Qt5::Core Qt5::DBus Qt5::Gui Qt5::Qml
29 )
30 )
30add_dependencies(launchermodelastestExec mock-server)
31add_dependencies(launchermodelastestExec mock-server)
31−qt5_use_modules(launchermodelastestExec Test Core DBus Gui Qml)
32install(TARGETS launchermodelastestExec
32install(TARGETS launchermodelastestExec
33 DESTINATION "${SHELL_PRIVATE_LIBDIR}/tests/plugins/Greeter/Unity/Launcher"
33 DESTINATION "${SHELL_PRIVATE_LIBDIR}/tests/plugins/Greeter/Unity/Launcher"
34)
34)
tests/plugins/ImageCache/CMakeLists.txt+1−1
@@ -14,7 +14,7 @@ remove_definitions(-DQT_NO_KEYWORDS)
14add_executable(ImageCacheTestExec
14add_executable(ImageCacheTestExec
15 test.cpp
15 test.cpp
16 )
16 )
17−qt5_use_modules(ImageCacheTestExec Core Quick Test)
17+target_link_libraries(ImageCacheTestExec Qt5::Core Qt5::Quick Qt5::Test)
18add_unity8_uitest(ImageCache ImageCacheTestExec
18add_unity8_uitest(ImageCache ImageCacheTestExec
19 DEPENDS ImageCache-qml
19 DEPENDS ImageCache-qml
20 IMPORT_PATHS ${UNITY_PLUGINPATH}
20 IMPORT_PATHS ${UNITY_PLUGINPATH}
tests/plugins/LightDM/IntegratedLightDM/CMakeLists.txt+6−6
@@ -12,8 +12,8 @@ add_executable(GreeterDBusTestExec
12# This add_dependencies is needed since we're linking with with -L and -l below
12# This add_dependencies is needed since we're linking with with -L and -l below
13# make seems to work but ninja breaks without it
13# make seems to work but ninja breaks without it
14add_dependencies(GreeterDBusTestExec MockLightDM)
14add_dependencies(GreeterDBusTestExec MockLightDM)
15−qt5_use_modules(GreeterDBusTestExec Core DBus Quick Test)
16target_link_libraries(GreeterDBusTestExec
15target_link_libraries(GreeterDBusTestExec
16+ Qt5::Core Qt5::DBus Qt5::Quick Qt5::Test
17 MockLightDM
17 MockLightDM
18 )
18 )
19target_include_directories(GreeterDBusTestExec PUBLIC
19target_include_directories(GreeterDBusTestExec PUBLIC
@@ -36,8 +36,8 @@ add_executable(GreeterPamTestExec
36 pam.cpp
36 pam.cpp
37 ${CMAKE_SOURCE_DIR}/plugins/LightDM/IntegratedLightDM/liblightdm/GreeterPrivate.cpp
37 ${CMAKE_SOURCE_DIR}/plugins/LightDM/IntegratedLightDM/liblightdm/GreeterPrivate.cpp
38 )
38 )
39−qt5_use_modules(GreeterPamTestExec Concurrent Core Test)
40target_link_libraries(GreeterPamTestExec
39target_link_libraries(GreeterPamTestExec
40+ Qt5::Concurrent Qt5::Core Qt5::Test
41 integratedLightDM
41 integratedLightDM
42 )
42 )
43
43
@@ -57,8 +57,8 @@ add_executable(GreeterSessionsModelTestExec
57 ${CMAKE_SOURCE_DIR}/plugins/Utils/unitysortfilterproxymodelqml.cpp
57 ${CMAKE_SOURCE_DIR}/plugins/Utils/unitysortfilterproxymodelqml.cpp
58 )
58 )
59add_dependencies(GreeterSessionsModelTestExec MockLightDM)
59add_dependencies(GreeterSessionsModelTestExec MockLightDM)
60−qt5_use_modules(GreeterSessionsModelTestExec Core Test)
61target_link_libraries(GreeterSessionsModelTestExec
60target_link_libraries(GreeterSessionsModelTestExec
61+ Qt5::Core Qt5::Test
62 MockLightDM
62 MockLightDM
63 )
63 )
64target_include_directories(GreeterSessionsModelTestExec PUBLIC
64target_include_directories(GreeterSessionsModelTestExec PUBLIC
@@ -84,8 +84,8 @@ add_executable(GreeterUsersModelTestExec
84# This add_dependencies is needed since we're linking with with -L and -l below
84# This add_dependencies is needed since we're linking with with -L and -l below
85# make seems to work but ninja breaks without it
85# make seems to work but ninja breaks without it
86add_dependencies(GreeterUsersModelTestExec MockLightDM)
86add_dependencies(GreeterUsersModelTestExec MockLightDM)
87−qt5_use_modules(GreeterUsersModelTestExec Core Test)
88target_link_libraries(GreeterUsersModelTestExec
87target_link_libraries(GreeterUsersModelTestExec
88+ Qt5::Core Qt5::Test
89 MockLightDM
89 MockLightDM
90 )
90 )
91target_include_directories(GreeterUsersModelTestExec PUBLIC
91target_include_directories(GreeterUsersModelTestExec PUBLIC
@@ -111,8 +111,8 @@ add_executable(GreeterPromptsModelTestExec
111# This add_dependencies is needed since we're linking with with -L and -l below
111# This add_dependencies is needed since we're linking with with -L and -l below
112# make seems to work but ninja breaks without it
112# make seems to work but ninja breaks without it
113add_dependencies(GreeterPromptsModelTestExec MockLightDM)
113add_dependencies(GreeterPromptsModelTestExec MockLightDM)
114−qt5_use_modules(GreeterPromptsModelTestExec Core Test)
115target_link_libraries(GreeterPromptsModelTestExec
114target_link_libraries(GreeterPromptsModelTestExec
115+ Qt5::Core Qt5::Test
116 MockLightDM
116 MockLightDM
117 )
117 )
118target_include_directories(GreeterPromptsModelTestExec PUBLIC
118target_include_directories(GreeterPromptsModelTestExec PUBLIC
@@ -131,8 +131,8 @@ add_unity8_uitest(GreeterPrompts GreeterPromptsModelTestExec
131add_executable(GreeterIntegratedTestExec
131add_executable(GreeterIntegratedTestExec
132 integrated.cpp
132 integrated.cpp
133 )
133 )
134−qt5_use_modules(GreeterIntegratedTestExec Core DBus Quick Test)
135target_link_libraries(GreeterIntegratedTestExec
134target_link_libraries(GreeterIntegratedTestExec
135+ Qt5::Core Qt5::DBus Qt5::Quick Qt5::Test
136 ${GLIB_LIBRARIES}
136 ${GLIB_LIBRARIES}
137 integratedLightDMSession
137 integratedLightDMSession
138 )
138 )
tests/plugins/SessionBroadcast/CMakeLists.txt+2−2
@@ -24,7 +24,7 @@ add_executable(MockBroadcastServer
24 server.cpp
24 server.cpp
25 BroadcastServer.cpp
25 BroadcastServer.cpp
26)
26)
27−qt5_use_modules(MockBroadcastServer Core DBus)
27+target_link_libraries(MockBroadcastServer Qt5::Core Qt5::DBus)
28install(TARGETS MockBroadcastServer
28install(TARGETS MockBroadcastServer
29 DESTINATION "${SHELL_PRIVATE_LIBDIR}/tests/plugins/SessionBroadcast"
29 DESTINATION "${SHELL_PRIVATE_LIBDIR}/tests/plugins/SessionBroadcast"
30)
30)
@@ -34,7 +34,7 @@ add_executable(sessionbroadcasttestExec
34 ${CMAKE_SOURCE_DIR}/plugins/SessionBroadcast/SessionBroadcast.cpp
34 ${CMAKE_SOURCE_DIR}/plugins/SessionBroadcast/SessionBroadcast.cpp
35 sessionbroadcasttest.cpp
35 sessionbroadcasttest.cpp
36)
36)
37−qt5_use_modules(sessionbroadcasttestExec Test Core Qml DBus)
37+target_link_libraries(sessionbroadcasttestExec Qt5::Test Qt5::Core Qt5::Qml Qt5::DBus)
38install(TARGETS sessionbroadcasttestExec
38install(TARGETS sessionbroadcasttestExec
39 DESTINATION "${SHELL_PRIVATE_LIBDIR}/tests/plugins/SessionBroadcast"
39 DESTINATION "${SHELL_PRIVATE_LIBDIR}/tests/plugins/SessionBroadcast"
40)
40)
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(
18
18
19macro(build_gesture_test CLASSNAME)
19macro(build_gesture_test CLASSNAME)
20 add_executable(${CLASSNAME}TestExec tst_${CLASSNAME}.cpp GestureTest.cpp TestItem.cpp)
20 add_executable(${CLASSNAME}TestExec tst_${CLASSNAME}.cpp GestureTest.cpp TestItem.cpp)
21+ target_link_libraries(${CLASSNAME}TestExec
21− qt5_use_modules(${CLASSNAME}TestExec Test Core Qml Gui Quick)
22+ Qt5::Test Qt5::Core Qt5::Qml Qt5::Gui Qt5::Quick
22− target_link_libraries(${CLASSNAME}TestExec UbuntuGesturesQml ${UBUNTUGESTURES_LIBRARIES})
23+ UbuntuGesturesQml ${UBUNTUGESTURES_LIBRARIES}
24+ )
23 install(TARGETS ${CLASSNAME}TestExec
25 install(TARGETS ${CLASSNAME}TestExec
24 DESTINATION "${SHELL_PRIVATE_LIBDIR}/tests/plugins/Ubuntu/Gestures"
26 DESTINATION "${SHELL_PRIVATE_LIBDIR}/tests/plugins/Ubuntu/Gestures"
25 )
27 )
tests/plugins/Ubuntu/Gestures/GestureTest.cpp+10−1
@@ -17,6 +17,7 @@
17#include "GestureTest.h"
17#include "GestureTest.h"
18
18
19#include <qpa/qwindowsysteminterface.h>
19#include <qpa/qwindowsysteminterface.h>
20+#include <private/qquickanimatorcontroller_p.h>
20#include <private/qquickwindow_p.h>
21#include <private/qquickwindow_p.h>
21#include <QQmlEngine>
22#include <QQmlEngine>
22#include <QQuickView>
23#include <QQuickView>
@@ -108,7 +109,15 @@ void GestureTest::sendTouch(qint64 timestamp, int id, QPointF pos,
108 QCoreApplication::sendEvent(m_view, &touchEvent);
109 QCoreApplication::sendEvent(m_view, &touchEvent);
109
110
110 QQuickWindowPrivate *windowPrivate = QQuickWindowPrivate::get(m_view);
111 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+ }
112}
121}
113
122
114void GestureTest::passTime(qint64 timeSpanMs)
123void GestureTest::passTime(qint64 timeSpanMs)
tests/plugins/Ubuntu/Gestures/tst_TouchGate.cpp+10−1
@@ -19,6 +19,7 @@
19#include <QQmlEngine>
19#include <QQmlEngine>
20#include <QQuickView>
20#include <QQuickView>
21#include <QSharedPointer>
21#include <QSharedPointer>
22+#include <private/qquickanimatorcontroller_p.h>
22#include <private/qquickwindow_p.h>
23#include <private/qquickwindow_p.h>
23
24
24// C++ std lib
25// C++ std lib
@@ -191,7 +192,15 @@ void tst_TouchGate::holdsEventsUntilGainsOwnership()
191 if (!ownershipAfterTouchEnd) {
192 if (!ownershipAfterTouchEnd) {
192 touchRegistry->removeCandidateOwnerForTouch(0, candidateItem);
193 touchRegistry->removeCandidateOwnerForTouch(0, candidateItem);
193 QQuickWindowPrivate *wp = QQuickWindowPrivate::get(testItem->window());
194 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+ }
195 // TouchGate should now open its flood gates and let testItem get all
204 // TouchGate should now open its flood gates and let testItem get all
196 // events from touch 0 produced so far
205 // events from touch 0 produced so far
197 QCOMPARE(testItem->touchEventsReceived.count(), 2);
206 QCOMPARE(testItem->touchEventsReceived.count(), 2);
tests/plugins/Unity/Indicators/CMakeLists.txt+1−1
@@ -17,8 +17,8 @@ macro(indicator_test TEST)
17 ${TEST}Test.cpp
17 ${TEST}Test.cpp
18 ${test_ADDITIONAL_CPPS}
18 ${test_ADDITIONAL_CPPS}
19 )
19 )
20− qt5_use_modules(${TEST}Exec Test Core Qml DBus)
21 target_link_libraries(${TEST}Exec
20 target_link_libraries(${TEST}Exec
21+ Qt5::Test Qt5::Core Qt5::Qml Qt5::DBus
22 ${test_ADDITIONAL_LIBS}
22 ${test_ADDITIONAL_LIBS}
23 ${GLIB_LIBRARIES}
23 ${GLIB_LIBRARIES}
24 ${GIO_LIBRARIES}
24 ${GIO_LIBRARIES}
tests/plugins/Unity/Launcher/CMakeLists.txt+35−1
@@ -44,9 +44,9 @@ target_link_libraries(launchermodeltestExec
44 ${GSETTINGS_QT_LDFLAGS}
44 ${GSETTINGS_QT_LDFLAGS}
45 ${GLIB_LIBRARIES}
45 ${GLIB_LIBRARIES}
46 ${UAL_LIBRARIES}
46 ${UAL_LIBRARIES}
47+ Qt5::Test Qt5::Core Qt5::DBus Qt5::Xml Qt5::Gui Qt5::Qml
47 )
48 )
48add_dependencies(launchermodeltestExec mock-server)
49add_dependencies(launchermodeltestExec mock-server)
49−qt5_use_modules(launchermodeltestExec Test Core DBus Xml Gui Qml)
50install(TARGETS launchermodeltestExec
50install(TARGETS launchermodeltestExec
51 DESTINATION "${SHELL_PRIVATE_LIBDIR}/tests/plugins/Unity/Launcher"
51 DESTINATION "${SHELL_PRIVATE_LIBDIR}/tests/plugins/Unity/Launcher"
52 )
52 )
@@ -61,6 +61,40 @@ add_unity8_unittest(LauncherModel dbus-test-runner
61 --wait-for org.freedesktop.Accounts
61 --wait-for org.freedesktop.Accounts
62)
62)
63
63
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+
64# copy sample application files into build directory for shadow builds
98# copy sample application files into build directory for shadow builds
65file(COPY applications
99file(COPY applications
66 DESTINATION ${CMAKE_CURRENT_BINARY_DIR}
100 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
28 LogindServer.cpp
28 LogindServer.cpp
29 server.cpp
29 server.cpp
30)
30)
31−qt5_use_modules(LightDMServer Core DBus)
31+target_link_libraries(LightDMServer Qt5::Core Qt5::DBus)
32install(TARGETS LightDMServer
32install(TARGETS LightDMServer
33 DESTINATION "${SHELL_PRIVATE_LIBDIR}/tests/plugins/Unity/Session"
33 DESTINATION "${SHELL_PRIVATE_LIBDIR}/tests/plugins/Unity/Session"
34 )
34 )
@@ -53,13 +53,14 @@ target_link_libraries(sessionbackendtestExec
53 unity8-private
53 unity8-private
54 ${GLIB_LIBRARIES}
54 ${GLIB_LIBRARIES}
55 )
55 )
56−qt5_use_modules(sessionbackendtestExec Test Core Qml DBus)
56+target_link_libraries(sessionbackendtestExec Qt5::Test Qt5::Core Qt5::Qml Qt5::DBus)
57install(TARGETS sessionbackendtestExec
57install(TARGETS sessionbackendtestExec
58 DESTINATION "${SHELL_PRIVATE_LIBDIR}/tests/plugins/Unity/Session"
58 DESTINATION "${SHELL_PRIVATE_LIBDIR}/tests/plugins/Unity/Session"
59)
59)
60
60
61add_unity8_unittest(SessionBackend dbus-test-runner
61add_unity8_unittest(SessionBackend dbus-test-runner
62 ENVIRONMENT LD_PRELOAD=$<TARGET_FILE:SessionBackendTestPreload>
62 ENVIRONMENT LD_PRELOAD=$<TARGET_FILE:SessionBackendTestPreload>
63+ XDG_SESSION_ID=testing
63 XDG_SESSION_PATH=/session
64 XDG_SESSION_PATH=/session
64 ARG_PREFIX "--parameter"
65 ARG_PREFIX "--parameter"
65 ARGS
66 ARGS
tests/plugins/Unity/Session/LogindServer.cpp−5
@@ -22,11 +22,6 @@ LogindServer::LogindServer(QObject *parent)
22{
22{
23}
23}
24
24
25−QDBusObjectPath LogindServer::GetSessionByPID(quint32)
26−{
27− return QDBusObjectPath("/logindsession");
28−}
29−
30void LogindServer::Reboot(bool interactive)
25void LogindServer::Reboot(bool interactive)
31{
26{
32 Q_EMIT RebootCalled(interactive);
27 Q_EMIT RebootCalled(interactive);
tests/plugins/Unity/Session/LogindServer.h−1
@@ -30,7 +30,6 @@ public:
30 explicit LogindServer(QObject *parent = nullptr);
30 explicit LogindServer(QObject *parent = nullptr);
31
31
32public Q_SLOTS:
32public Q_SLOTS:
33− QDBusObjectPath GetSessionByPID(quint32 pid);
34 void Reboot(bool interactive);
33 void Reboot(bool interactive);
35 void PowerOff(bool interactive);
34 void PowerOff(bool interactive);
36
35
tests/plugins/Unity/Session/interfaces.xml−4
@@ -3,10 +3,6 @@
3 <method name="Lock" />
3 <method name="Lock" />
4 </interface>
4 </interface>
5 <interface name="org.freedesktop.login1.Manager">
5 <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>
10 <method name="Reboot">
6 <method name="Reboot">
11 <arg name="interactive" type="b" direction="in" />
7 <arg name="interactive" type="b" direction="in" />
12 </method>
8 </method>
tests/plugins/Unity/Session/server.cpp+1−1
@@ -37,7 +37,7 @@ int main(int argc, char *argv[])
37 auto connection = QDBusConnection::sessionBus();
37 auto connection = QDBusConnection::sessionBus();
38 if (!connection.registerObject("/org/freedesktop/login1", logind))
38 if (!connection.registerObject("/org/freedesktop/login1", logind))
39 return 1;
39 return 1;
40− if (!connection.registerObject("/logindsession", logind))
40+ if (!connection.registerObject("/org/freedesktop/login1/session/testing", logind))
41 return 1;
41 return 1;
42 if (!connection.registerService("org.freedesktop.login1"))
42 if (!connection.registerService("org.freedesktop.login1"))
43 return 1;
43 return 1;
tests/plugins/Unity/Session/sessionbackendtest.cpp+5−3
@@ -103,8 +103,8 @@ private Q_SLOTS:
103 QCoreApplication::processEvents(); // to let the services register on DBus
103 QCoreApplication::processEvents(); // to let the services register on DBus
104
104
105 QDBusInterface login1Interface("org.freedesktop.login1",
105 QDBusInterface login1Interface("org.freedesktop.login1",
106− "/logindsession",
106+ "/org/freedesktop/login1/session/testing",
107− "org.freedesktop.login1.Manager");
107+ "org.freedesktop.login1.Manager");
108 QSignalSpy spy(&login1Interface, signal.toUtf8().data());
108 QSignalSpy spy(&login1Interface, signal.toUtf8().data());
109
109
110 QDBusInterface dbusGnomeSessionWrapper("org.gnome.SessionManager",
110 QDBusInterface dbusGnomeSessionWrapper("org.gnome.SessionManager",
@@ -225,7 +225,9 @@ private Q_SLOTS:
225 DBusUnitySessionService dbusUnitySessionService;
225 DBusUnitySessionService dbusUnitySessionService;
226 QCoreApplication::processEvents(); // to let the service register on DBus
226 QCoreApplication::processEvents(); // to let the service register on DBus
227
227
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");
229 QVERIFY(iface.isValid());
231 QVERIFY(iface.isValid());
230
232
231 QSignalSpy spy(&dbusUnitySessionService, SIGNAL(Unlocked()));
233 QSignalSpy spy(&dbusUnitySessionService, SIGNAL(Unlocked()));
tests/plugins/Utils/CMakeLists.txt+2−4
@@ -16,8 +16,7 @@ foreach(util_test
16 WindowStateStorage
16 WindowStateStorage
17)
17)
18 add_executable(${util_test}TestExec ${util_test}Test.cpp ModelTest.cpp)
18 add_executable(${util_test}TestExec ${util_test}Test.cpp ModelTest.cpp)
19− qt5_use_modules(${util_test}TestExec Test Core Qml)
19+ target_link_libraries(${util_test}TestExec Qt5::Test Qt5::Core Qt5::Qml Utils-qml)
20− target_link_libraries(${util_test}TestExec Utils-qml)
21 install(TARGETS ${util_test}TestExec
20 install(TARGETS ${util_test}TestExec
22 DESTINATION "${SHELL_PRIVATE_LIBDIR}/tests/plugins/Utils"
21 DESTINATION "${SHELL_PRIVATE_LIBDIR}/tests/plugins/Utils"
23 )
22 )
@@ -32,8 +31,7 @@ add_unity8_qmlunittest(. UtilsStyle)
32
31
33# URLDispatcher test needs dbus-test-runner because it claims a dbus name
32# URLDispatcher test needs dbus-test-runner because it claims a dbus name
34add_executable(URLDispatcherTestExec URLDispatcherTest.cpp)
33add_executable(URLDispatcherTestExec URLDispatcherTest.cpp)
35−qt5_use_modules(URLDispatcherTestExec Test Core Qml)
34+target_link_libraries(URLDispatcherTestExec Qt5::Test Qt5::Core Qt5::Qml Utils-qml)
36−target_link_libraries(URLDispatcherTestExec Utils-qml)
37install(TARGETS URLDispatcherTestExec
35install(TARGETS URLDispatcherTestExec
38 DESTINATION "${SHELL_PRIVATE_LIBDIR}/tests/plugins/Utils"
36 DESTINATION "${SHELL_PRIVATE_LIBDIR}/tests/plugins/Utils"
39)
37)
tests/plugins/WindowManager/CMakeLists.txt+4−2
@@ -17,9 +17,11 @@ add_executable(TopLevelWindowModelTestExec
17 ${APPLICATION_API_INCLUDEDIR}/unity/shell/application/MirSurfaceListInterface.h
17 ${APPLICATION_API_INCLUDEDIR}/unity/shell/application/MirSurfaceListInterface.h
18 ${APPLICATION_API_INCLUDEDIR}/unity/shell/application/SurfaceManagerInterface.h
18 ${APPLICATION_API_INCLUDEDIR}/unity/shell/application/SurfaceManagerInterface.h
19 )
19 )
20−qt5_use_modules(TopLevelWindowModelTestExec Test Core Gui Qml Quick)
21
20
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+)
23
25
24install(TARGETS TopLevelWindowModelTestExec
26install(TARGETS TopLevelWindowModelTestExec
25 DESTINATION "${SHELL_PRIVATE_LIBDIR}/tests/plugins/WindowManager"
27 DESTINATION "${SHELL_PRIVATE_LIBDIR}/tests/plugins/WindowManager"
tests/plugins/Wizard/CMakeLists.txt+2−2
@@ -7,7 +7,7 @@ add_executable(tst-wizard-pagelist
7 tst_pagelist.cpp
7 tst_pagelist.cpp
8 ${CMAKE_SOURCE_DIR}/plugins/Wizard/PageList.cpp
8 ${CMAKE_SOURCE_DIR}/plugins/Wizard/PageList.cpp
9)
9)
10−qt5_use_modules(tst-wizard-pagelist Core Qml Test)
10+target_link_libraries(tst-wizard-pagelist Qt5::Core Qt5::Qml Qt5::Test)
11install(TARGETS tst-wizard-pagelist
11install(TARGETS tst-wizard-pagelist
12 DESTINATION "${SHELL_PRIVATE_LIBDIR}/tests/plugins/Wizard"
12 DESTINATION "${SHELL_PRIVATE_LIBDIR}/tests/plugins/Wizard"
13)
13)
@@ -17,7 +17,7 @@ add_executable(tst-wizard-system
17 tst_system.cpp
17 tst_system.cpp
18 ${CMAKE_SOURCE_DIR}/plugins/Wizard/System.cpp
18 ${CMAKE_SOURCE_DIR}/plugins/Wizard/System.cpp
19)
19)
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)
21install(TARGETS tst-wizard-system
21install(TARGETS tst-wizard-system
22 DESTINATION "${SHELL_PRIVATE_LIBDIR}/tests/plugins/Wizard"
22 DESTINATION "${SHELL_PRIVATE_LIBDIR}/tests/plugins/Wizard"
23)
23)
tests/qmltests/CMakeLists.txt+1−1
@@ -1,5 +1,5 @@
1
1
2−#add_subdirectory(Components) #FIXME broken with qt 5.9
2+add_subdirectory(Components)
3
3
4add_unity8_qmltest(. OrientedShell)
4add_unity8_qmltest(. OrientedShell)
5add_unity8_qmltest(. DisabledScreenNotice)
5add_unity8_qmltest(. DisabledScreenNotice)
tests/qmltests/Components/CMakeLists.txt+8−4
@@ -18,8 +18,10 @@ include_directories(
18 )
18 )
19
19
20add_executable(DragHandleTestExec tst_DragHandle.cpp)
20add_executable(DragHandleTestExec tst_DragHandle.cpp)
21+target_link_libraries(DragHandleTestExec
21−qt5_use_modules(DragHandleTestExec Test Core Qml Gui Quick)
22+ Qt5::Test Qt5::Core Qt5::Qml Qt5::Gui Qt5::Quick
22−target_link_libraries(DragHandleTestExec UbuntuGesturesQml ${UBUNTUGESTURES_LIBRARIES})
23+ UbuntuGesturesQml ${UBUNTUGESTURES_LIBRARIES}
24+ )
23install(TARGETS DragHandleTestExec
25install(TARGETS DragHandleTestExec
24 DESTINATION "${SHELL_PRIVATE_LIBDIR}/tests/qmltests/Components"
26 DESTINATION "${SHELL_PRIVATE_LIBDIR}/tests/qmltests/Components"
25 )
27 )
@@ -34,8 +36,10 @@ add_unity8_qmltest_data(. tst_DragHandle)
34
36
35########## tst_EdgeDragEvaluator
37########## tst_EdgeDragEvaluator
36add_executable(EdgeDragEvaluatorTestExec tst_EdgeDragEvaluator.cpp)
38add_executable(EdgeDragEvaluatorTestExec tst_EdgeDragEvaluator.cpp)
37−qt5_use_modules(EdgeDragEvaluatorTestExec Test Core Qml Gui Quick)
39+target_link_libraries(EdgeDragEvaluatorTestExec
40+ Qt5::Test Qt5::Core Qt5::Qml Qt5::Gui Qt5::Quick
38−target_link_libraries(EdgeDragEvaluatorTestExec UbuntuGesturesQml ${UBUNTUGESTURES_LIBRARIES})
41+ UbuntuGesturesQml ${UBUNTUGESTURES_LIBRARIES}
42+ )
39install(TARGETS EdgeDragEvaluatorTestExec
43install(TARGETS EdgeDragEvaluatorTestExec
40 DESTINATION "${SHELL_PRIVATE_LIBDIR}/tests/qmltests/Components"
44 DESTINATION "${SHELL_PRIVATE_LIBDIR}/tests/qmltests/Components"
41 )
45 )
tests/qmltests/Components/tst_DragHandle.cpp+19−2
@@ -20,6 +20,7 @@
20#include <qpa/qwindowsysteminterface.h>
20#include <qpa/qwindowsysteminterface.h>
21#include <QtQuick/QQuickView>
21#include <QtQuick/QQuickView>
22#include <QtQml/QQmlEngine>
22#include <QtQml/QQmlEngine>
23+#include <private/qquickanimatorcontroller_p.h>
23#include <private/qquickwindow_p.h>
24#include <private/qquickwindow_p.h>
24#include <UbuntuGestures/private/ucswipearea_p_p.h>
25#include <UbuntuGestures/private/ucswipearea_p_p.h>
25
26
@@ -179,7 +180,15 @@ void tst_DragHandle::flickAndHold(QQuickItem *dragHandle,
179 QTest::touchEvent(m_view, m_device).release(0, touchPoint.toPoint());
180 QTest::touchEvent(m_view, m_device).release(0, touchPoint.toPoint());
180
181
181 QQuickWindowPrivate *windowPrivate = QQuickWindowPrivate::get(m_view);
182 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+ }
183}
192}
184
193
185void tst_DragHandle::drag(QPointF &touchPoint, const QPointF& direction, qreal distance,
194void 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
194 m_fakeTimeSource->m_msecsSinceReference += timeStep;
203 m_fakeTimeSource->m_msecsSinceReference += timeStep;
195 QTest::touchEvent(m_view, m_device).move(0, touchPoint.toPoint());
204 QTest::touchEvent(m_view, m_device).move(0, touchPoint.toPoint());
196
205
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+ }
198 }
215 }
199}
216}
200
217
tests/uqmlscene/CMakeLists.txt+1−1
@@ -4,7 +4,6 @@ add_executable(uqmlscene
4 ${CMAKE_SOURCE_DIR}/src/DebuggingController.cpp
4 ${CMAKE_SOURCE_DIR}/src/DebuggingController.cpp
5 )
5 )
6
6
7−qt5_use_modules(uqmlscene Qml Quick Test DBus)
8pkg_check_modules(XCB REQUIRED xcb)
7pkg_check_modules(XCB REQUIRED xcb)
9
8
10include_directories(
9include_directories(
@@ -25,6 +24,7 @@ if (NOT "${XCB_INCLUDE_DIRS}" STREQUAL "")
25endif()
24endif()
26
25
27target_link_libraries(uqmlscene
26target_link_libraries(uqmlscene
27+ Qt5::Qml Qt5::Quick Qt5::Test Qt5::DBus
28 ${Qt5Qml_LIBRARIES}
28 ${Qt5Qml_LIBRARIES}
29 ${Qt5Quick_LIBRARIES}
29 ${Qt5Quick_LIBRARIES}
30 ${XCB_LDFLAGS}
30 ${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)
2
2
3add_definitions(-DQT_NO_KEYWORDS)
3add_definitions(-DQT_NO_KEYWORDS)
4
4
@@ -27,7 +27,7 @@ if (ENABLE_TOUCH_EMULATION)
27endif()
27endif()
28
28
29add_library(UnityTestQml MODULE ${UnityTestQML_SOURCES})
29add_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)
31
31
32if (ENABLE_TOUCH_EMULATION)
32if (ENABLE_TOUCH_EMULATION)
33 target_link_libraries(UnityTestQml ${MOUSETOUCHADAPTOR_LIBS_LDFLAGS})
33 target_link_libraries(UnityTestQml ${MOUSETOUCHADAPTOR_LIBS_LDFLAGS})
@@ -36,6 +36,4 @@ endif()
36# To find libUbuntuGestures.so
36# To find libUbuntuGestures.so
37set_target_properties(UnityTestQml PROPERTIES INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${SHELL_PRIVATE_LIBDIR}")
37set_target_properties(UnityTestQml PROPERTIES INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${SHELL_PRIVATE_LIBDIR}")
38
38
39−qt5_use_modules(UnityTestQml Core Quick Test)
40−
41add_unity8_mock(Unity.Test 0.1 Unity/Test PREFIX utils TARGETS UnityTestQml)
39add_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 @@
15 */
15 */
16
16
17#include "TouchEventSequenceWrapper.h"
17#include "TouchEventSequenceWrapper.h"
18+#include <private/qquickanimatorcontroller_p.h>
18#include <private/qquickwindow_p.h>
19#include <private/qquickwindow_p.h>
19
20
20TouchEventSequenceWrapper::TouchEventSequenceWrapper(QTest::QTouchEventSequence eventSequence, QQuickItem *item)
21TouchEventSequenceWrapper::TouchEventSequenceWrapper(QTest::QTouchEventSequence eventSequence, QQuickItem *item)
@@ -34,7 +35,15 @@ void TouchEventSequenceWrapper::commit(bool processEvents)
34
35
35 if (window) {
36 if (window) {
36 QQuickWindowPrivate *wp = QQuickWindowPrivate::get(window);
37 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+ }
38 }
47 }
39}
48}
40
49
tools/indicatorsclient/CMakeLists.txt+1−1
@@ -13,7 +13,7 @@ add_executable(${INDICATORS_CLIENT_APP}
13 ${INDICATORS_CLIENT_HEADERS}
13 ${INDICATORS_CLIENT_HEADERS}
14)
14)
15
15
16−qt5_use_modules(${INDICATORS_CLIENT_APP} Core Widgets Quick)
16+target_link_libraries(${INDICATORS_CLIENT_APP} Qt5::Core Qt5::Widgets Qt5::Quick)
17
17
18install(TARGETS ${INDICATORS_CLIENT_APP}
18install(TARGETS ${INDICATORS_CLIENT_APP}
19 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
19 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
tools/menutool/CMakeLists.txt+1−1
@@ -2,4 +2,4 @@ add_executable(menutool
2 menutool.cpp
2 menutool.cpp
3 )
3 )
4
4
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}
4 ../../src/UnixSignalHandler.cpp
4 ../../src/UnixSignalHandler.cpp
5 )
5 )
6
6
7−qt5_use_modules(${SCOPE_TOOL} Qml Quick)
7+target_link_libraries(${SCOPE_TOOL} Qt5::Qml Qt5::Quick)
8
8
9# install binaries
9# install binaries
10install(TARGETS ${SCOPE_TOOL}
10install(TARGETS ${SCOPE_TOOL}