Merge lp:~mzanetti/unity-api/surfaceCount-property into lp:unity-api

Proposed by Michael Zanetti
Status: Merged
Approved by: Albert Astals Cid
Approved revision: 237
Merged at revision: 236
Proposed branch: lp:~mzanetti/unity-api/surfaceCount-property
Merge into: lp:unity-api
Diff against target: 256 lines (+56/-8)
13 files modified
debian/changelog (+6/-0)
include/unity/shell/application/ApplicationInfoInterface.h (+14/-2)
include/unity/shell/application/CMakeLists.txt (+1/-1)
include/unity/shell/application/MirSurfaceListInterface.h (+1/-1)
include/unity/shell/launcher/CMakeLists.txt (+1/-1)
include/unity/shell/launcher/LauncherItemInterface.h (+9/-0)
include/unity/shell/launcher/LauncherModelInterface.h (+3/-1)
test/qmltest/mocks/plugins/Unity/Application/Mocks/MockApplicationInfo.cpp (+5/-0)
test/qmltest/mocks/plugins/Unity/Application/Mocks/MockApplicationInfo.h (+3/-2)
test/qmltest/mocks/plugins/Unity/Launcher/Mocks/MockLauncherItem.cpp (+6/-0)
test/qmltest/mocks/plugins/Unity/Launcher/Mocks/MockLauncherItem.h (+3/-0)
test/qmltest/mocks/plugins/Unity/Launcher/Mocks/MockLauncherModel.cpp (+2/-0)
test/qmltest/unity/shell/launcher/tst_Launcher.qml (+2/-0)
To merge this branch: bzr merge lp:~mzanetti/unity-api/surfaceCount-property
Reviewer Review Type Date Requested Status
Unity8 CI Bot continuous-integration Approve
Albert Astals Cid (community) Approve
Daniel d'Andrada (community) Disapprove
Lukáš Tinkl (community) Approve
Review via email: mp+294264@code.launchpad.net

Commit message

Add a surface count property to the launcher model

In order to allow using the application api more easily, added a convenience property there too.

Description of the change

Related MPs:

https://code.launchpad.net/~mzanetti/unity8/launcher-surfaceCount-pips/+merge/294262
https://code.launchpad.net/~mzanetti/qtmir/surfaceCount-property/+merge/294265

I know the versions are gonna collide with other branches, I'll update them as we get closer to landing.

To post a comment you must log in.
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 :
review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Lukáš Tinkl (lukas-kde) wrote :

Just a minor nitpick: fix the typo in the apidox, "conveniece"

Otherwise all good from my side

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 :
review: Needs Fixing (continuous-integration)
Revision history for this message
Lukáš Tinkl (lukas-kde) wrote :

LGTM, works fine with the qtmir/u8 branches

review: Approve
Revision history for this message
Daniel d'Andrada (dandrader) wrote :

As I explained in the unity8 MP, I think this Application::surfaceCount property is redundant.

As http://bazaar.launchpad.net/~dandrader/unity8/launcher-surfaceCount-pips/revision/2398 shows.

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

PASSED: Continuous integration, rev:236
https://unity8-jenkins.ubuntu.com/job/lp-unity-api-ci/82/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/1671
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/1621
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/1621
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1614
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1614/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1614
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1614/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1614
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1614/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1614
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1614/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/1614
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/1614/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/1614
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/1614/artifact/output/*zip*/output.zip

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

review: Approve (continuous-integration)
237. By Michael Zanetti

merge trunk

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

PASSED: Continuous integration, rev:237
https://unity8-jenkins.ubuntu.com/job/lp-unity-api-ci/83/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/1684
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/1634
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/1634
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1627
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1627/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1627
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1627/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1627
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1627/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1627
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1627/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/1627
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/1627/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/1627
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/1627/artifact/output/*zip*/output.zip

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

review: Approve (continuous-integration)
Revision history for this message
Michael Zanetti (mzanetti) wrote :

