Merge lp:~unity-team/unity-api/miral into lp:unity-api

Proposed by Daniel d'Andrada
Status: Merged
Approved by: Lukáš Tinkl
Approved revision: no longer in the source branch.
Merged at revision: 259
Proposed branch: lp:~unity-team/unity-api/miral
Merge into: lp:unity-api
Diff against target: 848 lines (+392/-96)
21 files modified
debian/changelog (+12/-0)
include/unity/shell/application/ApplicationInfoInterface.h (+5/-0)
include/unity/shell/application/ApplicationManagerInterface.h (+6/-0)
include/unity/shell/application/CMakeLists.txt (+1/-1)
include/unity/shell/application/Mir.h (+10/-1)
include/unity/shell/application/MirFocusControllerInterface.h (+0/-69)
include/unity/shell/application/MirSurfaceInterface.h (+36/-12)
include/unity/shell/application/MirSurfaceItemInterface.h (+1/-2)
include/unity/shell/application/SurfaceManagerInterface.h (+50/-0)
include/unity/shell/launcher/AppDrawerModelInterface.h (+71/-0)
include/unity/shell/launcher/CMakeLists.txt (+1/-1)
include/unity/shell/launcher/LauncherItemInterface.h (+10/-6)
test/qmltest/mocks/plugins/Unity/Application/Mocks/MockApplicationInfo.h (+2/-0)
test/qmltest/mocks/plugins/Unity/Application/Mocks/MockApplicationManager.h (+2/-0)
test/qmltest/mocks/plugins/Unity/Launcher/CMakeLists.txt (+2/-0)
test/qmltest/mocks/plugins/Unity/Launcher/Mocks/MockAppDrawerModel.cpp (+89/-0)
test/qmltest/mocks/plugins/Unity/Launcher/Mocks/MockAppDrawerModel.h (+38/-0)
test/qmltest/mocks/plugins/Unity/Launcher/Mocks/MockLauncherItem.cpp (+14/-0)
test/qmltest/mocks/plugins/Unity/Launcher/Mocks/MockLauncherItem.h (+6/-0)
test/qmltest/mocks/plugins/Unity/Launcher/TestLauncherPlugin.cpp (+4/-0)
test/qmltest/unity/shell/launcher/tst_Launcher.qml (+32/-4)
To merge this branch: bzr merge lp:~unity-team/unity-api/miral
Reviewer Review Type Date Requested Status
Lukáš Tinkl (community) Approve
Unity8 CI Bot continuous-integration Approve
Review via email: mp+309938@code.launchpad.net

Commit message

unity::shell::application - changes for the miral way of doing things

To post a comment you must log in.
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

PASSED: Continuous integration, rev:255
https://unity8-jenkins.ubuntu.com/job/lp-unity-api-ci/102/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/3246
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/3274
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/3128
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/3128/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3128
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3128/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3128
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3128/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/3128
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/3128/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3128
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3128/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3128
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3128/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/3128
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/3128/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3128
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3128/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3128
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3128/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity-api-ci/102/rebuild

review: Approve (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

PASSED: Continuous integration, rev:256
https://unity8-jenkins.ubuntu.com/job/lp-unity-api-ci/103/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/3248
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/3276
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/3130
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/3130/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3130
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3130/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3130
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3130/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/3130
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/3130/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3130
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3130/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3130
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3130/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/3130
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/3130/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3130
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3130/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3130
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3130/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity-api-ci/103/rebuild

review: Approve (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

PASSED: Continuous integration, rev:257
https://unity8-jenkins.ubuntu.com/job/lp-unity-api-ci/104/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/3257
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/3285
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/3139
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/3139/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3139
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3139/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3139
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3139/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/3139
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/3139/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3139
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3139/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3139
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3139/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/3139
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/3139/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3139
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3139/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3139
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3139/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity-api-ci/104/rebuild

review: Approve (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:258
https://unity8-jenkins.ubuntu.com/job/lp-unity-api-ci/105/
Executed test runs:
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build/3303/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/3331
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/3183
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/3183/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3183
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3183/artifact/output/*zip*/output.zip
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3183/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/3183
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/3183/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3183
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3183/artifact/output/*zip*/output.zip
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3183/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/3183
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/3183/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3183
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3183/artifact/output/*zip*/output.zip
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3183/console

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity-api-ci/105/rebuild

review: Needs Fixing (continuous-integration)
lp:~unity-team/unity-api/miral updated
254. By CI Train Bot Account

Add hasSeparator role to quicklistModel.

255. By Marcus Tomlinson

Don't rely on glib error message strings in IniParser_test (LP: #1642673)

Approved by: Daniel d'Andrada, Unity8 CI Bot

256. By CI Train Bot Account

Releasing 7.120+17.04.20161123-0ubuntu1

Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:259
https://unity8-jenkins.ubuntu.com/job/lp-unity-api-ci/110/
Executed test runs:
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build/3368/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/3396
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/3247
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/3247/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3247
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3247/artifact/output/*zip*/output.zip
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3247/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/3247
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/3247/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3247
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3247/artifact/output/*zip*/output.zip
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3247/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/3247
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/3247/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3247
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3247/artifact/output/*zip*/output.zip
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3247/console

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity-api-ci/110/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

PASSED: Continuous integration, rev:260
https://unity8-jenkins.ubuntu.com/job/lp-unity-api-ci/116/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/3441
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/3469
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3316
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3316/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3316
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3316/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3316
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3316/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3316
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3316/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3316
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3316/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3316
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3316/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity-api-ci/116/rebuild

review: Approve (continuous-integration)
lp:~unity-team/unity-api/miral updated
257. By CI Train Bot Account

Add AppDrawerModelInterface

258. By CI Train Bot Account

Releasing 7.121+17.04.20161205-0ubuntu1

Revision history for this message
Lukáš Tinkl (lukas-kde) wrote :

virtual ApplicationInfoInterface *findApplicationWithSurface(MirSurfaceInterface* surface) = 0;

as it's a getter, it should have a const qualifier

+ add a description and clarify the commit message a bit please

review: Needs Fixing
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

PASSED: Continuous integration, rev:262
https://unity8-jenkins.ubuntu.com/job/lp-unity-api-ci/119/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/3506
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/3534
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3381
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3381/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3381
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3381/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3381
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3381/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3381
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3381/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3381
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3381/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3381
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3381/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity-api-ci/119/rebuild

review: Approve (continuous-integration)
Revision history for this message
Lukáš Tinkl (lukas-kde) wrote :

LGTM, works fine with unity8/qtmir, CI passing too now

review: Approve
lp:~unity-team/unity-api/miral updated
259. By Daniel d'Andrada

unity::shel::application - changes for the miral way of doing things

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2016-11-23 12:11:04 +0000
3+++ debian/changelog 2016-12-12 16:53:20 +0000
4@@ -1,3 +1,15 @@
5+unity-api (8.0) UNRELEASED; urgency=medium
6+
7+ * unity::shel::application - changes for the miral way of doing things
8+
9+ -- Daniel d'Andrada <daniel.dandrada@canonical.com> Tue, 01 Nov 2016 17:25:38 -0200
10+
11+unity-api (7.121+17.04.20161205-0ubuntu1) zesty; urgency=medium
12+
13+ * Add AppDrawerModelInterface
14+
15+ -- Michael Zanetti <michael.zanetti@canonical.com> Mon, 05 Dec 2016 15:20:31 +0000
16+
17 unity-api (7.120+17.04.20161123-0ubuntu1) zesty; urgency=medium
18
19 [ Andrea Azzarone ]
20
21=== modified file 'include/unity/shell/application/ApplicationInfoInterface.h'
22--- include/unity/shell/application/ApplicationInfoInterface.h 2016-07-25 13:56:35 +0000
23+++ include/unity/shell/application/ApplicationInfoInterface.h 2016-12-12 16:53:20 +0000
24@@ -282,6 +282,11 @@
25 RequestedSuspended = Suspended
26 };
27
28+ /**
29+ * @brief Closes the application
30+ */
31+ virtual void close() = 0;
32+
33 /// @cond
34 virtual ~ApplicationInfoInterface() {}
35
36
37=== modified file 'include/unity/shell/application/ApplicationManagerInterface.h'
38--- include/unity/shell/application/ApplicationManagerInterface.h 2016-07-25 13:56:35 +0000
39+++ include/unity/shell/application/ApplicationManagerInterface.h 2016-12-12 16:53:20 +0000
40@@ -33,6 +33,7 @@
41 {
42
43 class ApplicationInfoInterface;
44+class MirSurfaceInterface;
45
46 /**
47 * @brief The Application manager
48@@ -134,6 +135,11 @@
49 */
50 Q_INVOKABLE virtual unity::shell::application::ApplicationInfoInterface *findApplication(const QString &appId) const = 0;
51
52+ /*
53+ * @brief Returns the AplicationInfo with the given surface
54+ */
55+ virtual ApplicationInfoInterface *findApplicationWithSurface(MirSurfaceInterface* surface) const = 0;
56+
57 /**
58 * @brief Request to focus a given application
59 *
60
61=== modified file 'include/unity/shell/application/CMakeLists.txt'
62--- include/unity/shell/application/CMakeLists.txt 2016-09-05 13:21:24 +0000
63+++ include/unity/shell/application/CMakeLists.txt 2016-12-12 16:53:20 +0000
64@@ -7,7 +7,7 @@
65
66 set(UNITY_API_LIB_HDRS ${UNITY_API_LIB_HDRS} ${headers} ${internal_headers} PARENT_SCOPE)
67
68-set(VERSION 22)
69+set(VERSION 23)
70 set(PKGCONFIG_NAME "unity-shell-application")
71 set(PKGCONFIG_DESCRIPTION "Unity shell Application APIs")
72 set(PKGCONFIG_REQUIRES "Qt5Core")
73
74=== modified file 'include/unity/shell/application/Mir.h'
75--- include/unity/shell/application/Mir.h 2016-02-17 12:56:18 +0000
76+++ include/unity/shell/application/Mir.h 2016-12-12 16:53:20 +0000
77@@ -63,9 +63,15 @@
78 RestoredState,
79 MinimizedState,
80 MaximizedState,
81- VertMaximizedState,
82 FullscreenState,
83+ MaximizedLeftState,
84+ MaximizedRightState,
85 HorizMaximizedState,
86+ VertMaximizedState,
87+ MaximizedTopLeftState,
88+ MaximizedTopRightState,
89+ MaximizedBottomLeftState,
90+ MaximizedBottomRightState,
91 HiddenState,
92 };
93
94@@ -110,7 +116,10 @@
95 /// @endcond
96 };
97
98+Q_DECLARE_METATYPE(Mir::Type)
99+Q_DECLARE_METATYPE(Mir::State)
100 Q_DECLARE_METATYPE(Mir::OrientationAngle)
101 Q_DECLARE_METATYPE(Mir::ShellChrome)
102+Q_DECLARE_METATYPE(Mir::FormFactor)
103
104 #endif // UNITY_SHELL_APPLICATION_MIR_H
105
106=== removed file 'include/unity/shell/application/MirFocusControllerInterface.h'
107--- include/unity/shell/application/MirFocusControllerInterface.h 2016-04-13 16:47:27 +0000
108+++ include/unity/shell/application/MirFocusControllerInterface.h 1970-01-01 00:00:00 +0000
109@@ -1,69 +0,0 @@
110-/*
111- * Copyright (C) 2016 Canonical, Ltd.
112- *
113- * This program is free software; you can redistribute it and/or modify
114- * it under the terms of the GNU General Public License as published by
115- * the Free Software Foundation; version 3.
116- *
117- * This program is distributed in the hope that it will be useful,
118- * but WITHOUT ANY WARRANTY; without even the implied warranty of
119- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
120- * GNU General Public License for more details.
121- *
122- * You should have received a copy of the GNU General Public License
123- * along with this program. If not, see <http://www.gnu.org/licenses/>.
124- */
125-
126-#ifndef UNITY_SHELL_APPLICATION_MIRFOCUSCONTROLLERINTERFACE_H
127-#define UNITY_SHELL_APPLICATION_MIRFOCUSCONTROLLERINTERFACE_H
128-
129-#include <QObject>
130-
131-namespace unity {
132-namespace shell {
133-namespace application {
134-
135-class MirSurfaceInterface;
136-
137-/**
138- * @brief Defines which MirSurface has focus
139- *
140- * Even though QQuickWindow::activeFocusItem is who ultimately defines the focused MirSurface
141- * in the QML scene, the two might not necessarily match all the time. And also this is a cleaner
142- * way of keeping tabs on the focused MirSurface as it doesn't involve unrelated QML items.
143- */
144-class MirFocusControllerInterface : public QObject
145-{
146- Q_OBJECT
147-
148- /**
149- * @brief The MirSurface which currently has focus, if any.
150- *
151- * Shell provides this information.
152- *
153- * But it can also be changed by the implementation. When a MirSurfaceItem gets active
154- * focus from the QML scene, it will also call MirFocusController::setFocusedSurface for
155- * the MirSurface it holds.
156- */
157- Q_PROPERTY(unity::shell::application::MirSurfaceInterface* focusedSurface READ focusedSurface
158- WRITE setFocusedSurface
159- NOTIFY focusedSurfaceChanged)
160-public:
161- /// @cond
162- MirFocusControllerInterface(QObject *parent = 0) : QObject(parent) {}
163- virtual ~MirFocusControllerInterface() {}
164-
165- virtual void setFocusedSurface(MirSurfaceInterface *surface) = 0;
166- virtual MirSurfaceInterface* focusedSurface() const = 0;
167- /// @endcond
168-Q_SIGNALS:
169- /// @cond
170- void focusedSurfaceChanged();
171- /// @endcond
172-};
173-
174-} // namespace application
175-} // namespace shell
176-} // namespace unity
177-
178-#endif // UNITY_SHELL_APPLICATION_MIRFOCUSCONTROLLERINTERFACE_H
179
180=== modified file 'include/unity/shell/application/MirSurfaceInterface.h'
181--- include/unity/shell/application/MirSurfaceInterface.h 2016-09-05 13:21:24 +0000
182+++ include/unity/shell/application/MirSurfaceInterface.h 2016-12-12 16:53:20 +0000
183@@ -58,6 +58,16 @@
184 Q_PROPERTY(QString persistentId READ persistentId CONSTANT)
185
186 /**
187+ * @brief Position of the current surface buffer, in pixels.
188+ */
189+ Q_PROPERTY(QPoint position READ position NOTIFY positionChanged)
190+
191+ /**
192+ * @brief Requested position of the current surface buffer, in pixels.
193+ */
194+ Q_PROPERTY(QPoint requestedPosition READ requestedPosition WRITE setRequestedPosition NOTIFY requestedPositionChanged)
195+
196+ /**
197 * @brief Size of the current surface buffer, in pixels.
198 */
199 Q_PROPERTY(QSize size READ size NOTIFY sizeChanged)
200@@ -65,7 +75,7 @@
201 /**
202 * @brief State of the surface
203 */
204- Q_PROPERTY(Mir::State state READ state WRITE setState NOTIFY stateChanged)
205+ Q_PROPERTY(Mir::State state READ state NOTIFY stateChanged)
206
207 /**
208 * @brief True if it has a mir client bound to it.
209@@ -165,12 +175,13 @@
210
211 virtual QString persistentId() const = 0;
212
213+ virtual QPoint position() const = 0;
214+
215 virtual QSize size() const = 0;
216 virtual void resize(int width, int height) = 0;
217 virtual void resize(const QSize &size) = 0;
218
219 virtual Mir::State state() const = 0;
220- virtual void setState(Mir::State qmlState) = 0;
221
222 virtual bool live() const = 0;
223
224@@ -196,25 +207,29 @@
225 virtual QRect inputBounds() const = 0;
226
227 virtual bool confinesMousePointer() const = 0;
228+
229+ virtual QPoint requestedPosition() const = 0;
230+ virtual void setRequestedPosition(const QPoint &) = 0;
231 /// @endcond
232
233 /**
234- * @brief Requests focus for this surface
235- *
236- * Causes the emission of focusRequested()
237- */
238- Q_INVOKABLE virtual void requestFocus() = 0;
239-
240- /**
241 * @brief Sends a close request
242 *
243 */
244 Q_INVOKABLE virtual void close() = 0;
245
246 /**
247- * @brief Raises this surface to be the first/top one among its siblings
248- */
249- Q_INVOKABLE virtual void raise() = 0;
250+ * @brief Activates this surface
251+ *
252+ * It will get focused and raised
253+ */
254+ Q_INVOKABLE virtual void activate() = 0;
255+
256+public Q_SLOTS:
257+ /**
258+ * @brief Requests a change to the specified state
259+ */
260+ virtual void requestState(Mir::State state) = 0;
261
262 Q_SIGNALS:
263 /// @cond
264@@ -223,6 +238,8 @@
265 void visibleChanged(bool visible);
266 void stateChanged(Mir::State value);
267 void orientationAngleChanged(Mir::OrientationAngle value);
268+ void positionChanged(QPoint position);
269+ void requestedPositionChanged(QPoint position);
270 void sizeChanged(const QSize &value);
271 void nameChanged(const QString &name);
272 void minimumWidthChanged(int value);
273@@ -240,8 +257,15 @@
274
275 /**
276 * @brief Emitted in response to a requestFocus() call
277+ *
278+ * If shell agrees with it, it should call activate() on this surface
279 */
280 void focusRequested();
281+
282+ /**
283+ * @brief Emitted when close() is called
284+ */
285+ void closeRequested();
286 };
287
288 } // namespace application
289
290=== modified file 'include/unity/shell/application/MirSurfaceItemInterface.h'
291--- include/unity/shell/application/MirSurfaceItemInterface.h 2016-03-11 10:39:33 +0000
292+++ include/unity/shell/application/MirSurfaceItemInterface.h 2016-12-12 16:53:20 +0000
293@@ -56,7 +56,7 @@
294 /**
295 * @brief State of the given surface or Mir.UnknownState if no surface is set
296 */
297- Q_PROPERTY(Mir::State surfaceState READ surfaceState WRITE setSurfaceState NOTIFY surfaceStateChanged)
298+ Q_PROPERTY(Mir::State surfaceState READ surfaceState NOTIFY surfaceStateChanged)
299
300 /**
301 * @brief Name of the given surface or an empty string if no surface is set
302@@ -128,7 +128,6 @@
303 virtual bool live() const = 0;
304
305 virtual Mir::State surfaceState() const = 0;
306- virtual void setSurfaceState(Mir::State) = 0;
307
308 virtual Mir::OrientationAngle orientationAngle() const = 0;
309 virtual void setOrientationAngle(Mir::OrientationAngle angle) = 0;
310
311=== added file 'include/unity/shell/application/SurfaceManagerInterface.h'
312--- include/unity/shell/application/SurfaceManagerInterface.h 1970-01-01 00:00:00 +0000
313+++ include/unity/shell/application/SurfaceManagerInterface.h 2016-12-12 16:53:20 +0000
314@@ -0,0 +1,50 @@
315+/*
316+ * Copyright (C) 2016 Canonical, Ltd.
317+ *
318+ * This program is free software; you can redistribute it and/or modify
319+ * it under the terms of the GNU General Public License as published by
320+ * the Free Software Foundation; version 3.
321+ *
322+ * This program is distributed in the hope that it will be useful,
323+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
324+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
325+ * GNU General Public License for more details.
326+ *
327+ * You should have received a copy of the GNU General Public License
328+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
329+ */
330+
331+#ifndef UNITY_SHELL_APPLICATION_SURFACEMANAGERINTERFACE_H
332+#define UNITY_SHELL_APPLICATION_SURFACEMANAGERINTERFACE_H
333+
334+#include <QObject>
335+#include <QVector>
336+
337+namespace unity {
338+namespace shell {
339+namespace application {
340+
341+class MirSurfaceInterface;
342+
343+class SurfaceManagerInterface : public QObject
344+{
345+ Q_OBJECT
346+
347+public:
348+ virtual ~SurfaceManagerInterface() {}
349+
350+ virtual void raise(MirSurfaceInterface *surface) = 0;
351+ virtual void activate(MirSurfaceInterface *surface) = 0;
352+
353+Q_SIGNALS:
354+ void surfaceCreated(MirSurfaceInterface *surface);
355+ void surfacesRaised(const QVector<MirSurfaceInterface*> &surfaces);
356+ void modificationsStarted();
357+ void modificationsEnded();
358+};
359+
360+} // namespace application
361+} // namespace shell
362+} // namespace unity
363+
364+#endif // UNITY_SHELL_APPLICATION_SURFACEMANAGERINTERFACE_H
365
366=== added file 'include/unity/shell/launcher/AppDrawerModelInterface.h'
367--- include/unity/shell/launcher/AppDrawerModelInterface.h 1970-01-01 00:00:00 +0000
368+++ include/unity/shell/launcher/AppDrawerModelInterface.h 2016-12-12 16:53:20 +0000
369@@ -0,0 +1,71 @@
370+/*
371+ * Copyright 2016 Canonical Ltd.
372+ *
373+ * This program is free software; you can redistribute it and/or modify
374+ * it under the terms of the GNU Lesser General Public License as published by
375+ * the Free Software Foundation; version 3.
376+ *
377+ * This program is distributed in the hope that it will be useful,
378+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
379+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
380+ * GNU Lesser General Public License for more details.
381+ *
382+ * You should have received a copy of the GNU Lesser General Public License
383+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
384+ */
385+
386+#pragma once
387+
388+#include <unity/SymbolExport.h>
389+
390+#include <QAbstractListModel>
391+
392+namespace unity {
393+namespace shell {
394+namespace launcher {
395+
396+/**
397+ * @brief A list of app drawer items to be displayed
398+ *
399+ * This model exposes all the items that should be shown in the app drawer.
400+ */
401+class UNITY_API AppDrawerModelInterface: public QAbstractListModel
402+{
403+ Q_OBJECT
404+ Q_ENUMS(Roles)
405+public:
406+ /**
407+ * @brief The Roles supported by the model
408+ *
409+ * See LauncherItemInterface properties for details.
410+ */
411+ enum Roles {
412+ RoleAppId,
413+ RoleName,
414+ RoleIcon,
415+ RoleKeywords,
416+ RoleUsage
417+ };
418+
419+ /// @cond
420+ AppDrawerModelInterface(QObject* parent = nullptr): QAbstractListModel(parent) {}
421+ /// @endcond
422+
423+ virtual ~AppDrawerModelInterface() {}
424+
425+ /// @cond
426+ QHash<int, QByteArray> roleNames() const override {
427+ QHash<int, QByteArray> roles;
428+ roles.insert(RoleAppId, "appId");
429+ roles.insert(RoleName, "name");
430+ roles.insert(RoleIcon, "icon");
431+ roles.insert(RoleKeywords, "keywords");
432+ roles.insert(RoleUsage, "usage");
433+ return roles;
434+ }
435+ /// @endcond
436+};
437+
438+}
439+}
440+}
441
442=== modified file 'include/unity/shell/launcher/CMakeLists.txt'
443--- include/unity/shell/launcher/CMakeLists.txt 2016-10-28 11:51:20 +0000
444+++ include/unity/shell/launcher/CMakeLists.txt 2016-12-12 16:53:20 +0000
445@@ -7,7 +7,7 @@
446
447 set(UNITY_API_LIB_HDRS ${UNITY_API_LIB_HDRS} ${headers} ${internal_headers} PARENT_SCOPE)
448
449-set(VERSION 10)
450+set(VERSION 11)
451 set(PKGCONFIG_NAME "unity-shell-launcher")
452 set(PKGCONFIG_DESCRIPTION "Unity shell Launcher APIs")
453 set(PKGCONFIG_REQUIRES "Qt5Core")
454
455=== modified file 'include/unity/shell/launcher/LauncherItemInterface.h'
456--- include/unity/shell/launcher/LauncherItemInterface.h 2016-05-11 10:48:13 +0000
457+++ include/unity/shell/launcher/LauncherItemInterface.h 2016-12-12 16:53:20 +0000
458@@ -1,5 +1,5 @@
459 /*
460- * Copyright 2013 Canonical Ltd.
461+ * Copyright 2013-2106 Canonical Ltd.
462 *
463 * This program is free software; you can redistribute it and/or modify
464 * it under the terms of the GNU Lesser General Public License as published by
465@@ -12,9 +12,6 @@
466 *
467 * You should have received a copy of the GNU Lesser General Public License
468 * along with this program. If not, see <http://www.gnu.org/licenses/>.
469- *
470- * Authors:
471- * Michael Zanetti <michael.zanetti@canonical.com>
472 */
473
474 #ifndef UNITY_SHELL_LAUNCHER_LAUNCHERITEM_H
475@@ -52,12 +49,17 @@
476 /**
477 * @brief The user visible name of the item.
478 */
479- Q_PROPERTY(QString name READ name CONSTANT)
480+ Q_PROPERTY(QString name READ name NOTIFY nameChanged)
481
482 /**
483 * @brief The full path to the icon to be shown for the item.
484 */
485- Q_PROPERTY(QString icon READ icon CONSTANT)
486+ Q_PROPERTY(QString icon READ icon NOTIFY iconChanged)
487+
488+ /**
489+ * @brief The keywords for this item.
490+ */
491+ Q_PROPERTY(QStringList keywords READ keywords NOTIFY keywordsChanged)
492
493 /**
494 * @brief A flag whether the item is pinned or not
495@@ -137,6 +139,7 @@
496 virtual QString appId() const = 0;
497 virtual QString name() const = 0;
498 virtual QString icon() const = 0;
499+ virtual QStringList keywords() const = 0;
500 virtual bool pinned() const = 0;
501 virtual bool running() const = 0;
502 virtual bool recent() const = 0;
503@@ -151,6 +154,7 @@
504 Q_SIGNALS:
505 void nameChanged(const QString &name);
506 void iconChanged(const QString &icon);
507+ void keywordsChanged(const QStringList &keywords);
508 void pinnedChanged(bool pinned);
509 void runningChanged(bool running);
510 void recentChanged(bool running);
511
512=== modified file 'test/qmltest/mocks/plugins/Unity/Application/Mocks/MockApplicationInfo.h'
513--- test/qmltest/mocks/plugins/Unity/Application/Mocks/MockApplicationInfo.h 2016-07-25 13:56:35 +0000
514+++ test/qmltest/mocks/plugins/Unity/Application/Mocks/MockApplicationInfo.h 2016-12-12 16:53:20 +0000
515@@ -29,6 +29,8 @@
516 public:
517 MockApplicationInfo(const QString &appId, const QString& name, const QString& comment, const QUrl& icon, QObject* parent = 0);
518
519+ void close() override {}
520+
521 QString appId() const;
522 QString name() const;
523 QString comment() const;
524
525=== modified file 'test/qmltest/mocks/plugins/Unity/Application/Mocks/MockApplicationManager.h'
526--- test/qmltest/mocks/plugins/Unity/Application/Mocks/MockApplicationManager.h 2015-06-19 12:02:05 +0000
527+++ test/qmltest/mocks/plugins/Unity/Application/Mocks/MockApplicationManager.h 2016-12-12 16:53:20 +0000
528@@ -44,6 +44,8 @@
529
530 Q_INVOKABLE unity::shell::application::ApplicationInfoInterface *findApplication(const QString &appId) const;
531
532+ ApplicationInfoInterface *findApplicationWithSurface(MirSurfaceInterface*) const override { return nullptr; }
533+
534 Q_INVOKABLE bool requestFocusApplication(const QString &appId);
535
536 Q_INVOKABLE bool focusApplication(const QString &appId);
537
538=== modified file 'test/qmltest/mocks/plugins/Unity/Launcher/CMakeLists.txt'
539--- test/qmltest/mocks/plugins/Unity/Launcher/CMakeLists.txt 2014-09-03 22:59:26 +0000
540+++ test/qmltest/mocks/plugins/Unity/Launcher/CMakeLists.txt 2016-12-12 16:53:20 +0000
541@@ -16,11 +16,13 @@
542 ${CMAKE_SOURCE_DIR}/include/unity/shell/launcher/LauncherModelInterface.h
543 ${CMAKE_SOURCE_DIR}/include/unity/shell/launcher/LauncherItemInterface.h
544 ${CMAKE_SOURCE_DIR}/include/unity/shell/launcher/QuickListModelInterface.h
545+ ${CMAKE_SOURCE_DIR}/include/unity/shell/launcher/AppDrawerModelInterface.h
546 ${CMAKE_SOURCE_DIR}/include/unity/shell/application/ApplicationManagerInterface.h
547 ${CMAKE_SOURCE_DIR}/include/unity/shell/application/ApplicationInfoInterface.h
548 Mocks/MockLauncherModel.cpp
549 Mocks/MockLauncherItem.cpp
550 Mocks/MockQuickListModel.cpp
551+ Mocks/MockAppDrawerModel.cpp
552 ${CMAKE_CURRENT_SOURCE_DIR}/../Application/Mocks/MockApplicationManager.cpp
553 ${CMAKE_CURRENT_SOURCE_DIR}/../Application/Mocks/MockApplicationInfo.cpp
554 )
555
556=== added file 'test/qmltest/mocks/plugins/Unity/Launcher/Mocks/MockAppDrawerModel.cpp'
557--- test/qmltest/mocks/plugins/Unity/Launcher/Mocks/MockAppDrawerModel.cpp 1970-01-01 00:00:00 +0000
558+++ test/qmltest/mocks/plugins/Unity/Launcher/Mocks/MockAppDrawerModel.cpp 2016-12-12 16:53:20 +0000
559@@ -0,0 +1,89 @@
560+/*
561+ * Copyright 2016 Canonical Ltd.
562+ *
563+ * This program is free software; you can redistribute it and/or modify
564+ * it under the terms of the GNU Lesser General Public License as published by
565+ * the Free Software Foundation; version 3.
566+ *
567+ * This program is distributed in the hope that it will be useful,
568+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
569+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
570+ * GNU Lesser General Public License for more details.
571+ *
572+ * You should have received a copy of the GNU Lesser General Public License
573+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
574+ */
575+
576+#include <Mocks/MockAppDrawerModel.h>
577+#include <Mocks/MockLauncherItem.h>
578+
579+using namespace unity::shell::launcher;
580+
581+MockAppDrawerModel::MockAppDrawerModel(QObject* parent): AppDrawerModelInterface(parent)
582+{
583+ MockLauncherItem *item = new MockLauncherItem("phone-app", "/usr/share/applications/phone-app.desktop", "Phone", "phone-app", this);
584+ item->setKeywords({"keyword1", "keyword2"});
585+ m_list.append(item);
586+ item = new MockLauncherItem("camera-app", "/usr/share/applications/camera-app.desktop", "Camera", "camera", this);
587+ item->setKeywords({"keyword1", "keyword2"});
588+ m_list.append(item);
589+ item = new MockLauncherItem("gallery-app", "/usr/share/applications/gallery-app.desktop", "Gallery", "gallery", this);
590+ item->setKeywords({"keyword1", "keyword2"});
591+ m_list.append(item);
592+ item = new MockLauncherItem("facebook-webapp", "/usr/share/applications/facebook-webapp.desktop", "Facebook", "facebook", this);
593+ item->setKeywords({"keyword1", "keyword2"});
594+ m_list.append(item);
595+ item = new MockLauncherItem("webbrowser-app", "/usr/share/applications/webbrowser-app.desktop", "Browser", "browser", this);
596+ item->setKeywords({"keyword1", "keyword2"});
597+ m_list.append(item);
598+ item = new MockLauncherItem("twitter-webapp", "/usr/share/applications/twitter-webapp.desktop", "Twitter", "twitter", this);
599+ item->setKeywords({"keyword1", "keyword2"});
600+ m_list.append(item);
601+ item = new MockLauncherItem("gmail-webapp", "/usr/share/applications/gmail-webapp.desktop", "GMail", "gmail", this);
602+ item->setKeywords({"keyword1", "keyword2"});
603+ m_list.append(item);
604+ item = new MockLauncherItem("ubuntu-weather-app", "/usr/share/applications/ubuntu-weather-app.desktop", "Weather", "weather", this);
605+ item->setKeywords({"keyword1", "keyword2"});
606+ m_list.append(item);
607+ item = new MockLauncherItem("notes-app", "/usr/share/applications/notes-app.desktop", "Notepad", "notepad", this);
608+ item->setKeywords({"keyword1", "keyword2"});
609+ m_list.append(item);
610+ item = new MockLauncherItem("ubuntu-calendar-app", "/usr/share/applications/ubuntu-calendar-app.desktop","Calendar", "calendar", this);
611+ item->setKeywords({"keyword1", "keyword2"});
612+ m_list.append(item);
613+}
614+
615+MockAppDrawerModel::~MockAppDrawerModel()
616+{
617+ while (!m_list.empty())
618+ {
619+ m_list.takeFirst()->deleteLater();
620+ }
621+}
622+
623+// cppcheck-suppress unusedFunction
624+int MockAppDrawerModel::rowCount(const QModelIndex& parent) const
625+{
626+ Q_UNUSED(parent)
627+ return m_list.count();
628+}
629+
630+QVariant MockAppDrawerModel::data(const QModelIndex& index, int role) const
631+{
632+ LauncherItemInterface *item = m_list.at(index.row());
633+ switch(role)
634+ {
635+ case RoleAppId:
636+ return item->appId();
637+ case RoleName:
638+ return item->name();
639+ case RoleIcon:
640+ return item->icon();
641+ case RoleKeywords:
642+ return item->keywords();
643+ case RoleUsage:
644+ return 1;
645+ }
646+
647+ return QVariant();
648+}
649
650=== added file 'test/qmltest/mocks/plugins/Unity/Launcher/Mocks/MockAppDrawerModel.h'
651--- test/qmltest/mocks/plugins/Unity/Launcher/Mocks/MockAppDrawerModel.h 1970-01-01 00:00:00 +0000
652+++ test/qmltest/mocks/plugins/Unity/Launcher/Mocks/MockAppDrawerModel.h 2016-12-12 16:53:20 +0000
653@@ -0,0 +1,38 @@
654+/*
655+ * Copyright 2016 Canonical Ltd.
656+ *
657+ * This program is free software; you can redistribute it and/or modify
658+ * it under the terms of the GNU Lesser General Public License as published by
659+ * the Free Software Foundation; version 3.
660+ *
661+ * This program is distributed in the hope that it will be useful,
662+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
663+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
664+ * GNU Lesser General Public License for more details.
665+ *
666+ * You should have received a copy of the GNU Lesser General Public License
667+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
668+ */
669+
670+#pragma once
671+
672+#include <AppDrawerModelInterface.h>
673+
674+class MockLauncherItem;
675+
676+using namespace unity::shell::launcher;
677+
678+class UNITY_API MockAppDrawerModel: public AppDrawerModelInterface
679+{
680+ Q_OBJECT
681+
682+public:
683+ MockAppDrawerModel(QObject* parent = 0);
684+ ~MockAppDrawerModel();
685+
686+ int rowCount(const QModelIndex& parent) const override;
687+ QVariant data(const QModelIndex& index, int role) const override;
688+
689+private:
690+ QList<MockLauncherItem*> m_list;
691+};
692
693=== modified file 'test/qmltest/mocks/plugins/Unity/Launcher/Mocks/MockLauncherItem.cpp'
694--- test/qmltest/mocks/plugins/Unity/Launcher/Mocks/MockLauncherItem.cpp 2016-05-18 13:43:40 +0000
695+++ test/qmltest/mocks/plugins/Unity/Launcher/Mocks/MockLauncherItem.cpp 2016-12-12 16:53:20 +0000
696@@ -61,6 +61,20 @@
697 return m_icon;
698 }
699
700+QStringList MockLauncherItem::keywords() const
701+{
702+ return m_keywords;
703+}
704+
705+void MockLauncherItem::setKeywords(const QStringList &keywords)
706+{
707+ if (m_keywords != keywords)
708+ {
709+ m_keywords = keywords;
710+ Q_EMIT keywordsChanged(m_keywords);
711+ }
712+}
713+
714 bool MockLauncherItem::pinned() const
715 {
716 return m_pinned;
717
718=== modified file 'test/qmltest/mocks/plugins/Unity/Launcher/Mocks/MockLauncherItem.h'
719--- test/qmltest/mocks/plugins/Unity/Launcher/Mocks/MockLauncherItem.h 2016-05-18 13:43:40 +0000
720+++ test/qmltest/mocks/plugins/Unity/Launcher/Mocks/MockLauncherItem.h 2016-12-12 16:53:20 +0000
721@@ -22,6 +22,8 @@
722
723 #include <LauncherItemInterface.h>
724
725+#include <QStringList>
726+
727 using namespace unity::shell::launcher;
728
729 class UNITY_API MockLauncherItem: public LauncherItemInterface
730@@ -35,6 +37,9 @@
731 QString name() const;
732 QString icon() const;
733
734+ QStringList keywords() const;
735+ void setKeywords(const QStringList &keywords);
736+
737 bool pinned() const;
738 void setPinned(bool pinned);
739
740@@ -67,6 +72,7 @@
741 QString m_desktopFile;
742 QString m_name;
743 QString m_icon;
744+ QStringList m_keywords;
745 bool m_pinned;
746 bool m_running;
747 bool m_recent;
748
749=== modified file 'test/qmltest/mocks/plugins/Unity/Launcher/TestLauncherPlugin.cpp'
750--- test/qmltest/mocks/plugins/Unity/Launcher/TestLauncherPlugin.cpp 2013-09-11 15:28:22 +0000
751+++ test/qmltest/mocks/plugins/Unity/Launcher/TestLauncherPlugin.cpp 2016-12-12 16:53:20 +0000
752@@ -21,9 +21,11 @@
753 #include <Mocks/MockLauncherModel.h>
754 #include <Mocks/MockLauncherItem.h>
755 #include <Mocks/MockQuickListModel.h>
756+#include <Mocks/MockAppDrawerModel.h>
757
758 #include <LauncherModelInterface.h>
759 #include <LauncherItemInterface.h>
760+#include <AppDrawerModelInterface.h>
761
762 #include <QtQml/qqml.h>
763
764@@ -42,10 +44,12 @@
765 qmlRegisterUncreatableType<LauncherModelInterface>(uri, 0, 1, "LauncherModelInterface", "Interface for the LauncherModel");
766 qmlRegisterUncreatableType<LauncherItemInterface>(uri, 0, 1, "LauncherItemInterface", "Interface for the LauncherItem");
767 qmlRegisterUncreatableType<QuickListModelInterface>(uri, 0, 1, "QuickListModelInterface", "Interface for the QuickListModel");
768+ qmlRegisterUncreatableType<AppDrawerModelInterface>(uri, 0, 1, "AppDrawerModelInterface", "Interface for the AppDrawerModel");
769
770 qmlRegisterSingletonType<MockLauncherModel>(uri, 0, 1, "LauncherModel", modelProvider);
771 qmlRegisterUncreatableType<MockLauncherItem>(uri, 0, 1, "LauncherItem", "Can't create LauncherItems in QML. Get them from the LauncherModel");
772 qmlRegisterUncreatableType<MockQuickListModel>(uri, 0, 1, "QuickListModel", "Can't create QuickListModels in QML. Get them from the LauncherItems");
773+ qmlRegisterType<MockAppDrawerModel>(uri, 0, 1, "AppDrawerModel");
774
775 // Need to register the appmanager here ourselves as there won't be a real AppManager plugin in this test
776 qmlRegisterUncreatableType<unity::shell::application::ApplicationManagerInterface>(uri, 0, 1, "ApplicationManagerInterface", "Interface for the ApplicationManager");
777
778=== modified file 'test/qmltest/unity/shell/launcher/tst_Launcher.qml'
779--- test/qmltest/unity/shell/launcher/tst_Launcher.qml 2016-10-28 11:14:37 +0000
780+++ test/qmltest/unity/shell/launcher/tst_Launcher.qml 2016-12-12 16:53:20 +0000
781@@ -1,5 +1,5 @@
782 /*
783- * Copyright 2013 Canonical Ltd.
784+ * Copyright 2013-2016 Canonical Ltd.
785 *
786 * This program is free software; you can redistribute it and/or modify
787 * it under the terms of the GNU Lesser General Public License as published by
788@@ -12,9 +12,6 @@
789 *
790 * You should have received a copy of the GNU Lesser General Public License
791 * along with this program. If not, see <http://www.gnu.org/licenses/>.
792- *
793- * Authors:
794- * Michael Zanetti <michael.zanetti@canonical.com>
795 */
796
797 import QtQuick 2.0
798@@ -67,6 +64,15 @@
799 }
800 }
801
802+
803+ Repeater {
804+ id: appDrawerRepeater
805+ model: AppDrawerModel {}
806+ delegate: Item {
807+ property var roles: model
808+ }
809+ }
810+
811 function initTestCase() {
812 if (repeater.count < 5) {
813 print("This Test Suite requires at least 5 items in the model.")
814@@ -138,6 +144,7 @@
815 { tag: "Item.properties[appId]", constant: "appId", type: "string" },
816 { tag: "Item.properties[name]", constant: "name", type: "string" },
817 { tag: "Item.properties[icon]", constant: "icon", type: "string" },
818+ { tag: "Item.properties[keywords]", constant: "keywords", type: "object" },
819 { tag: "Item.properties[pinned]", property: "pinned", type: "boolean" },
820 { tag: "Item.properties[recent]", property: "recent", type: "boolean" },
821 { tag: "Item.properties[running]", property: "running", type: "boolean" },
822@@ -182,5 +189,26 @@
823
824 verifyData(data);
825 }
826+
827+ function test_appdrawer_model_roles_data() {
828+ return [
829+ { tag: "Model.roles[appId]", role: "appId", type: "string" },
830+ { tag: "Model.roles[name]", role: "name", type: "string" },
831+ { tag: "Model.roles[icon]", role: "icon", type: "string" },
832+ { tag: "Model.roles[keywords]", role: "keywords", type: "object" },
833+ { tag: "Model.roles[usage]", role: "usage", type: "number" },
834+ ];
835+ }
836+
837+ function test_appdrawer_model_roles(data) {
838+ name = "AppDrawerModel"
839+ try {
840+ object = appDrawerRepeater.itemAt(0).roles;
841+ } catch(err) {
842+ object = undefined;
843+ }
844+
845+ verifyData(data);
846+ }
847 }
848 }

Subscribers

People subscribed via source and target branches

to all changes: