on xenial help sign in
Remove stage property from Application
aa017a9Daniel d'Andrada
CMakeLists.txt+1−1
@@ -57,7 +57,7 @@ find_package(Qt5DBus 5.4 REQUIRED)
57find_package(Qt5Concurrent 5.4 REQUIRED)
57find_package(Qt5Concurrent 5.4 REQUIRED)
58find_package(Qt5Sql 5.4 REQUIRED)
58find_package(Qt5Sql 5.4 REQUIRED)
59
59
60−pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=19)
60+pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=20)
61pkg_check_modules(GEONAMES REQUIRED geonames>=0.2)
61pkg_check_modules(GEONAMES REQUIRED geonames>=0.2)
62pkg_check_modules(GIO REQUIRED gio-2.0>=2.32)
62pkg_check_modules(GIO REQUIRED gio-2.0>=2.32)
63pkg_check_modules(GLIB REQUIRED glib-2.0>=2.32)
63pkg_check_modules(GLIB REQUIRED glib-2.0>=2.32)
debian/control+3−3
@@ -34,7 +34,7 @@ Build-Depends: cmake,
34 libubuntugestures5-dev,
34 libubuntugestures5-dev,
35 libubuntugestures5-private-dev,
35 libubuntugestures5-private-dev,
36 libudev-dev,
36 libudev-dev,
37− libunity-api-dev (>= 7.116),
37+ libunity-api-dev (>= 7.117),
38 libusermetricsoutput1-dev,
38 libusermetricsoutput1-dev,
39# Need those X11 libs touch emulation from mouse events in manual QML tests on a X11 desktop
39# Need those X11 libs touch emulation from mouse events in manual QML tests on a X11 desktop
40 libx11-dev[!armhf],
40 libx11-dev[!armhf],
@@ -151,7 +151,7 @@ Depends: qml-module-qtquick-layouts,
151 qtdeclarative5-ubuntu-settings-components (>= 0.7),
151 qtdeclarative5-ubuntu-settings-components (>= 0.7),
152 qtdeclarative5-unity-notifications-plugin (>= 0.1.2) | unity-notifications-impl,
152 qtdeclarative5-unity-notifications-plugin (>= 0.1.2) | unity-notifications-impl,
153 ubuntu-thumbnailer-impl-0,
153 ubuntu-thumbnailer-impl-0,
154− unity-application-impl-19,
154+ unity-application-impl-20,
155 unity-notifications-impl-3,
155 unity-notifications-impl-3,
156 unity-plugin-scopes | unity-scopes-impl,
156 unity-plugin-scopes | unity-scopes-impl,
157 unity-scopes-impl-12,
157 unity-scopes-impl-12,
@@ -197,7 +197,7 @@ Pre-Depends: ${misc:Pre-Depends},
197Depends: ${misc:Depends},
197Depends: ${misc:Depends},
198 ${shlibs:Depends},
198 ${shlibs:Depends},
199Provides: unity-application-impl,
199Provides: unity-application-impl,
200− unity-application-impl-19,
200+ unity-application-impl-20,
201Replaces: unity8-autopilot (<< 8.02+15.04.20150422-0ubuntu1)
201Replaces: unity8-autopilot (<< 8.02+15.04.20150422-0ubuntu1)
202Description: Fake environment for running Unity 8 shell
202Description: Fake environment for running Unity 8 shell
203 Provides fake implementations of some QML modules used by Unity 8 shell
203 Provides fake implementations of some QML modules used by Unity 8 shell
qml/Stages/TabletStage.qml+1−1
@@ -536,7 +536,7 @@ AbstractStage {
536 if (!app) {
536 if (!app) {
537 return index;
537 return index;
538 }
538 }
539− var stage = spreadRepeater.itemAt(index) ? spreadRepeater.itemAt(index).stage : app.stage;
539+ var stage = spreadRepeater.itemAt(index) ? spreadRepeater.itemAt(index).stage : ApplicationInfoInterface.MainStage;
540
540
541 // don't shuffle indexes greater than "actives or next"
541 // don't shuffle indexes greater than "actives or next"
542 if (index > 2) return index;
542 if (index > 2) return index;
tests/mocks/Unity/Application/ApplicationInfo.cpp−8
@@ -175,14 +175,6 @@ void ApplicationInfo::setIcon(const QUrl &value)
175 }
175 }
176}
176}
177
177
178−void ApplicationInfo::setStage(Stage value)
179−{
180− if (value != m_stage) {
181− m_stage = value;
182− Q_EMIT stageChanged(value);
183− }
184−}
185−
186void ApplicationInfo::setState(State value)
178void ApplicationInfo::setState(State value)
187{
179{
188 if (value != m_state) {
180 if (value != m_state) {
tests/mocks/Unity/Application/ApplicationInfo.h−4
@@ -67,9 +67,6 @@ public:
67
67
68 QUrl icon() const override { return m_icon; }
68 QUrl icon() const override { return m_icon; }
69
69
70− Q_INVOKABLE void setStage(Stage value) override; // invokable only for mock
71− Stage stage() const override { return m_stage; }
72−
73 Q_INVOKABLE void setState(State value);
70 Q_INVOKABLE void setState(State value);
74 State state() const override { return m_state; }
71 State state() const override { return m_state; }
75
72
@@ -137,7 +134,6 @@ private:
137 QString m_appId;
134 QString m_appId;
138 QString m_name;
135 QString m_name;
139 QUrl m_icon;
136 QUrl m_icon;
140− Stage m_stage{MainStage};
141 State m_state{Stopped};
137 State m_state{Stopped};
142 bool m_fullscreen{false};
138 bool m_fullscreen{false};
143 Qt::ScreenOrientations m_supportedOrientations{Qt::PortraitOrientation |
139 Qt::ScreenOrientations m_supportedOrientations{Qt::PortraitOrientation |
tests/mocks/Unity/Application/ApplicationManager.cpp−10
@@ -102,8 +102,6 @@ QVariant ApplicationManager::data(const QModelIndex& index, int role) const {
102 return app->comment();
102 return app->comment();
103 case RoleIcon:
103 case RoleIcon:
104 return app->icon();
104 return app->icon();
105− case RoleStage:
106− return app->stage();
107 case RoleState:
105 case RoleState:
108 return app->state();
106 return app->state();
109 case RoleFocused:
107 case RoleFocused:
@@ -166,11 +164,6 @@ bool ApplicationManager::add(ApplicationInfo *application) {
166 if (!appIndex.isValid()) return;
164 if (!appIndex.isValid()) return;
167 Q_EMIT dataChanged(appIndex, appIndex, QVector<int>() << ApplicationManager::RoleState);
165 Q_EMIT dataChanged(appIndex, appIndex, QVector<int>() << ApplicationManager::RoleState);
168 });
166 });
169− connect(application, &ApplicationInfo::stageChanged, this, [application, this]() {
170− QModelIndex appIndex = findIndex(application);
171− if (!appIndex.isValid()) return;
172− Q_EMIT dataChanged(appIndex, appIndex, QVector<int>() << ApplicationManager::RoleStage);
173− });
174
167
175 connect(application, &ApplicationInfo::closed, this, [application, this]() {
168 connect(application, &ApplicationInfo::closed, this, [application, this]() {
176 this->remove(application);
169 this->remove(application);
@@ -344,7 +337,6 @@ void ApplicationManager::buildListOfAvailableApplications()
344 application->setScreenshotId("gallery");
337 application->setScreenshotId("gallery");
345 application->setIconId("gallery");
338 application->setIconId("gallery");
346 application->setShellChrome(Mir::LowChrome);
339 application->setShellChrome(Mir::LowChrome);
347− application->setStage(ApplicationInfo::MainStage);
348 m_availableApplications.append(application);
340 m_availableApplications.append(application);
349
341
350 application = new ApplicationInfo(this);
342 application = new ApplicationInfo(this);
@@ -381,7 +373,6 @@ void ApplicationManager::buildListOfAvailableApplications()
381 application->setName("GMail");
373 application->setName("GMail");
382 application->setIconId("gmail");
374 application->setIconId("gmail");
383 application->setScreenshotId("gmail-webapp.svg");
375 application->setScreenshotId("gmail-webapp.svg");
384− application->setStage(ApplicationInfo::MainStage);
385 application->setSupportedOrientations(Qt::PortraitOrientation
376 application->setSupportedOrientations(Qt::PortraitOrientation
386 | Qt::LandscapeOrientation
377 | Qt::LandscapeOrientation
387 | Qt::InvertedPortraitOrientation
378 | Qt::InvertedPortraitOrientation
@@ -393,7 +384,6 @@ void ApplicationManager::buildListOfAvailableApplications()
393 application->setName("Music");
384 application->setName("Music");
394 application->setIconId("soundcloud");
385 application->setIconId("soundcloud");
395 application->setScreenshotId("music");
386 application->setScreenshotId("music");
396− application->setStage(ApplicationInfo::MainStage);
397 application->setSupportedOrientations(Qt::PortraitOrientation
387 application->setSupportedOrientations(Qt::PortraitOrientation
398 | Qt::LandscapeOrientation
388 | Qt::LandscapeOrientation
399 | Qt::InvertedPortraitOrientation
389 | Qt::InvertedPortraitOrientation
tests/plugins/Unity/Launcher/launchermodeltest.cpp−2
@@ -49,8 +49,6 @@ public:
49 QString name() const override { return "mock"; }
49 QString name() const override { return "mock"; }
50 QString comment() const override { return "this is a mock"; }
50 QString comment() const override { return "this is a mock"; }
51 QUrl icon() const override { return QUrl(); }
51 QUrl icon() const override { return QUrl(); }
52− ApplicationInfoInterface::Stage stage() const override { return ApplicationInfoInterface::MainStage; }
53− void setStage(ApplicationInfoInterface::Stage) override {}
54 ApplicationInfoInterface::State state() const override { return ApplicationInfoInterface::Running; }
52 ApplicationInfoInterface::State state() const override { return ApplicationInfoInterface::Running; }
55 bool focused() const override { return m_focused; }
53 bool focused() const override { return m_focused; }
56 QString splashTitle() const override { return QString(); }
54 QString splashTitle() const override { return QString(); }
tests/qmltests/Stages/tst_TabletStage.qml+6−3
@@ -290,8 +290,9 @@ Rectangle {
290 var webbrowserSurfaceId = topSurfaceList.nextId;
290 var webbrowserSurfaceId = topSurfaceList.nextId;
291 webbrowserCheckBox.checked = true;
291 webbrowserCheckBox.checked = true;
292 waitUntilAppSurfaceShowsUp(webbrowserSurfaceId);
292 waitUntilAppSurfaceShowsUp(webbrowserSurfaceId);
293− var webbrowserApp = ApplicationManager.findApplication(webbrowserCheckBox.appId);
293+ var webbrowserDelegate = findChild(tabletStage, "spreadDelegate_" + webbrowserSurfaceId);
294+ verify(webbrowserDelegate);
294− compare(webbrowserApp.stage, ApplicationInfoInterface.MainStage);
295+ compare(webbrowserDelegate.stage, ApplicationInfoInterface.MainStage);
295 var webbrowserWindow = findAppWindowForSurfaceId(webbrowserSurfaceId);
296 var webbrowserWindow = findAppWindowForSurfaceId(webbrowserSurfaceId);
296 verify(webbrowserWindow);
297 verify(webbrowserWindow);
297
298
@@ -397,8 +398,10 @@ Rectangle {
397 var webbrowserSurfaceId = topSurfaceList.nextId;
398 var webbrowserSurfaceId = topSurfaceList.nextId;
398 webbrowserCheckBox.checked = true;
399 webbrowserCheckBox.checked = true;
399 waitUntilAppSurfaceShowsUp(webbrowserSurfaceId);
400 waitUntilAppSurfaceShowsUp(webbrowserSurfaceId);
401+ var webbrowserDelegate = findChild(tabletStage, "spreadDelegate_" + webbrowserSurfaceId);
402+ verify(webbrowserDelegate);
403+ compare(webbrowserDelegate.stage, ApplicationInfoInterface.MainStage);
400 var webbrowserApp = ApplicationManager.findApplication(webbrowserCheckBox.appId);
404 var webbrowserApp = ApplicationManager.findApplication(webbrowserCheckBox.appId);
401− compare(webbrowserApp.stage, ApplicationInfoInterface.MainStage);
402
405
403 var gallerySurfaceId = topSurfaceList.nextId;
406 var gallerySurfaceId = topSurfaceList.nextId;
404 galleryCheckBox.checked = true;
407 galleryCheckBox.checked = true;