> As I explained in the unity8 MP, I think this Application::surfaceCount
> property is redundant.
>
> As http://bazaar.launchpad.net/~dandrader/unity8/launcher-surfaceCount-
> pips/revision/2398 shows.

Just because you think your approach is better and you're on a mission to put a needs fixing on each and every merge proposal that's not yours? As I said, I strongly disagree on apis that require people to capture pointers to objects with potentially different lifetime in lambdas (I can't even count how many crashes we had in qtmir because of this bad practice).

Api design is not just about naming signals not like slots. It's about providing an api that is fail-safe to use. Requiring the user to have knowledge about lifetime of other objects than the one he connects to is bad.

Revision history for this message
Daniel d'Andrada (dandrader) wrote :

On 19/05/2016 08:08, Michael Zanetti wrote:
>> As I explained in the unity8 MP, I think this Application::surfaceCount
>> property is redundant.
>>
>> As http://bazaar.launchpad.net/~dandrader/unity8/launcher-surfaceCount-
>> pips/revision/2398 shows.
>
> Just because you think your approach is better and you're on a mission to put a needs fixing on each and every merge proposal that's not yours? As I said, I strongly disagree on apis that require people to capture pointers to objects with potentially different lifetime in lambdas (I can't even count how many crashes we had in qtmir because of this bad practice).
>
> Api design is not just about naming signals not like slots. It's about providing an api that is fail-safe to use. Requiring the user to have knowledge about lifetime of other objects than the one he connects to is bad.
>

We will have to agree to disagree in that topic.

So let me get just one more reviewer/opinion so we can move on and
resolve that standoff.

I apologize for putting back to "need review" an already approved branch
just because of API style (I see that now that it can be seen as an
offensive and agressive move), but would appreciate if the message
exchange remained on the topic and didn't degrade to personal attacks.

Revision history for this message
Albert Astals Cid (aacid) wrote :

I think it's just two different ways to approach how to implement the feature, and I can't mark one as better than the other.

Daniel has a point in that the list is documented to be a constant property so it won't disappear magically under your feet, but on the other hand you need an extra disconnect that is a bit uglier.

This is a nice philosophical discussion and makes for a nice bar+beer nerd-discussion.

BUT let's not forget we're here to make a product and that we need to be pragmatical and let's agree that the code written here is not so bad that it needs to be rewritten and cause another round of reviews + review fixes, which probably mean a day or more of work-time invested in something that will still give us a feature with the same level of quality and maintenance effort as we have now.

For that reason i'm just going to approve this MR.

Let's try to be a bit more pragmatical with the reviews and also take comments a bit less personally (i know it's hard, i'm the first to fail)

review: Approve
238. By Michael Zanetti

bump application API version again

Now that trunk has been updated to 16 already

239. By Michael Zanetti

merge trunk

240. By Michael Zanetti

bump version once more

241. By Michael Zanetti

bump debian/changelog

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

PASSED: Continuous integration, rev:238
https://unity8-jenkins.ubuntu.com/job/lp-unity-api-ci/86/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/1826
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/1854
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/1790
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/1790
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/1790
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1781
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1781/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1781
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1781/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/1781
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/1781/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1781
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1781/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1781
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1781/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/1781
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/1781/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/1781
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/1781/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/1781
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/1781/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/1781
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/1781/artifact/output/*zip*/output.zip

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

review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/changelog'
--- debian/changelog 2016-05-25 06:02:38 +0000
+++ debian/changelog 2016-06-03 11:15:53 +0000
@@ -1,3 +1,9 @@
1unity-api (7.114) UNRELEASED; urgency=medium
2
3 * Add ApplicationInfoInterface::surfaceCount property
4
5 -- Michael Zanetti <michael.zanetti@canonical.com> Mon, 09 May 2016 18:43:38 +0200
6
1unity-api (7.113+16.10.20160525-0ubuntu1) yakkety; urgency=medium7unity-api (7.113+16.10.20160525-0ubuntu1) yakkety; urgency=medium
28
3 [ Daniel d'Andrada ]9 [ Daniel d'Andrada ]
410
=== modified file 'include/unity/shell/application/ApplicationInfoInterface.h'
--- include/unity/shell/application/ApplicationInfoInterface.h 2016-05-17 12:55:00 +0000
+++ include/unity/shell/application/ApplicationInfoInterface.h 2016-06-03 11:15:53 +0000
@@ -229,6 +229,16 @@
229 */229 */
230 Q_PROPERTY(unity::shell::application::MirSurfaceListInterface* promptSurfaceList READ promptSurfaceList CONSTANT)230 Q_PROPERTY(unity::shell::application::MirSurfaceListInterface* promptSurfaceList READ promptSurfaceList CONSTANT)
231231
232 /**
233 * @brief Count of application's surfaces
234 *
235 * This is a convenience property and will always be the same as surfaceList->count().
236 * It allows to connect to an application and listen for surface creations/removals for
237 * that particular application without having to keep track of the
238 * application <-> surfaceList relationship.
239 */
240 Q_PROPERTY(int surfaceCount READ surfaceCount NOTIFY surfaceCountChanged)
241
232protected:242protected:
233 /// @cond243 /// @cond
234 ApplicationInfoInterface(const QString &appId, QObject* parent = 0): QObject(parent) { Q_UNUSED(appId) }244 ApplicationInfoInterface(const QString &appId, QObject* parent = 0): QObject(parent) { Q_UNUSED(appId) }
@@ -305,8 +315,9 @@
305 virtual void setExemptFromLifecycle(bool) = 0;315 virtual void setExemptFromLifecycle(bool) = 0;
306 virtual QSize initialSurfaceSize() const = 0;316 virtual QSize initialSurfaceSize() const = 0;
307 virtual void setInitialSurfaceSize(const QSize &size) = 0;317 virtual void setInitialSurfaceSize(const QSize &size) = 0;
308 virtual MirSurfaceListInterface* surfaceList() = 0;318 virtual MirSurfaceListInterface* surfaceList() const = 0;
309 virtual MirSurfaceListInterface* promptSurfaceList() = 0;319 virtual MirSurfaceListInterface* promptSurfaceList() const = 0;
320 virtual int surfaceCount() const = 0;
310 /// @endcond321 /// @endcond
311322
312Q_SIGNALS:323Q_SIGNALS:
@@ -320,6 +331,7 @@
320 void focusedChanged(bool focused);331 void focusedChanged(bool focused);
321 void exemptFromLifecycleChanged(bool exemptFromLifecycle);332 void exemptFromLifecycleChanged(bool exemptFromLifecycle);
322 void initialSurfaceSizeChanged(const QSize &size);333 void initialSurfaceSizeChanged(const QSize &size);
334 void surfaceCountChanged(int surfaceCount);
323 /// @endcond335 /// @endcond
324336
325 /**337 /**
326338
=== modified file 'include/unity/shell/application/CMakeLists.txt'
--- include/unity/shell/application/CMakeLists.txt 2016-05-18 20:51:23 +0000
+++ include/unity/shell/application/CMakeLists.txt 2016-06-03 11:15:53 +0000
@@ -7,7 +7,7 @@
77
8set(UNITY_API_LIB_HDRS ${UNITY_API_LIB_HDRS} ${headers} ${internal_headers} PARENT_SCOPE)8set(UNITY_API_LIB_HDRS ${UNITY_API_LIB_HDRS} ${headers} ${internal_headers} PARENT_SCOPE)
99
10set(VERSION 17)10set(VERSION 18)
11set(PKGCONFIG_NAME "unity-shell-application")11set(PKGCONFIG_NAME "unity-shell-application")
12set(PKGCONFIG_DESCRIPTION "Unity shell Application APIs")12set(PKGCONFIG_DESCRIPTION "Unity shell Application APIs")
13set(PKGCONFIG_REQUIRES "Qt5Core")13set(PKGCONFIG_REQUIRES "Qt5Core")
1414
=== modified file 'include/unity/shell/application/MirSurfaceListInterface.h'
--- include/unity/shell/application/MirSurfaceListInterface.h 2016-05-25 06:02:36 +0000
+++ include/unity/shell/application/MirSurfaceListInterface.h 2016-06-03 11:15:53 +0000
@@ -89,7 +89,7 @@
8989
90Q_SIGNALS:90Q_SIGNALS:
91 /// @cond91 /// @cond
92 void countChanged();92 void countChanged(int count);
93 void firstChanged();93 void firstChanged();
94 /// @endcond94 /// @endcond
95};95};
9696
=== modified file 'include/unity/shell/launcher/CMakeLists.txt'
--- include/unity/shell/launcher/CMakeLists.txt 2015-06-19 16:13:00 +0000
+++ include/unity/shell/launcher/CMakeLists.txt 2016-06-03 11:15:53 +0000
@@ -7,7 +7,7 @@
77
8set(UNITY_API_LIB_HDRS ${UNITY_API_LIB_HDRS} ${headers} ${internal_headers} PARENT_SCOPE)8set(UNITY_API_LIB_HDRS ${UNITY_API_LIB_HDRS} ${headers} ${internal_headers} PARENT_SCOPE)
99
10set(VERSION 7)10set(VERSION 8)
11set(PKGCONFIG_NAME "unity-shell-launcher")11set(PKGCONFIG_NAME "unity-shell-launcher")
12set(PKGCONFIG_DESCRIPTION "Unity shell Launcher APIs")12set(PKGCONFIG_DESCRIPTION "Unity shell Launcher APIs")
13set(PKGCONFIG_REQUIRES "Qt5Core")13set(PKGCONFIG_REQUIRES "Qt5Core")
1414
=== modified file 'include/unity/shell/launcher/LauncherItemInterface.h'
--- include/unity/shell/launcher/LauncherItemInterface.h 2015-06-12 11:06:29 +0000
+++ include/unity/shell/launcher/LauncherItemInterface.h 2016-06-03 11:15:53 +0000
@@ -112,6 +112,13 @@
112 Q_PROPERTY(bool alerting READ alerting NOTIFY alertingChanged)112 Q_PROPERTY(bool alerting READ alerting NOTIFY alertingChanged)
113113
114 /**114 /**
115 * @brief The number of surfaces that this application entry has opened
116 *
117 * The Launcher will display up to 3 pips, one for each surface
118 */
119 Q_PROPERTY(int surfaceCount READ surfaceCount NOTIFY surfaceCountChanged)
120
121 /**
115 * @brief The quick list menu contents for the item122 * @brief The quick list menu contents for the item
116 *123 *
117 * Items can have a quick list menu. This property holds a model for124 * Items can have a quick list menu. This property holds a model for
@@ -138,6 +145,7 @@
138 virtual bool countVisible() const = 0;145 virtual bool countVisible() const = 0;
139 virtual bool focused() const = 0;146 virtual bool focused() const = 0;
140 virtual bool alerting() const = 0;147 virtual bool alerting() const = 0;
148 virtual int surfaceCount() const = 0;
141 virtual unity::shell::launcher::QuickListModelInterface *quickList() const = 0;149 virtual unity::shell::launcher::QuickListModelInterface *quickList() const = 0;
142150
143Q_SIGNALS:151Q_SIGNALS:
@@ -151,6 +159,7 @@
151 void countVisibleChanged(bool countVisible);159 void countVisibleChanged(bool countVisible);
152 void focusedChanged(bool focused);160 void focusedChanged(bool focused);
153 void alertingChanged(bool alerting);161 void alertingChanged(bool alerting);
162 void surfaceCountChanged(int surfaceCount);
154 /// @endcond163 /// @endcond
155};164};
156165
157166
=== modified file 'include/unity/shell/launcher/LauncherModelInterface.h'
--- include/unity/shell/launcher/LauncherModelInterface.h 2015-06-19 16:13:00 +0000
+++ include/unity/shell/launcher/LauncherModelInterface.h 2016-06-03 11:15:53 +0000
@@ -73,6 +73,7 @@
73 m_roleNames.insert(RoleCountVisible, "countVisible");73 m_roleNames.insert(RoleCountVisible, "countVisible");
74 m_roleNames.insert(RoleFocused, "focused");74 m_roleNames.insert(RoleFocused, "focused");
75 m_roleNames.insert(RoleAlerting, "alerting");75 m_roleNames.insert(RoleAlerting, "alerting");
76 m_roleNames.insert(RoleSurfaceCount, "surfaceCount");
76 }77 }
77 /// @endcond78 /// @endcond
7879
@@ -93,7 +94,8 @@
93 RoleCount,94 RoleCount,
94 RoleCountVisible,95 RoleCountVisible,
95 RoleFocused,96 RoleFocused,
96 RoleAlerting97 RoleAlerting,
98 RoleSurfaceCount
97 };99 };
98100
99 virtual ~LauncherModelInterface() {}101 virtual ~LauncherModelInterface() {}
100102
=== modified file 'test/qmltest/mocks/plugins/Unity/Application/Mocks/MockApplicationInfo.cpp'
--- test/qmltest/mocks/plugins/Unity/Application/Mocks/MockApplicationInfo.cpp 2015-12-03 17:07:15 +0000
+++ test/qmltest/mocks/plugins/Unity/Application/Mocks/MockApplicationInfo.cpp 2016-06-03 11:15:53 +0000
@@ -164,3 +164,8 @@
164 Q_EMIT exemptFromLifecycleChanged(m_exemptFromLifecycle);164 Q_EMIT exemptFromLifecycleChanged(m_exemptFromLifecycle);
165 }165 }
166}166}
167
168int MockApplicationInfo::surfaceCount() const
169{
170 return 1;
171}
167172
=== modified file 'test/qmltest/mocks/plugins/Unity/Application/Mocks/MockApplicationInfo.h'
--- test/qmltest/mocks/plugins/Unity/Application/Mocks/MockApplicationInfo.h 2016-05-17 12:55:00 +0000
+++ test/qmltest/mocks/plugins/Unity/Application/Mocks/MockApplicationInfo.h 2016-06-03 11:15:53 +0000
@@ -62,8 +62,9 @@
62 QSize initialSurfaceSize() const override { return QSize(); }62 QSize initialSurfaceSize() const override { return QSize(); }
63 void setInitialSurfaceSize(const QSize &) override {}63 void setInitialSurfaceSize(const QSize &) override {}
6464
65 MirSurfaceListInterface* surfaceList() override { return nullptr; }65 MirSurfaceListInterface* surfaceList() const override { return nullptr; }
66 MirSurfaceListInterface* promptSurfaceList() override { return nullptr; }66 MirSurfaceListInterface* promptSurfaceList() const override { return nullptr; }
67 int surfaceCount() const override;
6768
68private:69private:
69 QString m_appId;70 QString m_appId;
7071
=== modified file 'test/qmltest/mocks/plugins/Unity/Launcher/Mocks/MockLauncherItem.cpp'
--- test/qmltest/mocks/plugins/Unity/Launcher/Mocks/MockLauncherItem.cpp 2015-06-18 17:03:45 +0000
+++ test/qmltest/mocks/plugins/Unity/Launcher/Mocks/MockLauncherItem.cpp 2016-06-03 11:15:53 +0000
@@ -35,6 +35,7 @@
35 m_count(8),35 m_count(8),
36 m_countVisible(false),36 m_countVisible(false),
37 m_alerting(false),37 m_alerting(false),
38 m_surfaceCount(1),
38 m_quickListModel(new MockQuickListModel(this))39 m_quickListModel(new MockQuickListModel(this))
39{40{
4041
@@ -172,6 +173,11 @@
172 }173 }
173}174}
174175
176int MockLauncherItem::surfaceCount() const
177{
178 return m_surfaceCount;
179}
180
175QuickListModelInterface *MockLauncherItem::quickList() const181QuickListModelInterface *MockLauncherItem::quickList() const
176{182{
177 return m_quickListModel;183 return m_quickListModel;
178184
=== modified file 'test/qmltest/mocks/plugins/Unity/Launcher/Mocks/MockLauncherItem.h'
--- test/qmltest/mocks/plugins/Unity/Launcher/Mocks/MockLauncherItem.h 2015-06-02 13:52:49 +0000
+++ test/qmltest/mocks/plugins/Unity/Launcher/Mocks/MockLauncherItem.h 2016-06-03 11:15:53 +0000
@@ -59,6 +59,8 @@
59 bool alerting() const;59 bool alerting() const;
60 void setAlerting(bool alerting);60 void setAlerting(bool alerting);
6161
62 int surfaceCount() const override;
63
62 unity::shell::launcher::QuickListModelInterface *quickList() const;64 unity::shell::launcher::QuickListModelInterface *quickList() const;
6365
64private:66private:
@@ -74,6 +76,7 @@
74 bool m_countVisible;76 bool m_countVisible;
75 bool m_focused;77 bool m_focused;
76 bool m_alerting;78 bool m_alerting;
79 int m_surfaceCount;
77 QuickListModelInterface *m_quickListModel;80 QuickListModelInterface *m_quickListModel;
78};81};
7982
8083
=== modified file 'test/qmltest/mocks/plugins/Unity/Launcher/Mocks/MockLauncherModel.cpp'
--- test/qmltest/mocks/plugins/Unity/Launcher/Mocks/MockLauncherModel.cpp 2015-06-19 16:13:00 +0000
+++ test/qmltest/mocks/plugins/Unity/Launcher/Mocks/MockLauncherModel.cpp 2016-06-03 11:15:53 +0000
@@ -90,6 +90,8 @@
90 return item->focused();90 return item->focused();
91 case RoleAlerting:91 case RoleAlerting:
92 return item->alerting();92 return item->alerting();
93 case RoleSurfaceCount:
94 return item->surfaceCount();
93 }95 }
9496
95 return QVariant();97 return QVariant();
9698
=== modified file 'test/qmltest/unity/shell/launcher/tst_Launcher.qml'
--- test/qmltest/unity/shell/launcher/tst_Launcher.qml 2015-06-19 16:13:00 +0000
+++ test/qmltest/unity/shell/launcher/tst_Launcher.qml 2016-06-03 11:15:53 +0000
@@ -88,6 +88,7 @@
88 { tag: "Model.roles[countVisible]", role: "countVisible", type: "boolean" },88 { tag: "Model.roles[countVisible]", role: "countVisible", type: "boolean" },
89 { tag: "Model.roles[focused]", role: "focused", type: "boolean" },89 { tag: "Model.roles[focused]", role: "focused", type: "boolean" },
90 { tag: "Model.roles[alerting]", role: "alerting", type: "boolean" },90 { tag: "Model.roles[alerting]", role: "alerting", type: "boolean" },
91 { tag: "Model.roles[surfaceCount]", role: "surfaceCount", type: "number" },
91 ];92 ];
92 }93 }
9394
@@ -146,6 +147,7 @@
146 { tag: "Item.properties[countVisible]", property: "countVisible", type: "boolean" },147 { tag: "Item.properties[countVisible]", property: "countVisible", type: "boolean" },
147 { tag: "Item.properties[focused]", property: "focused", type: "boolean" },148 { tag: "Item.properties[focused]", property: "focused", type: "boolean" },
148 { tag: "Item.properties[alerting]", property: "alerting", type: "boolean" },149 { tag: "Item.properties[alerting]", property: "alerting", type: "boolean" },
150 { tag: "Item.properties[surfaceCount]", property: "surfaceCount", type: "number" },
149 { tag: "Item.properties[quickList]", constant: "quickList", type: "object" },151 { tag: "Item.properties[quickList]", constant: "quickList", type: "object" },
150 ];152 ];
151 }153 }

Subscribers

People subscribed via source and target branches

to all changes: